In iOS 7, the document directory of the iOS simulators can be found in:
/Users/Sabo/Library/Application Support/iPhone Simulator/
However, in iOS 8 Beta Simulator, I can't find the corresponding directory for iOS 8 in the directory above.
Where's the document directory path for the iOS 8 Simulator?
The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators.
on my computer, the path is:
~/Library/Developer/CoreSimulator/Devices/1A8DF360-B0A6-4815-95F3-68A6AB0BCC78/data/Container/Data/Application/
NOTE: probably those long IDs (i.e UDIDs) are different on your computer.
NSLog
below code somewhere in "AppDelegate", run your project and follow the path. This will be easy for you to get to the documents rather than searching randomly inside "~/Library/Developer/CoreSimulator/Devices/"
Objective-C
NSLog(@"%@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
Swift
If you are using Swift 1.2, use the code below which will only output in development when using the Simulator because of the #if
#endif
block:
#if arch(i386) || arch(x86_64) let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! NSString NSLog("Document Path: %@", documentsPath) #endif
Copy your path from "/Users/ankur/Library/Developer/CoreSimulator/Devices/7BA821..." go to "Finder" and then "Go to Folder" or command + shift + g and paste your path, let the mac take you to your documents directory :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With