OpenSimulator
实现原理比较简单,模拟器列表只显示当前启动的模拟器
//获取当前活动的window集合
CG_EXTERN CFArrayRef __nullable CGWindowListCopyWindowInfo(CGWindowListOption option,CGWindowID relativeToWindow)
//这个就是模拟器对应的window信息
{
kCGWindowAlpha = 1;
kCGWindowBounds = {
Height = 818;
Width = 421;
X = 299;
Y = 22;
};
kCGWindowLayer = 0;
kCGWindowMemoryUsage = 1128;
kCGWindowName = "iPhone 7 - iOS 11.1";
kCGWindowNumber = 13808;
kCGWindowOwnerName = Simulator;
kCGWindowOwnerPID = 44458;
kCGWindowSharingState = 1;
kCGWindowStoreType = 1;
}
根据window信息前往/Library/Developer/CoreSimulator/Devices/device_set.plist
查找对应的UDID
,然后找到所安装的所有应用.
关于真机的沙盒路径,使用了webServer
当连接了设备,则会显示设备的用户名称
选择Usage
则会打开一个文件夹,查看README.md
使用说明
GCDWebUploader.bundle
、WebServer.framework
添加到工程项目
调用[WebServer connect];
就可以开启webServer
服务.
Open Web Server
则打开设备的沙盒服务器