您的位置:首页 > 移动开发 > IOS开发

【卡片记忆】快速启动iOS模拟器

2016-03-09 14:26 726 查看
###假定场景

我想快速访问模拟器,
我不想用xcode重复运行,安装app
我想把ipa包直接分发出去,让别人快速通过命令行安装

问题得到了解决,go-swift.net

###查看模拟器的日志目录

cd ~/Library/Logs/gym

cd ~/Library/Logs/DiagnosticReports/

###模拟器目录

print("💡 Simulator directory is : \(NSTemporaryDirectory())")

~/Library/Developer/CoreSimulator/Devices/<模拟器设备id>/data/Containers/Containers/Data/Application/<应用id>/tmp

###解决方案

//获取帮助
xcrun simctl help

//查看当前设备的模拟器列表
xcrun simctl list

//安装到模拟器

xcrun simctl install booted xxx.app

//启动模拟器
xcrun instruments -w "iPhone 6 (8.3 Simulator)"

//启动某一应用
xcrun simctl install "iPhone 6" com.cn.goswift //com.cn.goswift是bundle id

//卸载应用

xcrun simctl uninstall "iPhone 6" com.cn.goswift //com.cn.goswift是bundle id

启动apple watch
xcrun simctl launch "iPhone 6" com.goswift.watchkitapp

//使用模拟器代开网页 不用手动输入

xcrun simctl openurl booted http://www.go-swift.net 
//录制模拟器视频
xcrun simctl io booted recordVideo <filename>.<extension>

//模拟器截屏
xcrun simctl io booted screenshot

引用链接:点击

###获取帮助

创新源于一种感觉! http://go-swift.net

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息