很多时候我们可以从开发那里拿到.app
基本上都是用appium去自动安装的,最近我拿到的新版本的app在自己的mac上用appium安装,结果安装好以后,打开应用就奔溃。
网上搜索了下,好像是开发给的版本有问题。(好像需要用不带证书的app才可以在模拟器上安装)
不过在公司的mac的模拟器上打算安装下看看是不是因为开发给的版本的问题。
但是公司里appium还不可以使用,于是打算在模拟器上直接安装app看看是否会奔溃。
在终端输入xcrun simctl install booted xxx.app路径
,点击回车。注意,xxx.app路径为你需要安装到模拟器中的app的路径,获取方法直接将其拖入终端即可。这里有个小技巧,可先复制 xcrun simctl install booted
粘贴到终端,然后再将xxx.app拖入到终端,两者之间以空格隔开。
异常问题
1、xcrun simctl install booted /path/xxx.app
2、xcrun: error: unable to find utility “simctl”, not a developer tool or in PATH`
xcrun simctl install booted /path/xxx.app
3、xcrun: error: active developer path (“/Volumes/Xcode/Xcode.app/Contents/Developer”) does not exist, usexcode-select –switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see
man xcode-select)
No devices are booted`
这些问题将会导致安装不成功,如果没有安装上可执行下面的操作。
解决方案
steps 1:获取Xcode路径。获取Xcode路径只需到应用程序中找到Xcode,然后将其拖入到终端即可获取到Xcode的路径。
steps 2:在终端中继续输入 sudo xcode-select -switch Xcode路径/Contents/Developer
即可。
Tips
比如我的Xcode路径为:
/Applications/Xcode.app
。那么我在终端中则会输入为:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer