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

override_status_bar sets the time to 10:41 instead of 9:41 #21464

Open
4 tasks done
ppamorim opened this issue Aug 15, 2023 · 2 comments
Open
4 tasks done

override_status_bar sets the time to 10:41 instead of 9:41 #21464

ppamorim opened this issue Aug 15, 2023 · 2 comments

Comments

@ppamorim
Copy link

New Issue Checklist

Issue Description

When using snapshot, fastlane is setting the time to 10:41 instead of 9:41. Would this be caused by my timezone? What is going on here?

Command executed
Complete output when running fastlane, including the stack trace and command used
 bundle exec fastlane screenshot
  

Environment

  
✅ fastlane environment ✅

Stack

Key Value
OS 13.4.1
Ruby 3.0.2
Bundler? true
Git git version 2.23.0
Installation Source ~/.gem/bin/fastlane
Host macOS 13.4.1 (22F82)
Ruby Lib Dir /usr/local/Cellar/ruby/3.0.2/lib
OpenSSL Version OpenSSL 1.1.1k 25 Mar 2021
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 14.3.1
Swift Version 5.8.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# More documentation about how to customize your build
# can be found here:
# https://docs.fastlane.tools

# https://github.com/fastlane/fastlane/issues/11957
# https://github.com/fastlane/fastlane/issues/11958

username = "[email protected]"
fastlane_version "2.212.1"
REQUIRED_XCODE_VERSION = "14.2"
default_platform :ios

REAL_APP_NAME_ARRAY = Array["XXX xxx"]
POSSIBLE_SCHEME_ARRAY = Array["XXX"]
POSSIBLE_SCHEME_NICKNAME_ARRAY = Array["xxx"]
POSSIBLE_IDENTIFIER_ARRAY = Array["io.xxx.xxx"]
POSSIBLE_PLIST_ARRAY = Array["Info"]
SCREENSHOTS_ARRAY = Array["XXXScreenshots"]
UI_TESTS_ARRAY = Array["XXXUITests"]

CONFIGURATION_DEBUG_ARRAY = Array["Debug"]
CONFIGURATION_RELEASE_ARRAY = Array["Release"]

$submission_info = {
  export_compliance_compliance_required: true,
  export_compliance_encryption_updated: false,
  export_compliance_uses_encryption: true,
  export_compliance_is_exempt: true,
  add_id_info_uses_idfa: false
}

before_all do
  # ensure_git_status_clean
end

desc "Take screenshot of all schemes"
lane :screenshot do

  ENV["SCREENSHOT_SCHEME"] = SCREENSHOTS_ARRAY[0]
  ENV["APP_IDENTIFIER"] = POSSIBLE_IDENTIFIER_ARRAY[0]
  ENV["SCHEME"] = POSSIBLE_SCHEME_ARRAY[0]
  ENV["SCHEME_NICKNAME"] = POSSIBLE_SCHEME_NICKNAME_ARRAY[0]
  ENV["SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT"] = "300"

  def take_snapshot(dark_mode)
    ENV["DARK_MODE_NAME"] = dark_mode ? "dark" : "light"
    snapshot(
      project: "./XXX.xcodeproj",
      scheme: ENV["SCREENSHOT_SCHEME"],
      derived_data_path: "/Users/ppamorim/Library/Developer/Xcode",
      languages: ["en-GB", "pt-BR"],
      dark_mode: dark_mode,
      output_simulator_logs: false,
      skip_open_summary: true,
      override_status_bar: true,
      clear_previous_screenshots: false,
      test_without_building: false,
      reinstall_app: true,
      erase_simulator: true,
      concurrent_simulators: true,
      stop_after_first_error: true,
      number_of_retries: 3
    )
  end
  take_snapshot(true) # Dark mode
  take_snapshot(false) # Light mode
  
  # frame
end
`./fastlane/Appfile`
# The Appfile can be used to specify information that's used across all fastlane
# tools, like your username or the app's bundle identifier.
#
# For more details, check out the documentation at:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

# app_identifier "com.your.app" # the bundle identifier of your app
### REDACTED ###
`./fastlane/Snapfile`
# Uncomment the lines below you want to change by removing the # in the beginning

# A list of devices you want to take the screenshots from
devices([
  "iPhone 8 Plus",
  "iPhone 11",
  "iPad Pro (12.9-inch) (2nd generation)",
  "iPad Pro (12.9-inch) (3rd generation)"
])

ios_version("16.0")

# languages([
#   ["en-GB", "pt-BR"]
# ])

# The name of the scheme which contains the UI Tests
scheme(ENV["SCREENSHOT_SCHEME"])

override_status_bar(true)
concurrent_simulators(true)
headless(false)

identifier = ENV["APP_IDENTIFIER"]
if identifier != nil
  app_identifier(identifier)
end

# Where should the resulting screenshots be stored?
output_directory("./fastlane/screenshots/#{ENV["SCHEME_NICKNAME"]}/#{ENV["DARK_MODE_NAME"]}")

# For more information about all available options run
# fastlane action snapshot

fastlane gems

Gem Version Update-Status
fastlane 2.214.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-appicon 0.16.0 ✅ Up-To-Date
fastlane-plugin-versioning 0.5.2 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.6.3
bundler 2.2.22
tsort 0.1.1
uri 0.12.1
pathname 0.2.1
rake 13.0.6
rexml 3.2.6
CFPropertyList 3.0.6
public_suffix 5.0.3
addressable 2.8.5
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.804.0
aws-sigv4 1.6.0
jmespath 1.6.2
aws-sdk-core 3.180.3
aws-sdk-kms 1.71.0
aws-sdk-s3 1.132.1
babosa 1.0.4
claide 1.1.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.5
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.100.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.3.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.3
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.7
gh_inspector 1.1.3
jwt 2.7.1
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.17.0
googleauth 1.7.0
httpclient 2.8.3
mini_mime 1.1.5
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.8.1
google-apis-core 0.11.1
google-apis-androidpublisher_v3 0.48.0
google-apis-playcustomapp_v1 0.13.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.19.0
google-cloud-env 1.6.0
google-cloud-errors 1.3.1
google-cloud-core 1.6.0
google-cloud-storage 1.44.0
json 2.6.3
mini_magick 4.12.0
naturally 2.2.1
optparse 0.1.1
plist 3.7.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.10
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.22.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
fastlane-plugin-appicon 0.16.0
fastlane-plugin-versioning 0.5.2

generated on: 2023-08-15

@ppamorim
Copy link
Author

ppamorim commented Aug 15, 2023

I followed the report from #21255 and added this line to the Snapfile:

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

It appears to sort the issue, still testing it.

@funnel20
Copy link
Contributor

@ppamorim I discovered that I created a duplicate issue #22026

I added some analysis, and also a work-around to use a date object with dynamic timezone information, so it will work both with and without Daylight Saving Time.

The date object (compared to your time string) can be convenient for iPad, which shows the date as well in the Status Bar (January 9th by Snapshot default)

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

No branches or pull requests

2 participants