iOS8 Simulator – Documents Directory

Update 8.1.3: Someone at Cupertino just can’t make up their mind. With the release of 8.1.3 the path for the documents directory changed yet again from:

~/Library/Developer/CoreSimulator/Devices/<SIMULATOR YOU WANT>/data/Containers/Data/Application/<APP YOU WANT>

to,

~/Library/Developer/CoreSimulator/Devices/<SIMULATOR YOU WANT>/data/Applications/<APP YOU WANT>

 tl;dr: Download the app. Run it to open the most recent application’s documents directory.

Upto iOS 7.1, the iOS simulators were located under

~/Library/Application Support/iPhone Simulators/

where you would be presented with a list of all the simulators you used. You can read more about it here. iOS 8 changed the directory hierarchy of the Simulator Devices and its Documents directories. Simulators are now located at

~/Library/Developer/CoreSimulator/

But there is another surprise. Instead of being presented with a human readable list of simulators like this,

Screen Shot 2014-11-28 at 3.24.45 pm

we now get gibberish

Screen Shot 2014-11-28 at 3.27.33 pm

Apparently, Apple thinks simulator names are too confidential to reveal to app developers. (before you get your chaddi in a ganth, I am just kidding. I am sure there is some perfectly reasonable explanation for this) Basically, we now have folders with UUIDs for names that we can’t map to anything. Assuming you are only interested to get into the device simulator you were most recently working with, a workable solution is to sort them by modified date in list view. Screen_Shot_2014-11-28_at_3_38_25_pm

In my case I can safely assume that 7B2CF1B3-1820-4313-B010-A4CCD4764D10 is actually simulator folder for iPhone 6 plus – 8.1 that I was just testing.

Next – Locating the Applications

Locating the application is another run through the maze. Inside your simulator folder you will find a structure like this

Screen Shot 2014-11-28 at 3.44.01 pm

The applications are located under

/data/Containers/Data/Application/

Here you can again sort the list by ‘Date Modified’ to get you most recent app on the top. The rest of the structure remains unchanged. So now you can just create an alias (shortcut) on you desktop and… STOP. YOU CAN’T! Because on each run of your app, the directory name for your app changes.. wow! You will have to do a circus everytime you need to inspect the documents directory of your current app. Unless you want to be awesome that is. And you can do that by writing a script, which

  • Navigates to the CoreSimulators/Devices directory
  • Sorts the results by ‘Data modified’
  • Picks up the latest one.
  • Navigates to ../data/Containers/Data/Application/
  • Sorts the results again
  • Picks up the latest one.
  • opens that directory in Finder.

You can find my script here if you want a guide, other wise just go for the directly executable app –

Download Executable App

Like other script apps the best way to use this app is to put it in some folder and just forget. You can launch it directly from spotlight every time you want to open the Documents directory.

Advertisements

6 thoughts on “iOS8 Simulator – Documents Directory

  1. Erril Barnes says:

    Thank you for your efforts! This works great.

  2. i’m glad you found it useful

  3. Prajwal says:

    You saved my day .. was looking for the documents in application support/iPhoneSimulator Thanks a lot for your effort!! appreciate it :) isthiswhatyouarelookingfor.com

  4. teejayf says:

    For El Capitan and Xcode 6.4 Needs to be changed to:

    cd ~/Library/Developer/CoreSimulator/Devices/$fname/data/Containers/Data/Application/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: