fastlane / fastlane

πŸš€ The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
38.97k stars 5.65k forks source link

Snapshot `headless` and `override_status_bar` not working? #17089

Closed seanrogs closed 3 years ago

seanrogs commented 3 years ago

New Issue Checklist

Issue Description

In my Snapfile, I'm setting headless(true) and override_status_bar(true), but the simulator windows are still displayed and the status bar does not get overridden.

When I run fastlane snapshot --help, neither of these options are listed for use with the command line.

I'm using Xcode 11.6.

Command executed

Here's my Snapfile:

scheme("my app")

devices([
  "iPhone 11 Pro Max", # 6.5" Display
  "iPhone 8 Plus", # 5.5" Display
  "iPhone SE (2nd generation)", # 4.7" Display
  "iPad Pro (12.9-inch) (4th generation)" # 12.9" Display
])

languages([
  "ar",
  "el", 
  "en-US", 
  "es-ES", 
  "ru", 
  "th", 
  "zh-Hans",
])

output_directory("./screenshot-dashboard")
clear_previous_screenshots(true)
override_status_bar(true)
headless(true)
number_of_retries(0)
Complete output when running fastlane, including the stack trace and command used

This is not complete but I think it shows the relevant details. I can provide more if necessary.

+----------------------------+-----------------------------------------------------------------------------+
|                                       Summary for snapshot 2.156.1                                       |
+----------------------------+-----------------------------------------------------------------------------+
| project                    | ./X.xcodeproj                                                   |
| output_directory           | /X/screenshot-dashboard                  |
| devices                    | ["iPhone 11 Pro Max", "iPhone 8 Plus", "iPhone SE (2nd generation)", "iPad  |
|                            | Pro (12.9-inch) (4th generation)"]                                          |
| languages                  | ["ar", "el", "en-US", "es-ES", "ru", "th", "zh-Hans"]                       |
| launch_arguments           | [""]                                                                        |
| output_simulator_logs      | false                                                                       |
| skip_open_summary          | false                                                                       |
| skip_helper_version_check  | false                                                                       |
| clear_previous_screenshots | true                                                                        |
| reinstall_app              | false                                                                       |
| erase_simulator            | false                                                                       |
| headless                   | true                                                                        |
| override_status_bar        | true                                                                        |
| localize_simulator         | false                                                                       |
| app_identifier             | X                                                             |
| buildlog_path              | ~/Library/Logs/snapshot                                                     |
| clean                      | false                                                                       |
| scheme                     | X                                                      |
| number_of_retries          | 0                                                                           |
| stop_after_first_error     | false                                                                       |
| result_bundle              | false                                                                       |
| concurrent_simulators      | true                                                                        |
| disable_slide_to_type      | false                                                                       |
| xcode_path                 | /Applications/Xcode.app                                                     |
+----------------------------+-----------------------------------------------------------------------------+

[10:40:51]: Clearing previously generated screenshots
[10:40:51]: Building and running project - this might take some time...
[10:40:59]: Patching simulators '/X/Library/Preferences/com.apple.iphonesimulator.plist' to scale to 100%
[10:41:06]: Launch Simulator iPhone 11 Pro Max
[10:41:06]: $ xcrun instruments -w BD1297CC-83D3-4335-A1A3-2515CEEE509C &> /dev/null
[10:41:10]: Overriding Status Bar
[10:41:10]: $ xcrun simctl status_bar BD1297CC-83D3-4335-A1A3-2515CEEE509C override --time 2007-01-09T09:41:00+10:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
[10:41:32]: Launch Simulator iPhone 8 Plus
[10:41:32]: $ xcrun instruments -w 362CFA12-7BCD-4B1C-992B-11CDFEB0DD3E &> /dev/null
[10:41:38]: Overriding Status Bar
[10:41:38]: $ xcrun simctl status_bar 362CFA12-7BCD-4B1C-992B-11CDFEB0DD3E override --time 2007-01-09T09:41:00+10:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
[10:42:04]: Launch Simulator iPhone SE (2nd generation)
[10:42:04]: $ xcrun instruments -w FDB0B9BE-038B-4E95-AEBE-A5BD8BB550DE &> /dev/null
[10:42:11]: Overriding Status Bar
[10:42:11]: $ xcrun simctl status_bar FDB0B9BE-038B-4E95-AEBE-A5BD8BB550DE override --time 2007-01-09T09:41:00+10:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
[10:42:25]: Launch Simulator iPad Pro (12.9-inch) (4th generation)
[10:42:25]: $ xcrun instruments -w 2E6AEBE6-B1FB-44B0-A326-DB9C85F3494D &> /dev/null
[10:42:31]: Overriding Status Bar
[10:42:31]: $ xcrun simctl status_bar 2E6AEBE6-B1FB-44B0-A326-DB9C85F3494D override --time 2007-01-09T09:41:00+10:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
[10:42:59]: Running snapshot on: iPhone 11 Pro Max, iPhone 8 Plus, iPhone SE (2nd generation), iPad Pro (12.9-inch) (4th generation)

Environment

🚫 fastlane environment 🚫 ### Stack | Key | Value | | --------------------------- | ------------------------------------------- | | OS | 10.15.5 | | Ruby | 2.2.4 | | Bundler? | false | | Git | git version 2.24.3 (Apple Git-128) | | Installation Source | ~/.fastlane/bin/bundle/bin/fastlane | | Host | Mac OS X 10.15.5 (19F101) | | Ruby Lib Dir | ~/.fastlane/bin/bundle/lib | | OpenSSL Version | OpenSSL 1.0.2g 1 Mar 2016 | | Is contained | false | | Is homebrew | true | | Is installed via Fabric.app | false | | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | | Xcode Version | 11.6 | ### System Locale | Variable | Value | | | -------- | ----------- | - | | LANG | en_US.UTF-8 | βœ… | | LC_ALL | en_US.UTF-8 | βœ… | | LANGUAGE | en_US.UTF-8 | βœ… | ### fastlane files:
`./fastlane/Fastfile` ```ruby # Customise this file, documentation can be found here: # https://github.com/KrauseFx/fastlane/tree/master/docs # All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md # can also be listed using the `fastlane actions` command # Change the syntax highlighting to Ruby # All lines starting with a # are ignored when running `fastlane` # By default, fastlane will send which actions are used # No personal data is shared, more information on https://github.com/fastlane/enhancer # Uncomment the following line to opt out # opt_out_usage # If you want to automatically update fastlane if a new version is available: # update_fastlane # This is the minimum version number required. # Update this, if you use features of a newer version platform :ios do before_all do ENV['DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS'] = '-t DAV' ENV['FASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT'] = '1' end ##################### UNIT TESTS ###################### desc "Test & Build for commit to master" lane :unittest do multi_scan( try_count: 3, fail_build: true, clean: true, devices: ["iPhone 11 Pro Max"], code_coverage: true, suppress_xcode_output: false, scheme: 'epcmobile-ios' ) end ##################### NATIVE UI TESTS ###################### desc "Native UI Tests" lane :uitest do # snapshot( # scheme: 'NativeUITests', # project: './epcmobile-ios.xcodeproj', # clean: true, # stop_after_first_error: true, # clear_previous_screenshots: true, # output_directory: './fastlane/test_output/screenshots', # languages: 'en-US' # ) test_run_block = lambda do |testrun_info| failed_test_count = testrun_info[:failed].size if failed_test_count > 0 UI.important('The run of tests would finish with failures due to fragile tests here.') try_attempt = testrun_info[:try_count] if try_attempt < 4 UI.header('Since we are using :multi_scan, we can re-run just those failing tests!') end end end result = multi_scan( scheme: 'NativeUITests', project: './epcmobile-ios.xcodeproj', clean: true, devices: ["iPhone 11 Pro Max"], fail_build: true, try_count: 4, testrun_completed_block: test_run_block ) unless result[:failed_testcount].zero? UI.message("There are #{result[:failed_testcount]} legitimate failing tests") end end ##################### SMOKE TESTS ###################### desc "Smoke Tests against EPC Web" lane :circlesmoketest do # snapshot( # scheme: 'WebSmokeTests', # project: './epcmobile-ios.xcodeproj', # clean: true, # stop_after_first_error: true, # clear_previous_screenshots: true, # output_directory: './fastlane/test_output/screenshots', # languages: 'en-US' # ) # MultiScan is having issues on circle. Leave this here for when they're resolved. test_run_block = lambda do |testrun_info| failed_test_count = testrun_info[:failed].size if failed_test_count > 0 UI.important('The run of tests would finish with failures due to fragile tests here.') try_attempt = testrun_info[:try_count] if try_attempt < 4 UI.header('Since we are using :multi_scan, we can re-run just those failing tests!') end end end result = multi_scan( scheme: 'WebSmokeTests', project: './epcmobile-ios.xcodeproj', clean: true, fail_build: true, try_count: 4, testrun_completed_block: test_run_block ) unless result[:failed_testcount].zero? UI.message("There are #{result[:failed_testcount]} legitimate failing tests") end end #################### SET VERSION ##################### desc "Set version number" lane :setversion do major_version = 1 d = DateTime.now year_number = d.strftime("%y").to_i week_number = d.strftime("%U").to_i weekday_number = d.strftime("%w").to_i if weekday_number > 1 week_number = week_number + 1 end version_offset = ENV["APP_VERSION_OFFSET"].to_i week_number = week_number + version_offset new_version = "#{major_version}.#{year_number}.#{week_number}" ENV["APP_VERSION"] = new_version increment_version_number( version_number: new_version # Set a specific version number ) build_number = ENV["BITRISE_BUILD_NUMBER"] increment_build_number( build_number: build_number ) ENV["BUILD_NUMBER"] = get_build_number end #################### TEST FLIGHT RELEASE ##################### desc "Distribute Application to Test Flight" lane :push do # Run setversion before running this lane version_number = get_version_number( xcodeproj: "epcmobile-ios.xcodeproj", target: "epcmobile-ios" ) build_number = get_build_number(xcodeproj: "epcmobile-ios.xcodeproj") change_comments = last_git_commit[:message] # match(type: "appstore", app_identifier: "com.expedia.epc") ENV["APP_VERSION"] = version_number ENV["BUILD_NUMBER"] = build_number gym( configuration: "Release", scheme: "epcmobile-ios", silent: false, clean: true, include_bitcode: true, export_method: "app-store" ) pilot( username: "hehardy@expedia.com", beta_app_description: "Expedia Group Partner Central app for iOS", beta_app_feedback_email: "epcmobile@expedia.com", changelog: "Production Build", wait_processing_interval: 45, groups: ["Prod Testers"], distribute_external: true, demo_account_required: true, verbose: true, reject_build_waiting_for_review: true, beta_app_review_info: { contact_email: "serogers@expedia.com", contact_first_name: "Sean", contact_last_name: "Rogers", contact_phone: "+61 433 427 401", demo_account_name: "appledemo", demo_account_password: "applepassword6" } ) # Ideally this gets sent to Slack but we can't add our own WebHooks puts "" puts "" puts "✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨" puts "" puts "Submitted version #{version_number} (#{build_number}) to testers" puts "" puts "✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨" puts "" puts "" puts "" end ################## UPLOAD dSYMs TO CRASHLYTICS ################### lane :uploadsymbols do version_number = ENV["APP_VERSION"] build_number = ENV["BUILD_NUMBER"] download_dsyms( version: version_number, build_number: build_number ) upload_symbols_to_crashlytics( binary_path: "./Firebase/upload-symbols", gsp_path: "./epcmobile-ios/GoogleService-Info.plist" ) end #################### EXPERIMENTAL TEST FLIGHT RELEASE ##################### desc "Distribute Application to Test Flight with experimental features" lane :circlebeta do # Run setversion before running this lane version_number = get_version_number( xcodeproj: "epcmobile-ios.xcodeproj", target: "epcmobile-ios" ) build_number = get_build_number(xcodeproj: "epcmobile-ios.xcodeproj") change_comments = last_git_commit[:message] ENV["APP_VERSION"] = version_number ENV["BUILD_NUMBER"] = build_number version = "#{version_number}-#{build_number}" add_badge(shield: "#{version}-blue", no_badge: false) # match(type: "appstore", app_identifier: "com.expedia.epc") gym( configuration: "Beta", scheme: "epcmobile-ios", silent: true, clean: true, output_name: "epcmobile-ios-#{version}-beta.ipa", include_bitcode: true, export_method: "app-store" ) pilot( username: "hehardy@expedia.com", skip_submission: false, changelog: "Experimental Build", beta_app_description: "Expedia Group Partner Central app for iOS", beta_app_feedback_email: "epcmobile@expedia.com", wait_processing_interval: 60, groups: ["Experimental Testers"], distribute_external: true, demo_account_required: true, reject_build_waiting_for_review: true ) end #################### APPETIZE ##################### desc "Send Test Flight Production Build to Appetize" lane :circleappetizeupload do # Run setversion before running this lane version_number = get_version_number( xcodeproj: "epcmobile-ios.xcodeproj", target: "epcmobile-ios" ) build_number = get_build_number(xcodeproj: "epcmobile-ios.xcodeproj") ENV["APP_VERSION"] = version_number ENV["BUILD_NUMBER"] = build_number version = "#{version_number}-#{build_number}" match(type: "appstore", app_identifier: "com.expedia.epc") agent_name = ENV["AGENT_NAME"] gym( configuration: "Beta", scheme: "epcmobile-ios", silent: true, clean: true, include_bitcode: true, output_directory: "./build", output_name: "epcmobile-ios-#{version}-beta.ipa", xcargs: "OTHER_CODE_SIGN_FLAGS='--keychain /Users/#{agent_name}/iosbuild.keychain'", export_method: "app-store" ) appetize( path: "./build/epcmobile-ios-#{version}-beta.ipa", api_token: "tok_je5nh8w1ftdad4fyzy5nhrxg14" # get it from https://appetize.io/docs#request-api-token ) end #################### APP STORE ##################### desc "Promote a build from TestFlight to the App Store" lane :promote do # Run setversion before running this lane version_number = get_version_number( xcodeproj: "epcmobile-ios.xcodeproj", target: "epcmobile-ios" ) build_number = get_build_number(xcodeproj: "epcmobile-ios.xcodeproj") ENV["APP_VERSION"] = version_number ENV["BUILD_NUMBER"] = build_number deliver( username: "hehardy@expedia.com", app: "987675995", skip_screenshots: true, skip_metadata: false, skip_binary_upload: false, ignore_language_directory_validation: true, # Below 'force: true' will prevent the HTML report from being generated prior to actual upload. force: true, submit_for_review: true, automatic_release: false, app_version: version_number, build_number: build_number, phased_release: true, app_identifier: "com.expedia.epc", metadata_path: "fastlane/metadata/", primary_category: "MZGenre.Business", submission_information: { add_id_info_uses_idfa: false } ) end #################### BS PROD UPLOAD ##################### desc "Send the prod build to BrowserStack" lane :circlebsprod do match(type: "appstore", app_identifier: "com.expedia.epc") gym( toolchain: :swift_4, configuration: "Release", scheme: "epcmobile-ios", silent: false, include_bitcode: true, clean: true, export_method: "app-store" ) upload_to_browserstack_app_live( browserstack_username: ENV["BROWSERSTACK_USERNAME"], browserstack_access_key: ENV["BROWSERSTACK_ACCESS_KEY"], ) end #################### Fastlane Snapshot ##################### desc "Take screenshots" lane :screenshot do snapshot end end # More information about multiple platforms in fastlane: https://github.com/KrauseFx/fastlane/blob/master/docs/Platforms.md # All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md ```
`./fastlane/Appfile` ```ruby app_identifier("com.expedia.epc") # The bundle identifier of your app apple_id("hehardy@expedia.com") # Your Apple email address itc_team_id("247920") # App Store Connect Team ID team_id("PKCU927V2F") # Developer Portal Team ID # For more information about the Appfile, see: # https://docs.fastlane.tools/advanced/#appfile ```
### fastlane gems | Gem | Version | Update-Status | | -------- | ------- | ------------------ | | fastlane | 2.128.0 | 🚫 Update available | ### Loaded fastlane plugins: | Plugin | Version | Update-Status | | --------------------------- | ------- | ------------------ | | fastlane-plugin-test_center | 3.8.16 | 🚫 Update available |
Loaded gems | Gem | Version | | --------------------------- | ------------ | | slack-notifier | 2.3.2 | | atomos | 0.1.3 | | CFPropertyList | 2.3.5 | | claide | 1.0.2 | | colored2 | 3.1.2 | | nanaimo | 0.2.6 | | xcodeproj | 1.16.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 2.0.0 | | unicode-display_width | 1.1.3 | | terminal-table | 1.7.3 | | plist | 3.2.0 | | public_suffix | 2.0.5 | | addressable | 2.5.1 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | tty-screen | 0.7.0 | | tty-cursor | 0.7.0 | | tty-spinner | 0.9.1 | | babosa | 1.0.2 | | colored | 1.2 | | highline | 1.7.8 | | commander-fastlane | 4.4.6 | | excon | 0.75.0 | | faraday | 0.12.1 | | unf_ext | 0.0.7.4 | | unf | 0.1.4 | | domain_name | 0.5.20170404 | | http-cookie | 1.0.3 | | faraday-cookie_jar | 0.0.6 | | fastimage | 2.1.0 | | gh_inspector | 1.1.3 | | json | 1.8.1 | | mini_magick | 4.9.5 | | multi_xml | 0.6.0 | | rubyzip | 1.2.3 | | security | 0.1.3 | | xcpretty-travis-formatter | 0.0.4 | | dotenv | 2.2.0 | | bundler | 1.14.6 | | faraday_middleware | 0.11.0.1 | | naturally | 2.2.0 | | simctl | 1.6.5 | | jwt | 2.1.0 | | uber | 0.0.15 | | declarative | 0.0.10 | | declarative-option | 0.1.0 | | representable | 3.0.4 | | retriable | 2.1.0 | | mime-types-data | 3.2016.0521 | | mime-types | 3.1 | | multi_json | 1.12.1 | | signet | 0.11.0 | | memoist | 0.16.0 | | os | 0.9.6 | | googleauth | 0.6.7 | | httpclient | 2.8.3 | | google-api-client | 0.23.9 | | google-cloud-env | 1.2.0 | | google-cloud-core | 1.3.0 | | digest-crc | 0.4.1 | | google-cloud-storage | 1.16.0 | | emoji_regex | 1.0.1 | | libxml-ruby | 3.0.0 | | nokogiri | 1.5.6 | | psych | 2.0.8 | | xctest_list | 1.1.8 | | colorize | 0.8.1 | | fastlane-plugin-test_center | 3.8.16 |
*generated on:* **2020-08-26**
seanrogs commented 3 years ago

This still isn't working for me. Can anyone else confirm?

lucaFaverio commented 3 years ago

They are not working for me either. The headless was working on Xcode 11.3 but not on the latest Xcode 11.7. Unfortunately, I can't say which version broke them since I've skipped some updates

seanrogs commented 3 years ago

I've just updated to the Xcode 12 GM, and override_status_bar is now working. headless still doesn't work for me though.

fastlane-bot commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself :muscle:

kabouzeid commented 3 years ago

Doesn’t work for me

rogerluan commented 3 years ago

Did anyone verify that this works normally with the simulator's command line tool alone (outside of fastlane)? Is this issue isolated to fastlane, or is this still unknown?

fastlane-bot commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself :muscle:

fastlane-bot commented 3 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

lucasilverentand commented 3 years ago

This also still doesn't work for me.

MartinMetselaar commented 3 years ago

headless is at the moment also not working for me but override_status_bar is. Using fastlane version 2.172.0 icw Xcode version 12.3 (12C33)

rogerluan commented 3 years ago

Did anyone verify that this works normally with the simulator's command line tool alone (outside of fastlane)? Is this issue isolated to fastlane, or is this still unknown?

@seanrogs @lucasilverentand @MartinMetselaar do you know? πŸ™

fastlane-bot commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself :muscle:

This issue will be auto-closed if there is no reply within 1 month.

fastlane-bot commented 3 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1: