Can't change time in Xcode Simulator

Does anyone have the same problem? Tried on several devices, didn't help. Changing battery state does not work as well. I guess there should be another way to modify status bar on iOS 16. It worked on iOS 15 though.

xcrun simctl status_bar "iPhone 14 Plus" override --time "9:41"

Post not yet marked as solved Up vote post of nnnkbrrr Down vote post of nnnkbrrr
8.2k views

Replies

Yes, I got the same problem. Did you find a solution?

Add a Comment

Hi,

Yeah, I had the same issue this morning.

As a work-around I installed iOS15.5 Simulator by going to Xcode > Preferences > Platforms.

I then ran the app, using one of those 15.5 simulators and was able to change the status bar :

xcrun simctl status_bar Booted override --time 9:41 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100

I hope this helps,
Matt
Peak Ridge Ltd

This appears to be an issue with the iOS 16.1 simulator. The status bar customization works fine on iOS 16.0 and below.

I've reported the issue to Apple (FB11831131).

  • This issue is still existing as of Xcode 15.0 beta 8 (15A5229m) with iOS 17. I’ve filed a duplicated feedback: FB13136801

Add a Comment

I have same issue while using fastlane snapshot. Based on Matt_PeakRidge's answer, here is my workaround. As my app only works with iOS 16 I couldn't use iOS 15.5 simulator. But iOS 16.0 worked so:

  1. Install iOS 16.0 simulator from Xcode
  2. Set deployment target to iOS 16.0 in Test scheme.
  3. In Snapfile file add ios_version("16.0").

They still haven’t fixed this with Xcode 14.3 beta. Weird.

It would be really nice if this can get fixed.

Still not working using Xcode 14.3 and simulators on iOS 16.0+

Yeah seeing the same issue on iOS 16.5 and Xcode 14.3.1.

This does still not work in Xcode 15 and the iOS 17 simulator, unfortunately.

As stated in this answer on StackOverflow there is currently a bug in Xcode's Simulator.

You can circumvent the issue by starting the Simulator with the SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION variable set to 16.4.

# Set $DEVICE_NAME to the device's name to be started, e.g. "iPhone 15 Pro"
SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION=16.4 xcrun simctl boot $DEVICE_NAME

Works with Xcode 15 (15A240d) and iOS 17.

  • Still the same issue with Xcode 15.0.1 (15A507) and iOS 17.0.1. Tried with

    SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION=16.4 xcrun simctl boot $DEVICE_NAME

    Is there any known workaround or fix yet?

Add a Comment

I had a same probrem on iPhone 14 Plus simulator with iOS16.

Command below did not work,

xcrun simctl status_bar "iPhone 14 Plus" override --time "9:41"

But next command worked.

xcrun simctl status_bar XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX override --time "9:41"

Xs indicate your simulator identifier, which you can refer on your simulators list on XCode.

I'm also having problems on Xcode 15 & iOS 17. None of the above methods are working ...

I think this is a bug in xcrun 67 (you can check it by running xcrun 68), it seems to fixed with xcrun 68.

At the moment of writing xcrun 68 is not available from App Store yet, you can:

  1. Get it from developer website by downloading Xcode 15.3 beta.
  2. Once unzipped and the beta is in the Application folder, run the following command so xcode-select points to the Developer beta
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
  1. Run "xcrun --version" to check the version number of xcrun, it should say "xcrun version 68." now
  2. Now you can clear the status_bar of the running simulator by running:
xcrun simctl status_bar Booted clear
  1. Set the status_bar by running something like below:
xcrun simctl status_bar Booted override --time "9:41" --cellularBars 4
  • Can confirm. This is fixed. Tested with Xcode 15.3 RC (xcrun version 68). It even shows an error message if the string couldn't be parsed.

  • Can confirm too. Works with Xcode 15.3 RC

  • Fixed in 15.3

Add a Comment