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 option for clean status bar #15124

Open
mathebox opened this issue Aug 2, 2019 · 7 comments

Comments

@mathebox
Copy link

commented Aug 2, 2019

Feature Request

Motivation Behind Feature

In order to produce a consistent appearance of the status bar in screenshots, developers often use Status Bar Magic to modify the displayed information.

With Xcode 11, this will be supported by the simulator and, thus, removing the need for an external dependency:

xcrun simctl status_bar <device> override --time "9:41" --batteryState charged --batteryLevel 100

(taken from the release notes for Xcode 11 beta 5)

Feature Description

Add an additional option to the snapshot config which will let the simulator launch with the set of parameter for a clean status bar.

Alternatives or Workarounds

An alternative would be the give the user more freedom in defining the parameters for the simulator. Here we could have an option in the snapshot config to specify the parameters for the simulator manually.

@janpio

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

A new feature totally makes sense, I expect lots of people will want to use this. Do you have a suggestion for a good name? We will probably need to detect the Xcode version and output an error if <Xcode11 I guess?

@mathebox

This comment has been minimized.

Copy link
Author

commented Aug 6, 2019

Here are my naming suggestion:

  • show_clean_status_bar or clean_status_bar (type: bool)
  • simulator_arguments (for the alternative approach)

You have to decide which approach aligns the best with fastlane's other functionalities.

Unfortunately, I don't have the time right now to work on this.

@janpio

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

launch_arguments already exists, we have to find out if this is similar to the suggested simulator_arguments to avoid duplication.

After looking into the command, it would probably even make sense to implement both your suggestions - the show_clean_status_bar option can use the common defaults you used above, and a comment can point to simulator_arguments and use an example of a different, more uncommon setup.

If someone tackles this, the documentation should be updated as well to point to this new parameter: https://github.com/fastlane/fastlane/blob/875e3482906044a4f9806dc869c8813d3a2e9a57/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md#use-a-clean-status-bar

@colejd

This comment has been minimized.

Copy link

commented Aug 13, 2019

I just finished writing a command line utility to do this. I think I could be of some help here -- I'll give it a shot.

(Edit from the future: I never got around to doing this, but if it's helpful, the utility I mentioned is here).

@julianschiavo

This comment has been minimized.

Copy link

commented Sep 5, 2019

Hey, does anyone have a solution for now to get it working with fastlane snapshot before an official PR is merged in?

@omastny

This comment has been minimized.

Copy link

commented Sep 25, 2019

I used this very nice solution which uses scheme pre- and post-actions -> Fixing Simulator Status Bars for App Store Screenshots With Xcode 11 and iOS 13

Works also with automation :)

@benck

This comment has been minimized.

Copy link

commented Oct 1, 2019

This command works when building and running apps from Xcode:
xcrun simctl status_bar "iPhone 11" override --time "9:41" --dataNetwork "lte" --cellularBars 4 --batteryLevel 100

But however, fastlane snapshot seems to reset the status bar every time running, here is the possible dirty fix for that
http://paulofierro.com/blog/2019/9/18/automating-screenshots-with-pretty-good-ios-simulator-status-bars-with-xcode-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.