xcrun 安装启动模拟器APP

1.首先打开模拟器应用

open "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/"

2.启动你喜欢的模拟器

2.1 打印可用模拟器列表

xcrun simctl list
image.png

2.2 关闭已经打开的设备模拟器

xcrun simctl shutdown booted

2.3 打开IPhone13的设备模拟器

xcrun simctl boot "iPhone 13"

3.安装APP

xcrun simctl install "iPhone 13" "testAPP.app的路径"

4.启动APP

xcrun simctl launch "iPhone 13" "testAPP的包名"

5.build工程项目 生成testAPP.app

clean

xcodebuild clean -workspace APP.xcworkspace -scheme APP -configuration Debug -sdk iphonesimulator15.5

编译

xcodebuild build -workspace APP.xcworkspace -scheme APP -configuration Debug -sdk iphonesimulator15.5

编译成功后可以在Products目录下看到.app文件。
-sdk iphonesimulator15.5是模拟器模式编译,如果不知道你的模拟器sdk版本,可以使用xcodebuild -showsdks查看支持的sdk

结束

其他指令可以xcrun simctl help自行了解

xcrun simctl help
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容