How can I see data inside an iOS app from Xcode?

Viewed 1241

An iOS app is supposed to remove all data when a user logs out of the app. This has been completed, but I am looking for a way to verify that there is no data left over in the app (SQLite, user preferences, etc.)

I cannot figure out how IO can link to the app from Xcode (or from somewhere else and "look" into the app after a user logs out and confirm that all data is gone.

Bryan

1 Answers

I cannot figure out how IO can link to the app from Xcode (or from somewhere else and "look" into the app after a user logs out and confirm that all data is gone.

You can download the directory that contains all the app's data:

  1. Open the Devices and Simulators window in Xcode and connect to the device you want to examine.

  2. You'll see a list of the apps that you've installed on the device. Find the one you're testing in the list and click on it.

  3. Click the gear icon at the bottom of the list and choose Download Container....

  4. Xcode will download a bundle named something like com.your.identifier 2018-12-17 14/18.28.448.xcappdata.

  5. Find the downloaded bundle (you can choose where Xcode puts it) and control-click on it. Choose Show Package Contents. Finder will open a window showing you everything in the app's container.

In addition to just looking at the app container, you can also modify the container and install it on a device. This can be useful for testing. For example, you could modify or delete an important data file from the container and install it on a test device to test that your app gracefully handles an error situation. Or, if someone testing your app runs into a problem you can't reproduce, you can get a copy of the app container from them and install it on your own device.

Related