Is there a way to change the date in the simulator to simulate for example Dec.02.2018, Feb.03.2018? I need to check if the code I have will react correctly given the date.
Xcode 11 brought the ability to change the date (and time) using the simctl command line tool:
xcrun simctl status_bar booted override --time "2007-01-09T09:41:00-08:00"
The date and time is in the ISO 8601 format. Make sure to adjust the time zone if you want the clock to show the given time ("-08:00" is for PST/California, "+01:00" for Western Europe, ...).
Change your mac system date and time. It would get reflected in simulator. Go to 'System Preferneces' -> Date and Time.
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