With Apple's new command line tool xcrun simctl status_bar
you can now set up the status bar in the simulator as you like without any need for 3rd party programs, however, I can't get it to change the date for bigger devices like the iPad Pro (12.9-inch).
In the help menu it states that if you enter a valid ISO date then it adapts that on devices where this is relevant: xcrun simctl status_bar --help
So I enter a valid ISO date 2016-09-18T17:34:02.666Z
, but the status bar will afterwards look like this:
date not correctly changed
Go to 'TimeZone' tap instead of 'Date&Time' tap. Uncheck the 'Set time zone automatically using current location' box and slide the vertical rectangle bar (with blue dot on it) to simulate your system time.
xcrun simctl is command utils to control iOS simulator, just like adb for Android. Sometimes, in CI server script, We need these simulator-integration command to interact with simulators and run test cases. If we run xcrun simctl help , here are some subcommands.
Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen. Plug your iPhone into your computer. You can select your device from the top of the list. Unlock your device and (⌘R) run the application.
I'm afraid the milliseconds and the Z
timezone do not work, you should use this format:
xcrun simctl status_bar booted override --time "2007-01-09T09:41:00+01:00"
The documentation isn't very precise for this particular feature.
Try xcrun simctl status_bar <device> override --time "10:22"
and it'll work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With