As far as I know there are 3 ways:
- Organizer
- iTunes
- iTunes Backup
Assuming that you can deploy the app to the device.
Organizer
Organizer lets you quickly download app data from a device.
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:
- target file must be located in App Sandbox’
Documents/
directory. - the above snippet must be placed into
an_app-Info.plist
file - the app has to be re-deployed to the device
- use iTunes to get/put required files
iTunes screenshot:
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
- for backup
- 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.