21

I'm trying to run a release build on my iPad device connected to xcode for debugging. I'm not certain but guessing that when I do this the documents directory ends up somewhere on my local machine and not on the iPad (as when I run it without xcode). I get an output like this for the directory:

/var/mobile/Applications/FF0F1AB2-AD1F-4E42-8815-9E399EEF5027/Documents/

but I can't access that directory. Going to /var does not reveal any 'mobile' subdir. This seems different from when I run the iPad unconnected and end up with files viewable on the device through Organizer within xcode (making me conclude that it saves them locally in this mysterious dir when run connected to xcode).

Can someone help me access this mystery directory?

Vin
  • 10,517
  • 10
  • 58
  • 71
Joey
  • 7,537
  • 12
  • 52
  • 104

7 Answers7

23

For "xcode 6":

  1. Connect your device with your MAC (You can sure about that having a look into the simulator list, it should be there)
  2. Now open xcode and go to "Windows" from upper menu
  3. Go to "Devices" from drop down list
  4. Now this window will pop up. Your app should be there in the "Installed Apps" section. Like the picture below. Double click on it.

    enter image description here

  5. Here you can see the "Documents" folder and the photos you saved earlier. You can't delete photo from this list. Because this is the iPhone device section, you accessing through the xcode.

    enter image description here

  6. If you want to delete the photos, you have to delete the whole project. To do that, scroll down below the screen and there should be a minus "-" button. After selecting your project just click on it. It will delete your photos as well as whole project.

    enter image description here

Tulon
  • 4,011
  • 6
  • 36
  • 56
  • 7
    If someone needs to view the files in the app, select the app name you want to reveal and click the 'cog' at the bottom, then select 'Download Container...'. Open the downloaded file and right click to show the package content. Dig the package and you will find the staff you need. – WangYudong Mar 30 '15 at 06:28
  • 1
    Thanks for the show package content tip, an important step if you need an actual file from the package. – machineboy Oct 13 '15 at 16:35
15

Window -> Organizer -> select your's Iphone -> Applications -> select your iphone project name and you can see blow in the "Data files in Sandbox"

Kumar V
  • 8,810
  • 9
  • 39
  • 58
ethemsulan
  • 2,241
  • 27
  • 19
6

(Original poster here) A few things I got wrong:

  1. Running it on the device whether with the debugger or not always puts the file on the device, not on the local drive. This /var/mobile directory must be essentially some location on the device itself that can't normally be accessed browsing from the mac.
  2. I needed to refresh the view in Organizer to see the files being placed there. I did so by detaching the iPad and then reattaching it (the usb), and the files would refresh.

Instead of removing the question, I'll leave this here for others and myself for the tip in viewing/refreshing files in organizer and the clarification of where the files are being placed when run on the device.

Joey
  • 7,537
  • 12
  • 52
  • 104
5

The directory you are looking for is located at

/Users/User Name/Library/Application Support/iPhone Simulator/Simulator iOS Version/Applications/Application ID/Documents/

Vin
  • 10,517
  • 10
  • 58
  • 71
Marc Brannan
  • 354
  • 2
  • 7
2

Thank you they are both right in different contexts

If you are running it on device then what @ethemsulan is correct.

And then on the simulator the folder is found on your mac and the file path is as @Vin and @Osiris has given

fftoolbar
  • 175
  • 1
  • 1
  • 11
2

Add this to your info.plist source code and you will find the recorded files inside files of iPhone device.

<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
Santosh Aryal
  • 1,276
  • 1
  • 18
  • 41
0

To see the file saved in iPhone -

  1. Go to plist file of your project.
  2. Set Supports Document Browser to "YES".
  3. You will see the saved file in FILES in your device.

I am using iOS 13 and Xcode 11.6, it worked for me.