Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to change the date/time as seen on the iOS simulator (other than changing Mac settings)?

I need to do some testing that involves moving the "phone" backwards and forwards through several days. I'd like to do this on the simulator. Is there any available hack that allows the date as seen on the simulator to be changed, without having to change the Mac date?

like image 438
Hot Licks Avatar asked Sep 27 '12 19:09

Hot Licks


People also ask

How do I change iOS simulator?

Sometimes the iOS simulator doesn't respond to the open command. If it seems stuck on this prompt, you can open the iOS simulator manually ( open -a Simulator ) and then in the macOS toolbar, choose Hardware → Device, and select an iOS version and device that you'd like to open.

How do I change simulator location in iOS?

in iOS Simulator menu, go to Debug -> Location -> Custom Location. There you can set the latitude and longitude and test the app accordingly.


1 Answers

Looks like it's pretty tough... How about using xcodebuild to automate building and running the app from a script and using systemsetup -setdate <mm:dd.yy> to change date in between different runs? Then you wouldn't need to change anything in code.

like image 80
JOM Avatar answered Oct 11 '22 13:10

JOM