Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the date with Apples's `xcrun simctl status_bar`

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

like image 245
Christoph Man Avatar asked Oct 24 '19 14:10

Christoph Man


People also ask

How do you change time on iPhone simulator?

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.

What is Xcrun Simctl?

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.

How do I connect my iPhone to simulator?

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.


2 Answers

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"
like image 179
Zaphod Avatar answered Oct 11 '22 20:10

Zaphod


The documentation isn't very precise for this particular feature.

Try xcrun simctl status_bar <device> override --time "10:22" and it'll work.

like image 29
Sven Driemecker Avatar answered Oct 11 '22 20:10

Sven Driemecker