Xcode 6 iPhone Simulator Application Support location
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".
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)")
HGDev
Updated on July 08, 2022Comments
-
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 almost 10 yearsthis 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/data/Containers/Data/Application/62593001-FADA-4647-AA80-FE9973956C05/Documents/
-
vir us almost 10 yearsIs there a way to understand that numbers or brute force is the only chance to get to data?
-
vir us almost 10 yearsNSLog(@"app dir: %@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]); - will print the full path to data folder
-
seabass almost 10 yearsI 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 over 9 yearsThe
xcrun simctl list
command can be used to see the correspondence between the simulator names and the device UDIDs. Or more specifically thexcrun simctl list devices
command. -
Leonardo Amigoni over 9 yearsSomething 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 over 9 yearsIn 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 over 9 yearsI 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 over 9 yearsSimPholders2 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 about 9 yearsThanks, I just update XcodeWay to support iOS 8 simulator folder
-
Yasitha Waduge about 9 yearsgreat.. specially useful when there are multiple simulators
-
TruMan1 about 9 yearsWhoa it's awesome and latest works with Yosemite + Xcode 6.3!
-
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 almost 9 yearsUse "NSTemporaryDirectory ()". Look this- stackoverflow.com/questions/1108076/…
-
malena almost 9 yearsAmar, how do you install the SimulatorManager? I thought it was a plugin to Xcode but it is an Xcode project
-
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 almost 8 yearsin 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 over 6 yearsSwift 3.0:
let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) print("App Path: \(dirPaths)")