ChatGPT解决这个技术问题 Extra ChatGPT

Browse the files created on a device by the iOS application I'm developing, on workstation?

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?


A
Abhishek Bedi

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.

https://i.stack.imgur.com/Jr8OK.png


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.
in xcode 6 -> window / devices / select app name / click settings gearbox / select download container. in finder, double finger tap, show package contents.
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.
Is it possible to prevent the container to be downloaded?
Does the contents get deleted if you delete the application or do you need to do it manually?!
p
pkamb

In Xcode 6, open the Devices window:

https://i.stack.imgur.com/2cidT.png

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

https://i.stack.imgur.com/S7SGk.png


And how do we browse / open this file?
@OliverDixon as stated below, right click and select "Show Package Contents"
D
Dren

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


Where the heck is this documented?? Seriously, I looked for a long time for this.
The .xcappdata package is just a folder the same way a .xcodeproj is just a folder. You can cd into it from the Terminal.
Documented in Bundle Programming Guide archive developer.apple.com/library/archive/documentation/…
S
Samir Seetal

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


iExplorer has been crashing badly over here. Maybe you can check for other options such as SimPholders
Seems not to work on iOS 10.3 - I always get permission errors when trying to open app folders.
Kind of makes you wonder how to implement something similar yourself...
Just confirmed that iExplorer 4 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.
M
Marlon Dias

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.


The .xcappdata package is just a folder the same way a .xcodeproj is just a folder. You can cd into it from the Terminal.
C
Community

XCode version : 10.2.1

goto window -> Devices and Simulators

https://i.stack.imgur.com/FCYcQ.jpg

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...

https://i.stack.imgur.com/CMmHV.jpg