I have an app which I've deployed onto my iPhone. It allows users to take a number of photos of various items and store them in the app. I'm using Core Data to do this by persisting the parent object and many of the objects in the graph have images saved. I'm finding that the app size on the iPhone is growing exponentially with only a few photos saved. I've also started to have a lot of crashes and hence I want to essentially export the data from my iPhone and import into XCode so I can debug the issue locally. I've tried connecting XCode to the phone running the app but that doesn't seem to work. Is there a way to download the app and it's data from my iPhone and restore it to XCode so I can check out what's going on?
Asked
Active
Viewed 1,179 times
-1
-
Possible duplicate of [Browse the files created on a device by the IOS application I'm developing, on workstation?](http://stackoverflow.com/questions/6121613/browse-the-files-created-on-a-device-by-the-ios-application-im-developing-on-w) – matt Mar 27 '17 at 15:11
1 Answers
1
Connect the device to your Mac and then...
- Open the organizer window (press cmd-shift-2 or use the "Window" menu).
- Click on the device in the organizer window.
- Select your app in the "Installed Apps" section of the window.
- Click the gear icon below the app list and select "Download Container" from the pop-up menu.
Xcode will ask you where to save the data. It's a .xcappdata
package. You can explore it by right-clicking on it and selecting "show package contents", or browse it in Terminal.
If you want to then use that data in your project, there are a couple of possibilities depending on what you need and how you want to use it.
- If you want one or more specific files, you'll need to look inside the package, find those files, and add them to your project.t
- If you want to use everything in the package, add the
.xcappdata
package to your project. Then edit the build scheme (Product
menu ->Scheme
->Edit Scheme
). in the "Run" section under "Options", select the.xcappdata
as the "Application Data" option. Xcode will then use that as the starting point when running the app.

Tom Harrington
- 69,312
- 10
- 146
- 170
-
Thanks - but is there a way to then bring that data into my project in Xcode? I have already downloaded the container and browsed using "show package contents", but I'd like to use the data within my project. Should I unpack the .xcappdata into a specific folder for it to be reflected in my project? – Rob F Mar 27 '17 at 17:09