160

I'm developing an IOS app that creates files on the device, e.g. with NSKeyedArchiver.

During Android development it's possible to browse a device filesystem when it's connected to your workstation via USB, for instance to help with troubleshooting your app.

However for IOS I don't see anything similar under the Organizer in Xcode, to help me browse files my app creates from the workstation. Googling "iOO browse device files", "iPhone view files" etc. reveals solutions for jailbroken devices but not for regular devices provisioned for development.

How can I browse files on a device created by an iOS app I'm developing?

pkamb
  • 33,281
  • 23
  • 160
  • 191
Jim Blackler
  • 22,946
  • 12
  • 85
  • 101

6 Answers6

227

In Xcode's Organiser, go to your device's Summary tab. Find your application in the list, and click the disclosure triangle. Under it, you should see an icon saying "Application Data". Click the down pointing arrow to download the data, and it'll prompt you for somewhere to save it.

In Xcode 5, listed under your device in Organizer, click on "Applications" and you can see "Data files in Sandbox" in the bottom half of the window.

In Xcode 6, go to Window -> Devices, select the device, select the app name under Installed Apps, click the settings gearbox, then select Download container.... In finder, double finger tap the package and select Show package contents. enter image description here

Abhishek Bedi
  • 5,205
  • 2
  • 36
  • 62
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
  • 11
    Not necessary to do this with iPhone Simulator, as you can browse to /Library/Application Support/iPhone Simulator to access the contents of your simulator apps. – Shannon Sep 26 '13 at 19:48
  • 49
    in xcode 6 -> window / devices / select app name / click settings gearbox / select download container. in finder, double finger tap, show package contents. – tmr Sep 21 '14 at 04:05
  • 1
    I am trying to access my .sqlite file created by core data.. but the downloaded .sqlite from the container does not have any values, however, I can Log the values in the debugger. Data is being stored in the DB but the downloaded container shows empty database. – nr5 Jun 29 '15 at 07:07
  • Is it possible to prevent the container to be downloaded? – Florian Fröhlich Mar 09 '18 at 15:09
  • 1
    Does the contents get deleted if you delete the application or do you need to do it manually?! – Famic Tech Jan 14 '19 at 20:48
  • On Xcode 10, I get the following message after I clicked on "Download Container": "Too many instances of this service are already running." – AndaluZ Feb 18 '19 at 10:49
  • Using the download container method, I'm unable to find a sqlite db that I placed in an shared app-group. – paiego May 13 '20 at 00:09
  • This feature is not available for apps installed from TestFlight on iOS 14. – Dimple Shah Oct 08 '20 at 08:37
123

In Xcode 6, open the Devices window:

Step 1

Then, select the app (in Installed Apps) and then click the gear icon and select Download Container.

Step 2

pkamb
  • 33,281
  • 23
  • 160
  • 191
Ilya
  • 5,533
  • 2
  • 29
  • 57
54

Pls note, that you can view contents of downloaded .xcappdata container by right click on it and select "Show Package Contents"

Dren
  • 2,017
  • 21
  • 18
  • 5
    Where the heck is this documented?? Seriously, I looked for a long time for this. – Simon Corcos Apr 26 '18 at 21:12
  • 1
    The .xcappdata package is just a folder the same way a .xcodeproj is just a folder. You can `cd` into it from the Terminal. – rstackhouse Jan 04 '19 at 20:40
  • Documented in Bundle Programming Guide archive https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html#//apple_ref/doc/uid/10000123i-CH100-SW1 – Dren Jan 20 '21 at 11:21
10

iExplorer works like a charm! Just used it to export some app files! http://www.macroplant.com/iexplorer/download-ie3-mac.php

Samir Seetal
  • 392
  • 6
  • 8
  • iExplorer has been crashing badly over here. Maybe you can check for other options such as SimPholders – Alan Andrade May 05 '16 at 18:34
  • Seems not to work on iOS 10.3 - I always get permission errors when trying to open app folders. – JustAMartin Aug 02 '17 at 17:12
  • Kind of makes you wonder how to implement something similar yourself... – Jonny Feb 23 '18 at 03:28
  • Just confirmed that [iExplorer 4](https://macroplant.com/) works well under Catalina and iOS 13 to extract files from an installed app. The greatest benefit is that you don't have to download the whole "container" using XCode and can pick just the file(s) you need. – Greg Sadetsky Jan 22 '20 at 19:30
10

In Xcode9: / Window / Devices and Simulators

Select the desired installed app, click the gear at the bottom and Download container...

In Finder, "right-click" the downloaded file and Show Package Contents to open it in a new Finder window.

I hope it's useful. Peace.

Marlon Dias
  • 811
  • 9
  • 15
  • The .xcappdata package is just a folder the same way a .xcodeproj is just a folder. You can cd into it from the Terminal. – rstackhouse Jan 04 '19 at 20:41
8

XCode version : 10.2.1

goto window -> Devices and Simulators

enter image description here

and after that choose your device from the left list, choose the app from the installed app, so you can press show container for show app's contains on the new page on xcode, press download container to download it to your OSX, also you can replace an old container to the moment state with Replace container...

enter image description here

Community
  • 1
  • 1
mohsen
  • 4,698
  • 1
  • 33
  • 54