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

[snapshot] Add override_status_bar option #16419

Merged
merged 4 commits into from
May 12, 2020

Conversation

bouk
Copy link
Contributor

@bouk bouk commented May 3, 2020

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've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

xcode now has a way to override the status bar built-in, so there's no need for SimulatorStatusMagic any more.

Description

This will override the status bar with simctl to show 9:41 AM, and have full battery and reception.

Fixes #15319

This will override the status bar with simctl to show 9:41 AM, and have
full battery and reception.
@gelosi
Copy link

gelosi commented May 6, 2020

Cool MR! What if we can set the date? Instead of hardcoded 9:41? provide parameter with valid date-time string, using well known format? YYYY-MM-DD hh:mm

UI.message("Overriding Status Bar")

# The time needs to be passed as ISO8601 so the simulator formats it correctly
time = Time.new(2007, 1, 9, 9, 41, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this configurable can be tackled in a future PR <3

@janpio janpio changed the title snapshot: Add override_status_bar option [snapshot] Add override_status_bar option May 6, 2020
Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, someone with a Mac handy should test it though :)

@janpio janpio requested a review from joshdholtz May 6, 2020 16:53
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked perfectly! Thank you so much for adding this ❤

@joshdholtz joshdholtz merged commit 9ff7984 into fastlane:master May 12, 2020
Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations! 🎉 This was released as part of fastlane 2.147.0 🚀

@bouk bouk deleted the snapshot-override-status-bar branch May 25, 2020 19:17
minuscorp pushed a commit to minuscorp/fastlane that referenced this pull request Jul 18, 2020
* snapshot: Add override_status_bar option

This will override the status bar with simctl to show 9:41 AM, and have
full battery and reception.

* Reformat code for rubocop

* Update documentation to reference override_status_bar

* Use ISO8601 timestamp so the date is also correct on iPad
@fastlane fastlane locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support of new StatusBar overrides in iOS 13 when running Snapshot
6 participants