Xcode 6 iPhone Simulator Application Support location

118,762

Solution 1

The simulator directory has been moved with Xcode 6 beta to...

~/Library/Developer/CoreSimulator

Browsing the directory to your app's Documents folder is a bit more arduous, e.g.,

~/Library/Developer/CoreSimulator/Devices/4D2D127A-7103-41B2-872B-2DB891B978A2/data/Containers/Data/Application/0323215C-2B91-47F7-BE81-EB24B4DA7339/Documents/MyApp.sqlite

Solution 2

I would suggest that you use SimPholders to find your Simulator files. It is a menu bar item that tracks your simulator apps and lets you go directly to their folders and content. It's awesome.

Solution 3

I found SimulatorManager application very useful. It takes you directly to the application folder of installed simulators. I have tried with 7.1, 8.0 and 8.1 simulators.

SimulatorManager resides as an icon in the system tray and provides an option to "Launch At Login".

enter image description here

Note: This works only with Xcode 6 (6.1.1 in my case) and above.

Hope that helps!

Solution 4

To know where your .sqlite file is stored in your AppDelegate.m add the following code

- (NSURL *)applicationDocumentsDirectory
{
    NSLog(@"%@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory      inDomains:NSUserDomainMask] lastObject]);

    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory     inDomains:NSUserDomainMask] lastObject];
 }

now call this method in AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  //call here
   [self applicationDocumentsDirectory];

}

Solution 5

This worked for me in swift:

let dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
println("App Path: \(dirPaths)")
Share:
118,762
HGDev
Author by

HGDev

Updated on July 08, 2022

Comments

  • HGDev
    HGDev almost 2 years

    In Xcode 6, I have an app I'm using Core Data in, but there is no folder in Application Support for the iOS 8 iPhone Simulator. Where are my files and Core Data sqlite database being stored?

  • harryhorn
    harryhorn almost 10 years
    this is correct in general but it seems there are more internal folder changes. This is the path that works for me in Xcode Beta 3: ~/Library/Developer/CoreSimulator/Devices/B2C6629C-998D-4E84‌​-9ADB-06CAF5BA4B89/d‌​ata/Containers/Data/‌​Application/62593001‌​-FADA-4647-AA80-FE99‌​73956C05/Documents/
  • vir us
    vir us almost 10 years
    Is there a way to understand that numbers or brute force is the only chance to get to data?
  • vir us
    vir us almost 10 years
    NSLog(@"app dir: %@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]); - will print the full path to data folder
  • seabass
    seabass almost 10 years
    I needed a persistent shortcut to my app's documents directory, for quick debugging. After application didFinishLaunchingWithOptions. #if DEBUG NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; NSString *aliasPath = [NSString stringWithFormat:@"XCodePaths/%@", appName]; remove([aliasPath UTF8String]); [[NSFileManager defaultManager]createSymbolicLinkAtPath:aliasPath withDestinationPath:DOCS_DIR error:nil]; #endif Now I've got a simlink that works, even though iOS8 + XCode6 changes my App's Data GUID everytime I build.
  • ThomasW
    ThomasW over 9 years
    The xcrun simctl list command can be used to see the correspondence between the simulator names and the device UDIDs. Or more specifically the xcrun simctl list devices command.
  • Leonardo Amigoni
    Leonardo Amigoni over 9 years
    Something weird happens. I save the files to the data directory and print the directory path to see where they are, I go to finder to look for it and that application folder doesn't exist. It seems that the names are constantly changing.
  • mackworth
    mackworth over 9 years
    In the debugger, you can type ` po [[[NSFileManager defaultManager] URLsForDirectory: 9 inDomains: 1] lastObject]` (as it doesn't know what NSDocumentDirectory or NSUSerDomainMask are).
  • Rodrigo Lima
    Rodrigo Lima over 9 years
    I was also having issues with SimPholders2 on Yosemite, so I started a command line script to help you find and open a Finder window to the simulator and App you want. It goes through the folders and metadata plists to list all simulator folders and Apps. If interested, check it out here
  • Jason
    Jason over 9 years
    SimPholders2 works in Yosemite but it's a bit slow; once you click the icon in the status bar, just wait a few seconds and it should appear.
  • onmyway133
    onmyway133 about 9 years
    Thanks, I just update XcodeWay to support iOS 8 simulator folder
  • Yasitha Waduge
    Yasitha Waduge about 9 years
    great.. specially useful when there are multiple simulators
  • TruMan1
    TruMan1 about 9 years
    Whoa it's awesome and latest works with Yosemite + Xcode 6.3!
  • jazzy
    jazzy about 9 years
    @Scott Gardner can you update your answer please? The directory names change consistently. vir us has a much more appropriate solution.
  • Shubhendu
    Shubhendu almost 9 years
    Use "NSTemporaryDirectory ()". Look this- stackoverflow.com/questions/1108076/…
  • malena
    malena almost 9 years
    Amar, how do you install the SimulatorManager? I thought it was a plugin to Xcode but it is an Xcode project
  • paulvs
    paulvs over 8 years
    @ThomasW There's also a file default_created.plist in ~/Library/Developer/CoreSimulator/Devices that lists all the simulators and their UDID.
  • Heckscheibe
    Heckscheibe almost 8 years
    in the top bar select: Product -> Archive -> and then Export the Archive as a Mac Application without re-signing (the last option) you will get a .app file which you can put in your Application folder like a normal application...
  • AtomicBoolean
    AtomicBoolean over 6 years
    Swift 3.0: let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) print("App Path: \(dirPaths)")