Xcode: directory file for simulator Iphone Xcode: directory file for simulator Iphone xcode xcode

Xcode: directory file for simulator Iphone


I'm not sure if you are able to write in your bundle, but you can in your Documents directory instead as your code does. Why don't you try this?

Use the same code and you will find your file in:

/Users/YOURUSER/Library/Application Support/iPhone Simulator/IOSVERSION/Applications/APPID/Documents/file.txt


This changed with XCode 6 and iOS 6 and this got tricky.

The documents directory are now hidden within:

~/Library/Developer/CoreSimulator/Devices/<some-id>/data/Containers/Data/Application/<some-other-id>

It seems the location is changing at each application start, so it's really hard to track. There is a simple tip I borrowed from this article and that I will include for the lazy ones:

#if TARGET_IPHONE_SIMULATOR// where are you?NSLog(@"Documents Directory: %@", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);#endif

Add this for example to your applicationDidFinishLaunching method, should make it easier!

If you want more details, just have a look to the original article

NB: I know the question is old, but well, I found it while searching, so I think adding an updated answer may serve some of us!


The Documents directory for your app in the simulator is located at;

~/Library/Application Support/iPhone Simulator/YOUR-IOS-VERSION/Applications/UNIQUE-KEY-FOR-YOUR-APP/Documents