Document Directory Path of iOS 8 Beta Simulator

2020-01-25 03:54发布

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?

enter image description here

21条回答
Ridiculous、
2楼-- · 2020-01-25 04:48

With iOS 9.2 and Xcode 7.2, the following script will open the Documents folder of the last installed application on the last used simulator;

cd ~/Library/Developer/CoreSimulator/Devices/
cd `ls -t | head -n 1`/data/Containers/Data/Application 
cd `ls -t | head -n 1`/Documents
open .

To create an easy runnable script, put it in an Automator Application with "Run Shell Script":

Run Shell Script inside Automator Application

查看更多
Melony?
3楼-- · 2020-01-25 04:48

The simulators are located under:

~/Library/Developer/CoreSimulator/

Here, they are listed as directories with UUID names. Use sort by 'Date modified' to find the latest one. Inside navigate to:

/data/Containers/Data/Application/

Here you will get a list of all the applications on that device. You can again sort this to get the latest app.

NOTE: Xcode changes the directory name every time you run the app, so don't rely on making alias/short cuts on desktop.

The easiest way is to use the app here, which does everything automatically.

查看更多
兄弟一词,经得起流年.
4楼-- · 2020-01-25 04:48

iOS 11

if let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory,
                                                           .userDomainMask,
                                                           true).first {
    debugPrint("documentsPath = \(documentsPath)")
}
查看更多
登录 后发表回答