简体   繁体   English

有没有一种方法可以设置iOS模拟器默认值,以便在重置设备时不必重置键盘和Facebook?

[英]Is There a Way to Setup iOS Simulator Defaults so I Don't Have to Reset Keyboard & Facebook When I Reset the Device?

I use Dvorak keyboard and have a Facebook account that I login to on my iOS Simulator. 我使用Dvorak键盘,并在iOS模拟器上登录了一个Facebook帐户。

I can set these things up to work properly through the iOS Simulator, but whenever I reset the iOS Simulator, all these settings get erased (as expected). 我可以通过iOS Simulator设置这些东西以使其正常工作,但是每当我重置iOS Simulator时,所有这些设置都会被擦除(如预期的那样)。

I am wondering if there is a way to create a disk image or something similar, which would automatically be used whenever I reset my simulator? 我想知道是否有一种方法可以创建磁盘映像或类似的东西,每当我重置模拟器时会自动使用它?

Thanks for you help. 感谢您的帮助。

The data for individual devices in the iOS Simulator live in ~/Library/Developer/CoreSimulator/Devices/<UUID>/ . iOS模拟器中各个设备的数据位于~/Library/Developer/CoreSimulator/Devices/<UUID>/ The easiest way to get what you're after is probably to find which one pertains to the device you're working with, reset it, start it up, copy the data folder elsewhere, set up the settings you need, then use a diff tool to find what changed between the clean state and the state you ended up in. Keep those files, then copy them in after the next time you reset the simulator. 获取所需信息的最简单方法可能是找到与您正在使用的设备有关的设备,将其重置,启动,将数据文件夹复制到其他位置,设置所需的设置,然后使用差异工具,以查找清除状态和最终状态之间的变化。保留这些文件,然后在下次重置模拟器时将它们复制到其中。 Not automatic, but possibly quicker than having to go through the settings UI each time. 不是自动的,但可能比每次都要通过设置UI更快。

You can modify the sample content that gets copied into the device when it is erased. 您可以修改在擦除时复制到设备中的样本内容。 This is located in the appropriate simruntime bundles. 它位于相应的simruntime捆绑包中。 For example: 例如:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS 9.1.simruntime/Contents/Resources/SampleContent /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS 9.1.simruntime / Contents / Resources / SampleContent

Note that modifying this will cause Xcode.app's signature to change, invalidating it. 请注意,修改此设置将导致Xcode.app的签名更改,从而使其无效。 This will result in full installs being downloaded for updates from the Mac App Store instead of delta updates. 这将导致从Mac App Store下载完整安装而不是增量更新以进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM