4

Where is the app content folder in the simulator of Xcode 9.x and later?

0

3 Answers 3

41

I found it in the following path.

~/Library/Developer/CoreSimulator/Devices/(SIMULATORID)/data/Containers/Data/Application/(APPLICATIONID)

You can also look into this application for more details.

List of simulator devices can be found in the below path:

~/Library/Developer/CoreSimulator/Devices/

Below file has simulator information:

~/Library/Developer/CoreSimulator/Devices/{UUID}/device.plist
0
33

simctl is the officially supported tool to do what you want. It can create, delete, and reboot devices. It can also install, uninstall, and launch applications.

xcrun simctl get_app_container booted <BundleID> data will get the path to the data container for the given BundleID.

You can use data, app, and group for the container type. When using group pass the group container ID not the Bundle ID. If you don't specify the kind of container you get the app bundle container (for historical compatibility reasons).

To see full help for the command run xcrun simctl help get_app_container.

2
  • This gets me the APP container, not the DATA container.
    – Dale
    Feb 20, 2020 at 0:58
  • 2
    If you look a little closer you will see you need to append data to the end of the command to get the data container. The default is the app container for compatibility reasons (because the original implementation only returned the app container). As I noted please see xcrun simctl help get_app_container for the full details, including how to get group data containers.
    – russbishop
    Feb 28, 2020 at 4:50
10

I will suggest you to print the file path when you get the document directory like below

let dirPathNoScheme = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String
print(dirPathNoScheme)// then you can just control + shift + G or Go->Go to Folder and paste "~/Library/Developer/CoreSimulator/Devices/53AS028-BBE4-40D3-BC1A-60C2DSDFE0B3/data/Containers/Data/Application/A94SERF7-9191-4B1D-AAA5-BASFE654ED78/Documents"

Obj-C:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSLog(@"PATH=%@",paths);

That's it😊

1
  • 2
    This is a heck of a lot faster than clicking through 17 device folders that each have something like 51 app containers!
    – bugloaf
    Mar 17, 2020 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.