Set date and time in iOS Simulator

I am trying to fix a bug in my iOS app that is dependent upon date and time. Is there any way to set the actual time on the iOS Simulator to a specific date and time? I know that you can set one for the status bar, but that doesn't affect the actual date and time that is reported by the system to apps.

Answered by DTS Engineer in 807916022
Is there any way to set the actual time on the iOS Simulator to a specific date and time?

No.

Well, the simulator picks up its time from your Mac, so you could change the time on your Mac, but that’s rather heavy handed.

Is there a reason you need to do this in the simulator? If you did this test on a real device, you could change its time in Settings.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there any way to set the actual time on the iOS Simulator to a specific date and time?

No.

Well, the simulator picks up its time from your Mac, so you could change the time on your Mac, but that’s rather heavy handed.

Is there a reason you need to do this in the simulator? If you did this test on a real device, you could change its time in Settings.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Why does Apple keep removing settings like these? Is there any reason for this? In my case, I need to set the date as well as the time, because I create screenshots on different days, and they end up with different dates, which is not consistent. If I change the date on my Mac and create screenshots on different days, when I later retrieve them from Finder, they get mixed in with other files I created on those days. It's really annoying.

In my case, I need to set the date as well as the time, because I create screenshots on different days

The simulator has a specific affordance for that case. To learn more, read the help you get from:

% xcrun simctl status_bar

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Set date and time in iOS Simulator
 
 
Q