如何通过Shell脚本在真机iPhone上启动App Store下载的应用?
问题解答
能否通过Shell脚本启动App Store下载的应用?
不行。从App Store下载的应用经过苹果官方签名,无开发者权限无法通过idevicedebug这类工具直接启动。这类工具仅支持开发者签名的应用(比如Xcode编译安装、或用开发者证书重签名的应用)。
iOS 14.4.2 + Xcode 14 挂载开发者磁盘镜像解决方案
Xcode 14默认仅包含较新版本iOS的开发者磁盘镜像,不支持iOS 14.4.2,需手动获取对应镜像并挂载:
步骤1:获取iOS 14.4.2的开发者磁盘镜像
从支持iOS 14.x的旧版Xcode(比如Xcode 12.5.1)中提取,镜像文件所在路径为:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.4.2 (18D70)/
该目录下包含iPhoneOS DeveloperDiskImage.dmg和iPhoneOS DeveloperDiskImage.dmg.signature两个必需文件。
步骤2:复制镜像到Xcode 14对应目录
先创建Xcode 14中iOS 14.4.2的支持目录:
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.4.2\ \(18D70\)/
再将提取到的两个文件复制进去:
sudo cp /path/to/extracted/iPhoneOS\ DeveloperDiskImage.dmg /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.4.2\ \(18D70\)/ sudo cp /path/to/extracted/iPhoneOS\ DeveloperDiskImage.dmg.signature /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.4.2\ \(18D70\)/
步骤3:重启服务并挂载镜像
重启usbmuxd服务:
sudo killall usbmuxd
执行挂载命令:
ideviceimagemounter /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.4.2\ \(18D70\)/iPhoneOS\ DeveloperDiskImage.dmg
步骤4:验证挂载状态
执行以下命令,若能正常返回设备名称,说明挂载成功:
ideviceinfo -k DeviceName
此时可重新尝试运行idevicedebug命令。
内容的提问来源于stack exchange,提问作者user22613118
相关产品推荐
相关产品推荐

