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

iOS Simulator 16.1+ donnot support status bar time customization #21255

Open
4 tasks done
dvkch opened this issue May 6, 2023 · 2 comments · May be fixed by #21954
Open
4 tasks done

iOS Simulator 16.1+ donnot support status bar time customization #21255

dvkch opened this issue May 6, 2023 · 2 comments · May be fixed by #21954

Comments

@dvkch
Copy link

dvkch commented May 6, 2023

New Issue Checklist

Issue Description

Since Xcode 13 and the iOS 16.1 simulator, up until the current 16.4, the status bar override for time doesn't work. Although this could get resolved soon, we still don't have any specific information from Apple on that specific subject.

Saagar Jha did a beautiful summary of the issue and suggests a workaround as well : https://mastodon.social/@[email protected]/110247648243275098

Workaround

Some people have been using the iOS 16.0 simulator to fix this issue. While this is entirely possible, it requires recreating your simulators, making sure your app runs on 16.0 properly and possibly not showcasing more recent features.

I have been able to use Saagar's workaround using the following changes :

  • in snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb, method override_status_bar

      # Replace
      Helper.backticks("xcrun simctl bootstatus #{device_udid} -b &> /dev/null")
    
      # With
      Helper.backticks("xcrun simctl boot #{device_udid} &> /dev/null")
      Helper.backticks("xcrun simctl bootstatus #{device_udid} -b &> /dev/null")
    
  • in your fastlane/Snapfile :

    • reinstall_app=false
    • 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"(note the 9:41 time instead of an ISO time which didn't seem to work)
    • don't add any medias
  • launch the snapshots using SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION=16.0 fastlane snapshot

Some parts can be done on the user side, but not the modification in override_status_bar. Those should be relatively harmless, donnot in themselves include any workaround, but allow users to prepare for a workaround while Apple fixes this.

Limitations

Because this requires the simulator to be launched using xcrun simctl boot instead of any other way, if the simulator is launched before hand, either while uninstalling the app, or adding medias, the workaround is moot.

Other tries

I tried setting up a global env var on my system and let everything run as is, but it didn't seem to work. Further investigation would be required.

launchctl setenv SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION 16.0
launchctl setenv SIMULATOR_RUNTIME_VERSION 16.0
Command executed

fastlane snapshot

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 13.3.1
Ruby 3.0.3
Bundler? false
Git git version 2.39.2 (Apple Git-143)
Installation Source ~/.rbenv/versions/3.0.3/bin/fastlane
Host macOS 13.3.1 ((a))
Ruby Lib Dir ~/.rbenv/versions/3.0.3/lib
OpenSSL Version OpenSSL 1.1.1q 5 Jul 2022
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 14.3
Swift Version 5.8

System Locale

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

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.5.0
atomos 0.1.3
rexml 3.2.5
CFPropertyList 3.0.5
claide 1.1.0
colored2 3.1.2
nanaimo 0.3.0
xcodeproj 1.22.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
plist 3.6.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-cookie_jar 0.0.7
fastimage 2.2.6
gh_inspector 1.1.3
naturally 2.2.1
rubyzip 2.3.2
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.8.1
simctl 1.6.8
emoji_regex 3.2.3
set 1.0.1
public_suffix 5.0.1
addressable 2.8.1
excon 0.97.2
ruby2_keywords 0.0.5
faraday-retry 1.0.3
faraday-rack 1.0.0
faraday-patron 1.0.0
faraday-net_http_persistent 1.2.0
faraday-net_http 1.0.1
faraday-multipart 1.0.4
faraday-httpclient 1.0.1
faraday-excon 1.1.0
faraday-em_synchrony 1.0.0
faraday-em_http 1.0.0
faraday 1.10.3
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.5
faraday_middleware 1.2.0
json 2.6.3
mini_magick 4.12.0
bundler 2.2.32
jwt 2.7.0
webrick 1.7.0
httpclient 2.8.3
multi_json 1.15.0
signet 0.17.0
os 1.1.4
memoist 0.16.2
googleauth 1.3.0
mini_mime 1.1.2
retriable 3.1.2
trailblazer-option 0.1.2
declarative 0.0.20
uber 0.1.0
representable 3.2.0
google-apis-core 0.9.5
google-apis-playcustomapp_v1 0.12.0
google-apis-androidpublisher_v3 0.32.0
rake 13.0.6
digest-crc 0.6.4
google-apis-storage_v1 0.19.0
google-apis-iamcredentials_v1 0.16.0
google-cloud-errors 1.3.0
google-cloud-env 1.6.0
google-cloud-core 1.6.0
google-cloud-storage 1.44.0
aws-eventstream 1.2.0
aws-sigv4 1.5.2
aws-partitions 1.697.0
jmespath 1.6.2
aws-sdk-core 3.169.0
aws-sdk-kms 1.62.0
aws-sdk-s3 1.118.0
forwardable 1.3.2
logger 1.4.3
pathname 0.1.0
shellwords 0.1.0
cgi 0.2.1
date 3.3.3
timeout 0.3.1
stringio 3.0.1
securerandom 0.1.0
uri 0.10.1
ipaddr 1.2.2
openssl 2.2.1
digest 3.0.0
io-nonblock 0.1.0
io-wait 0.2.0
zlib 2.0.0
resolv 0.2.1
time 0.1.0
open-uri 0.1.0
mutex_m 0.1.1
net-protocol 0.2.1
rack-test 2.0.2
rack 2.2.6.2
fileutils 1.5.0
tempfile 0.1.1
delegate 0.2.0
tmpdir 0.1.2
ostruct 0.3.1
english 0.7.1
erb 2.2.0
strscan 3.0.1
abbrev 0.1.0
io-console 0.6.0
base64 0.1.0
singleton 0.1.1
net-http 0.1.1
open3 0.1.1
nkf 0.1.0
nokogiri 1.14.0
racc 1.6.2
prettyprint 0.1.1
pp 0.2.1
find 0.1.0
yaml 0.1.1
psych 3.3.2

generated on: 2023-05-06

@kerrikha2
Copy link

kerrikha2 commented Aug 22, 2023

As i know the status bar time override issue in Xcode 13 and iOS 16.1 to 16.4 is unresolved, with no specific information available from Apple yet. PaybyPlateMa Pay Online

@jeffphp
Copy link

jeffphp commented Apr 4, 2024

On XCode 15, simulator on iOS 17.4, the status bar time override is indeed silently failing because of "&> /dev/null" at the end of the command line.

If you execute the command line without throwing away errors (by removing "&> /dev/null"), you'll get the following error :

xcrun simctl status_bar B3F29207-F9CF-424B-81BE-E931D4B87E33 override --time 2007-01-09T09:41:00+01:00 --dxcrun simctl status_bar B3F29207-F9CF-424B-81BE-E931D4B87E33 override --time 2007-01-09T09:41:00+01:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Simulator device failed to complete the requested operation.
Invalid argument
Underlying error (domain=NSPOSIXErrorDomain, code=22):
	Invalid, non-ISO date/time string
	Invalid argument

I ended up using override_status_bar_arguments as a workaround, with a proper ISO date (note the .000 missing in the original date/time string)

override_status_bar_arguments "--time 2007-01-09T09:41:00.000+01:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100"

@yeahphil yeahphil linked a pull request Apr 8, 2024 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

3 participants