Comments (1)
Sorry, this is a duplicate of #21464
However, I figured it out and have a work-around.
Analysis
When using override_status_bar true
, the console log shows the automatically generated arguments:
$ xcrun simctl status_bar 463A8557-2F51-432A-A880-7EA671F20805 override --time 2007-01-09T09:41:00+01:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
When adding override_status_bar_arguments "--wifiBars 3"
, the console log shows:
$ xcrun simctl status_bar 4CD9AAB8-AAF8-461D-B077-7815623A2436 override --wifiBars 3 &> /dev/null
The reason why the latter worked, was because my Simulator was already started with Simulator Status Magic enabled.
Using a brand new Simulator, doesn't show the "9:41", but the current time. This clarifies 1 observation.
So the root cause is in the ISO time stamp for parameter --time
: 2007-01-09T09:41:00+01:00
.
The time zone +01:00
is wrong, since I'm at CEST which has Daylight Saving enabled, so it's currently +02:00
.
Work-around
When manually changing the timezone in the arguments in the Snapfile the correct time is displayed in the screenshots:
override_status_bar_arguments "--time 2007-01-09T09:41:00+02:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100"
However, when running Snapshot in winter, it will display the wrong time. Hence made the time zone offset dynamically in the Snapfile with some Ruby code:
require 'active_support/all' # For `Time.now.formatted_offset()`
devices([
"iPhone 12 Pro",
])
# Get current timezone offset:
timezone_offset = Time.now.formatted_offset(true)
puts("timezone_offset = #{timezone_offset}") # Optional, to write to Console output
# Override status bar and override arguments incl. timezone offset, as by default it goes wrong with Daylight Saving Time (e.g. shows "10:41" instead of "9:41", see: https://github.com/fastlane/fastlane/issues/22026 )
override_status_bar true
override_status_bar_arguments "--time 2007-01-09T09:41:00#{timezone_offset} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100" # For a list of commands, type the following in Terminal: xcrun simctl status_bar --help
Solution
To resolve this in code, the Time
object should get the proper time zone information, see:
fastlane/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb
Lines 136 to 141 in 806c80c
from fastlane.
Related Issues (20)
- `fastlane supply init` : `undefined method `name' for nil` HOT 1
- [!] Too many open files - fork failed (FastlaneCore::FastlanePtyError) HOT 2
- Deliverfile not recognizing apple_id (taken from the docs)
- build_app not working when called from inside a script using exec HOT 1
- [Fastlane.Swift] Unusable for CI builds HOT 1
- Fastlane building visionOS app despite everything being set to iOS HOT 1
- Fastlane Errors when uploading to different Play Store tracks HOT 1
- `export_method: "ad-hoc"` is deprecated at Xcode 15.4. Use "release-testing" instead. HOT 1
- Deliver does not support 13 inch ipad screen resolution: 2064x2752 HOT 2
- [!] It took longer than expected to process your IPA, please try again. (FastlaneCore::Interface::FastlaneCrash) HOT 19
- [Bug] Wont distribute to internal groups
- It took longer than expected to process your IPA, please try again. HOT 19
- iOS: The specified resource does not exist - There is no resource of type 'AppsV1' with id '...' when passing changelog
- set_changelog results in localization error HOT 1
- Flutter + Snapshot ? HOT 1
- fastfile.swift issue
- fastfile.swift issue // Cannot convert value of type 'String' to expected argument type 'OptionalConfigValue<String?>' HOT 1
- android - [!] Invalid request (Google::Apis::ClientError) HOT 4
- iOS - base64 encoded key parsing error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastlane.