【发布时间】:2018-06-05 14:57:02
【问题描述】:
Xcode 9.x及更高版本的模拟器中app内容文件夹在哪里?
【问题讨论】:
标签: directory ios-simulator xcode9
Xcode 9.x及更高版本的模拟器中app内容文件夹在哪里?
【问题讨论】:
标签: directory ios-simulator xcode9
我在以下路径中找到它。
~/Library/Developer/CoreSimulator/Devices/(SIMULATORID)/data/Containers/Data/Application/(APPLICATIONID)
您也可以查看this 申请以了解更多详情。
模拟器设备列表可以在以下路径中找到:
~/Library/Developer/CoreSimulator/Devices/
以下文件有模拟器信息:
~/Library/Developer/CoreSimulator/Devices/{UUID}/device.plist
【讨论】:
simctl 是官方支持的工具,可以随心所欲。它可以创建、删除和重启设备。它还可以安装、卸载和启动应用程序。
xcrun simctl get_app_container booted <BundleID> data 将获取给定 BundleID 的数据容器的路径。
您可以使用data、app, 和group 作为容器类型。使用 group 时,传递组容器 ID 而不是 Bundle ID。如果您不指定容器的类型,您将获得 app bundle 容器(出于历史兼容性原因)。
要查看命令的完整帮助,请运行xcrun simctl help get_app_container。
【讨论】:
data 附加到命令末尾以获取数据容器。出于兼容性原因,默认是应用容器(因为最初的实现只返回了应用容器)。正如我所指出的,请参阅xcrun simctl help get_app_container 了解完整的详细信息,包括如何获取组数据容器。
我会建议你在得到如下文件目录时打印文件路径
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"
对象-C:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSLog(@"PATH=%@",paths);
就是这样?
【讨论】: