iPhone Simulator folder not found in iOS 7, XCode 5

13,241

Have you tried logging the path for the documents directory?

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;

NSLog(@"%@",basePath);

EDIT If you can't see the Library folder, go to finder and press command + shift + G, and enter the output received from above log. in your case, /Users/thomaslee/Library/Application Support/iPhone Simulator/7.0.3/Applications/5482CD65-DA92-4C65-863C-2D1335C24C43/Documents

Share:
13,241
Thomas.Benz
Author by

Thomas.Benz

Updated on June 12, 2022

Comments

  • Thomas.Benz
    Thomas.Benz about 2 years

    Recently, I have upgraded my XCode to verion 5.0.1 from version 4.6.3, and my Mac to iOS 7.0.3 and iOS X Maverick.

    I have a simple project with Core Data and it was written with Xocde 4.6.3 and run with iOS 6.1, and when I run it, I can go view the project sqlite file under path as ~/Library/Application Support/iPhone Simulator/6.1/Applications/[app GUID]/Documents/MyAppName.sqlite.

    After I upgrade my Mac and XCode with new versions as I mentioned above, I open that project with XCode 5, and I am able to perform CRUD operations against Core Data functions used in my application, and the project runs OK. However, I follow the path as above to take a look at my sqlite file, I cannot find out the 'iPhone Simulator' folder under the '~/Library/Application Support' folder.

    Please help. Thank you in advance.

  • Thomas.Benz
    Thomas.Benz over 10 years
    I see the debug output as "/Users/thomaslee/Library/Application Support/iPhone Simulator/7.0.3/Applications/5482CD65-DA92-4C65-863C-2D1335C‌​24C43/Documents". But if I use Finder, I do not see the "Library" folder under the "/Users/thomaslee/" folder. Any ideas?
  • Colin
    Colin over 10 years
    @Thomas.Benz the Library folder under your home directory is hidden and thus is not seen in the Finder by default. You can open a finder to it by typing in "open ~/Library" in a terminal shell.
  • Thomas.Benz
    Thomas.Benz over 10 years
    @Colin, thank you for your helps. Now I can see the folder, and I remove the "hidden" attribute of the folder by using command: chflags nohidden {path-to-folder}