3 Ways to get your iOS app data out

gmarik 2 min
Table Of Contents ↓

As far as I know there are 3 ways:

  1. Organizer
  2. iTunes
  3. iTunes Backup

Assuming that you can deploy the app to the device.

Organizer

Organizer lets you quickly download app data from a device.

img-organizer

Press download to get data saved.

This approach doesn’t work if an app is installed from AppStore even if you’re the developer.

iTunes

iTunes mediates access to the Documents/ folder in App Sandbox. It’s disabled by default and could be enabled with the snippet:

<key>UIFileSharingEnabled</key>
<string>YES</string>

placed into an_app-Info.plist file of an app.

So, to recap:

  1. target file must be located in App Sandbox’ Documents/ directory.
  2. the above snippet must be placed into an_app-Info.plist file
  3. the app has to be re-deployed to the device
  4. use iTunes to get/put required files

iTunes screenshot:

img-itunes

This works even if an app is installed from the App Store.

iTunes Backup

This is purely an idea at this point. It’s the slowest and most complicated one.

iTunes backs up your device to ~/Library/Application Support/MobileSync/Backup/<device_id>/. In case of unencrypted backup files represent data from a device with just file names obscured.

Theoretically it should be possible to search through the files and find one you’re looking for.

Haven’t tried it yet as previous 2 approaches worked for me!

Using data

  1. for backup
  2. as test data in simulator

For backup

Developing an iOS app may require certain manipulations with its data files. Ie you may need to keep a snapshot of data for certain reasons. Also backing up data may be a requirement, especially if you’re using the same app in “production”.

Test Data in simulator

Copying data into a simulator can save you from recreating test data in an app.

Simulators are located in ~/Library/Application Support/iPhone Simulator once installed.

Then you just need to find the app folder and copy files where they belong.

Summary

Overall Apple over complicated task of copying files. This post is my personal note on the subject.

Related Posts
Read More
MHAboutView for iOS
TLS auth in SOA
Comments
read or add one↓