我能說我想在電腦的模擬器上看新聞了嗎。。。哇哈哈哈
如果自己用命令行打包的應(yīng)該對xcodebuild和xcrun 這兩個不陌生,我們今天就用xcrun,可以理解為它就是把xcodebuild打包的.app簽名啊什么的打包成我們用的.ipa包。
Step1.查看基本命令:
xcrun instruments -help
輸出信息:usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
可以看出 -w就是我們需要的,先啟動模擬器,當(dāng)然你也可以自己啟動。
Step2.運行模擬器:
xcrun instruments -w 'iPhone SE'
輸出信息:Waiting for device to boot...
Instruments Usage Error: No template (-t) specified
instruments, version 8.3.3 (62125)
這個-t 還不知道傳入什么參數(shù)。。。
Step3.安裝App到模擬器中
xcrun simctl install booted [...? .app的路徑]
PS.卸載模擬器中App
xcrun simctl uninstall booted [... bundle identifier]