Using xcrun simctl to find the documents folder of your app in the iOS Simulator

September 24, 2017

Having trouble finding the Documents folder of the app you’re writing, then look no further.

Using the xcrun simctl command it’s easy to find the directory in the currently booted iOS Simulator.

xcrun simctl get_app_container booted my.app.identifier data

If we look inside this folder we will find the Documents folder of the supplied app identifier.

ls $(xcrun simctl get_app_container booted my.app.identifier data)

Documents  Library    SystemData tmp

There are many other things that xcrun simctl can do, such as creating and deleting Simulators, installing apps and photos plus much more. Great if you’re using a CI server and want to have a clean environment between runs.

After a quick Google I found a few great posts on the matter: