码迷,mamicode.com
首页 > 移动开发 > 详细

iOS模拟器命令(自动化测试)

时间:2018-11-08 18:16:33      阅读:974      评论:0      收藏:0      [点我收藏+]

标签:scree   卸载   11.2   min   1.2   record   typeid   重置   bbb   

1. 列出安装的可用的模拟器: xcrun instruments -s

【如:iPhone 5s (9.0) [00AB3BB6-C5DC-45C7-804F-6B88F57C2AFF] (Simulator)】

1. 查看已安装的模拟器: ios-sim showdevicetypes

【如:iPhone-6s, 11.1
iPhone-6s, 10.0
iPhone-6s, 9.0
iPhone-6s, 11.2
iPhone-6s, 10.1
iPhone-6s, 9.2】

1. 查看已安装的模拟器: xcrun simctl list

【如:
-- iOS 11.3 --
iPhone 5s (9ABF3B1A-4A86-4BAC-BBB2-5D63CC30F0DE) (Shutdown)】
查看启动的模拟器: xcrun simctl list | grep Booted

2. 开启上面列表中指定的模拟器: xcrun instruments -w "iPhone 8(11.2)"

2. 开启指定的模拟器: xcrun simctl boot udid

3. 关掉模拟器: xcrun simctl shutdown udid

4. 重置模拟器:xcrun simctl erase udid

5. 安装指定app: xcrun simctl install booted <app路径>

5. 安装指定app: ios-sim launch /Users/nali/Desktop/ting.app --devicetypeid iPhone-X, 11.2

6. 运行指定的app: xcrun simctl launch booted <bundle identifier>

7. 关闭已经打开的应用: xcrun simctl terminate booted <bundle identifer>

8. 卸载指定应用: xcrun simctl uninstall booted <bundle identifer>

9. 截图:xcrun simctl io booted screenshot screenshot.png

会发现在当前目录下会多了一张照片

10. 录屏:xcrun simctl io booted recordVideo example.mp4

11. 日志: tail -f <filename>

日志文件的路径:
/Users/$UserName/Library/Logs/CoreSimulator/$simulator_hash/system.log
 

iOS模拟器命令(自动化测试)

标签:scree   卸载   11.2   min   1.2   record   typeid   重置   bbb   

原文地址:https://www.cnblogs.com/xiyuan2016/p/9929782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!