简体   繁体   中英

Is there a way to move my iOS Simulator app data from one simulator (iPhone 7) to another (iPad Pro 12.9)?

I have an app built and running in my iPhone 7 simulator using Xcode 8. It's loaded up in the simulator and I've loaded the app with stored data now stored locally.

When I run that same app on my iPad Pro 12.9 simulator, it acts like a fresh device and has none of the stored data in it for my app.

Is there a way to have all of the simulators use the same app storage? Or at least any easy way to move apps between them?

  • Go to ~/Library/Developer/CoreSimulator/Devices . (Library folder is hidden generally. Unhide the folder with this command in terminal - defaults write com.apple.finder AppleShowAllFiles YES and restart the Finder).
  • You will find the bunch of folders specific to the simulator at the mentioned path. Also find plist, named device_set.plist , which has the entry of all the available simulators.

在此输入图像描述

  • Find the ids of the source and destination simulators you are interested in under Root->DefaultDevices->com.apple.CoreSimulator.SimRuntime.iOS-XX-X (XX-X - OS version that you run your simulator on.)
  • Once you find the ids, search the folder with that name in the above-mentioned path.
  • The simulator folder will contain data and device.plist .
  • Copy the data folder from source simulator and replace it in the destination simulator.
  • That's it! If your destination simulator is open, just restart it and it should reflect the data of source simulator.

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