问题描述
我需要进行一些测试,包括将手机向前和向后移动几天。我想在模拟器上这样做。是否有任何可用的hack允许更改模拟器上显示的日期,而无需更改Mac日期?
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?
推荐答案
看起来很难......如何使用 xcodebuild
从脚本中自动构建和运行应用程序并使用 systemsetup -setdate< mm :dd.yy>
更改不同运行之间的日期?然后你不需要在代码中改变任何东西。
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.
这篇关于是否有任何方法可以更改iOS模拟器上显示的日期/时间(除了更改Mac设置)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!