Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default arguments for override_status_bar #21954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yeahphil
Copy link

@yeahphil yeahphil commented Apr 8, 2024

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #21255 -- shout out to @jeffphp who pinpoints the problem in that issue's discussion.

Snapshot's override_status_bar is currently broken when using default arguments. At some point, simctl got very picky about the ISO8601 date formats it would accept, and now gives an error if no fractional seconds are given.

This is easy to self-fix by supplying override_status_bar_arguments, but that requires digging in and understanding snapshot. And, this is a silent failure of the default override.

Description

This is a 3 character change (.iso8601 -> .iso8601(1)) that just adds 1 fractional digit to the seconds in the formatted time, and a comment about it.

Testing Steps

@ashton-seek
Copy link

ashton-seek commented Apr 16, 2024

This works on iOS 17.2 Simulators, but the iOS 15 iOS 16 simulator does not accept the new format, and is the latest iOS version you can use with the iPhone 8 Plus simulator, which is the newest device for the still required 5.5-inch screenshots. Tested on Xcode 15.1.0.

I haven't tested for any other backwards compatibility. Can we use the old timestamp format for iOS 15 iOS 16?

@yeahphil
Copy link
Author

yeahphil commented Apr 16, 2024

@ashton-seek I think you may be mistaken about the iPhone 8 Plus simulator. You should be able to install one that runs 16.x.

Makes sense that this format change should only happen for iOS 16+ simulators though. I'll try to take a look when I have a few minutes... surely the device's os version should be easily available.

@ashton-seek
Copy link

ashton-seek commented Apr 16, 2024

@yeahphil you are right, my mistake there. iOS 16 is available.

iPhone 8 Plus on iOS 16.0 doesn't support the new format still. iOS 16.4 nothing works, I can't find any value for time that has any affect...

What would be great is if you could have different override_status_bar_arguments for each device.

@jeffphp
Copy link

jeffphp commented Apr 16, 2024

@ashton-seek you should try this on iOS 16.4 :

override_status_bar_arguments("--time 9:41 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100")

If it doesn't work, try to get the commande line using verbose mode and remove the "&> /dev/null" at the end of the command line to let it show the actual error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS Simulator 16.1+ donnot support status bar time customization
3 participants