ios模拟器安装app

原文链接:https://blog.csdn.net/huayu_huayu/article/details/79094298
需要用到终端命令行来操作

1.查找模拟器

instruments -s
    输出(只贴出ipad和iphone的):
iPad (5th generation) (11.2) [520E435E-640D-486D-861A-DC78EF09CF27] (Simulator)
iPad Air (11.2) [6A009D9C-4855-4978-B59F-0C31F8C84931] (Simulator)
iPad Air 2 (11.2) [D3A5A401-1126-4666-AE3C-A0B00871CCF9] (Simulator)
iPad Pro (10.5-inch) (11.2) [E5FA9EF6-795F-4759-876E-94708C427548] (Simulator)
iPad Pro (12.9-inch) (11.2) [D5FA5FEF-286B-406B-AE6F-79E0081E4F64] (Simulator)
iPad Pro (12.9-inch) (2nd generation) (11.2) [7E23AC31-4E73-4726-A7B9-151F57A8001B] (Simulator)
iPad Pro (9.7-inch) (11.2) [6FD10B83-E012-4A01-82F4-833AFBF602DC] (Simulator)
iPhone 5s (11.2) [4E38DF1F-D5FF-4EF7-BCBC-39D45D1A3FF9] (Simulator)
iPhone 6 (11.2) [6082A07F-9B51-4B47-B821-7FA17050552F] (Simulator)
iPhone 6 Plus (11.2) [2C44FCB0-2414-4010-996A-6D572CC1532F] (Simulator)
iPhone 6s (11.2) [1F752F2B-7BB3-427A-AD75-C84676DF9259] (Simulator)
iPhone 6s Plus (11.2) [505E165D-9138-440F-ADAC-9B2F732C80D8] (Simulator)
iPhone 7 (11.2) [CAC3FBF3-EF6B-4C02-B777-2A8F836D2F24] (Simulator)
iPhone 7 (11.2) + Apple Watch Series 2 - 38mm (4.2) [B2DAA065-EC06-475E-8D7E-C0271048FD5A] (Simulator)
iPhone 7 Plus (11.2) [D1018F94-A83F-4A63-A56F-C8A0EF03288F] (Simulator)
iPhone 7 Plus (11.2) + Apple Watch Series 2 - 42mm (4.2) [865455A6-AB35-4056-AE51-51B3BB0C5995] (Simulator)
iPhone 8 (11.2) [252478EF-74C5-4BB1-BCB3-F6972D37A6A0] (Simulator)
iPhone 8 (11.2) + Apple Watch Series 3 - 38mm (4.2) [52DBED0B-9EF2-4352-A286-FB7C61690191] (Simulator)
iPhone 8 Plus (11.2) [634BF487-28E8-452B-891E-4EA3049DF3D2] (Simulator)
iPhone 8 Plus (11.2) + Apple Watch Series 3 - 42mm (4.2) [BB93A8FE-F1C3-4824-9977-F00AA294FC7F] (Simulator)
iPhone SE (11.2) [4E67039C-57CF-4483-9603-82B890788B0A] (Simulator)
iPhone X (11.2) [3CC4B576-B6C6-48C9-A1F7-7C03EF963BF5] (Simulator)

2.启动模拟器

xcrun instruments -w 'iPhone X'

iPhone X就是模拟器的名称
3.安装app

xcrun simctl install booted /Users/builder/builder/document/other/551/Payload/DYZB.app

xcrun simctl install booted是命令,后面的是需要安装的app路径,先去appstore下载或者自己打包编译的ipa,用归档工具打开,拖动playload文件夹下的程序文件到终端即可,按下enter,即可在模拟器上看到安装的app

4.启动app

xcrun simctl launch booted 'com.tencent.live4iphone'

com.tencent.live4iphone是腾讯视频的Bundle identifier,可通过playload文件夹下程序文件,右键有显示包内容,进入查看info.plist找到;

注:如果app不能运行在模拟器,会一直在启动,这时你可以手动启动,看看是不是一进去就退出,如果是,说明可能app有些库没有支持模拟器的,导致崩溃退出,很正常,一般app上线前会将适配模拟器的库去掉,减少体积。

5.卸载app

xcrun simctl uninstall booted 'com.tencent.live4iphone'

也是通过Bundle identifier来卸载

你可能感兴趣的:(ios模拟器安装app)