1.模拟器上录制视频
xcrun simctl io booted recordVideo --type=mp4 <PATH TO VIDEO FILE>
例如:
xcrun simctl io booted recordVideo --type=mp4 ~/desktop/test.mp4
booted - 表示simctl选择当前启动的模拟器。如果您有多个启动的模拟器,simctl会选择当前活动的实例。
2.模拟器上打开URL
xcrun simctl openurl booted <URL>
3.快速查找APP的沙盒目录
xcrun simctl get_app_container booted <APPS BUNDLE ID>
或者,您可以使用以下open命令在Finder中打开目标文件夹,从而使其更快:
open `xcrun simctl get_app_container booted <APPS BUNDLE ID>` -a Finder
4.使用命令行参数在模拟器中启动APP
xcrun simctl launch --console booted <BUNDLE ID> <YOUR ARGUMENTS>
5.使用Bundle ID获取完整的APP信息
xcrun simctl appinfo booted <BUNDLE ID>
更多Xcode 9模拟器技巧 iOS Simulator on Steroids: Tips & Tricks in Xcode 9
网友评论