我的应用程序文档文件夹在XCode 9模拟器中的位置

时间:2017-12-23 06:13:21

标签: ios-simulator document directory xcode9

它在哪里?我尝试了XCode 8的旧答案,它不在那里。 为什么Apple让我们很难在模拟器中看到我们应用程序的沙箱?

4 个答案:

答案 0 :(得分:23)

我在以下路径中找到了它。

~/Library/Developer/CoreSimulator/Devices/(SIMULATORID)/data/Containers/Data/Application/(APPLICATIONID)

您还可以查看this应用程序以获取更多详细信息。

模拟器设备列表可在以下路径中找到:

~/Library/Developer/CoreSimulator/Devices/

下面的文件有模拟器信息:

~/Library/Developer/CoreSimulator/Devices/{UUID}/device.plist

答案 1 :(得分:13)

Sub Test() Dim row1 As Integer Dim row2 As Integer Dim index1 As Integer Dim index2 As Integer index1 = 0 index2 = 0 row1 = 2 row2 = 10 Do Do If Cells(row1, 1).Value = Cells(row2, 1).Value And _ Cells(row1, 3).Value = Cells(row2, 3).Value Then If Cells(row1, 2).Value <> Cells(row2, 2).Value Then Range(Cells(row1, 1), Cells(row1, 3)).Interior.ColorIndex = 3 Range(Cells(row1, 2), Cells(row1, 2)).Interior.ColorIndex = 6 Range(Cells(row2, 1), Cells(row2, 3)).Interior.ColorIndex = 3 Range(Cells(row2, 2), Cells(row2, 2)).Interior.ColorIndex = 6 Else Range(Cells(row1, 1), Cells(row1, 3)).Interior.ColorIndex = 3 Range(Cells(row2, 1), Cells(row2, 3)).Interior.ColorIndex = 3 Exit Do End If End If row2 = row2 + 1 index2 = index2 + 1 Loop Until index2 = 12 row1 = row1 + 1 index1 = index1 + 1 index2 = 0 row2 = 10 Loop Until index1 = 4 End Sub 是官方支持的工具,可以满足您的需求。它可以创建,删除和重启设备。它还可以安装,卸载和启动应用程序。

simctl将获取给定BundleID的数据容器的路径。

要查看命令运行xcrun simctl get_app_container booted <BundleID> data的完整帮助。

答案 2 :(得分:1)

当您获得如下所示的文档目录时,我建议您打印文件路径

let dirPathNoScheme = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String
print(dirPathNoScheme)// then you can just control + shift + G or Go->Go to Folder and paste "~/Library/Developer/CoreSimulator/Devices/53AS028-BBE4-40D3-BC1A-60C2DSDFE0B3/data/Containers/Data/Application/A94SERF7-9191-4B1D-AAA5-BASFE654ED78/Documents"

就这样?

答案 3 :(得分:0)

对于Xcode版本10.2,它是

 /Users/{username}/Library/Developer/CoreSimulator/Devices/{simulator ID}/data/Containers/Bundle/Application/{simulator ID}/yourapp.app