当前位置:   article > 正文

iOS模拟器命令xcrun simctl系列_xcrun 指定模拟器版本

xcrun 指定模拟器版本
  1. 列出安装的可用的模拟器: xcrun instruments -s
    【如:iPhone 5s (9.0) [00AB3BB6-C5DC-45C7-804F-6B88F57C2AFF] (Simulator)】

  2. 查看已安装的模拟器: 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】

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

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

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

  6. 关掉模拟器: xcrun simctl shutdown udid
    关掉所有打开的模拟器: xcrun simctl shutdown all

  7. 重置模拟器(清除模拟器的数据和设置)xcrun simctl erase udid

  8. 安装指定app: xcrun simctl install booted <app路径>
    多设备时:xcrun simctl install <app路径>

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

  10. 运行指定的app: xcrun simctl launch booted
    多设备时:xcrun simctl launch

  11. 关闭已经打开的应用: xcrun simctl terminate booted
    多设备时:xcrun simctl terminate

  12. 卸载指定应用: xcrun simctl uninstall booted
    多设备时:xcrun simctl uninstall

  13. 截图:xcrun simctl io booted screenshot screenshot.png
    会发现在当前目录下会多了一张照片

多设备时: xcrun simctl io screenshot screenshot.png

  1. 录屏:xcrun simctl io booted recordVideo example.mp4
    多设备时:xcrun simctl io recordVideo example.mp4

  2. 日志: tail -f
    日志文件的路径:
    /Users/ U s e r N a m e / L i b r a r y / L o g s / C o r e S i m u l a t o r / UserName/Library/Logs/CoreSimulator/ UserName/Library/Logs/CoreSimulator/simulator_hash/system.log

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/312609
推荐阅读
相关标签
  

闽ICP备14008679号