简体   繁体   中英

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.

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).

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>/ . 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.

You can modify the sample content that gets copied into the device when it is erased. This is located in the appropriate simruntime bundles. For example:

/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. This will result in full installs being downloaded for updates from the Mac App Store instead of delta updates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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