如何知道iOS模拟器何时启动到主屏幕? | 您所在的位置:网站首页 › xcode打开模拟器 › 如何知道iOS模拟器何时启动到主屏幕? |
我过去经常open -n /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/ --args -CurrentDeviceUDID xxxxx与其他任何一个模拟器一起启动一个模拟器,并且可以轮询xcrun simctl list | grep xxxxx以找出启动它的启动过程的时间。 如何确定模拟器已完成启动过程并在其主屏幕上处于空闲状态? 目前,我正在轮询~/Library/Logs/iOS Simulator/{version}/system.log直到安静几秒钟,但这有点la脚。 有更好的东西xcrun simctl getenv吗? 1> Jeremy Huddl..: 您可以轮询com.apple.springboard.services mach服务进行签入。例如: ~ $ simctl spawn booted launchctl print system | grep com.apple.springboard.services 0x1c407 M D com.apple.springboard.services ... ~ $ simctl spawn booted launchctl print system | grep com.apple.springboard.services 0x1c407 M A com.apple.springboard.services编辑:使用最新的版本,您还可以运行xcrun simctl bootstatus 以监视此进度。这些天可能比轮询launchctl更优雅的解决方案。 编辑(再次):除了使用'xcrun simctl bootstatus'监视进度之外,如果尚未启动,您可以使用它启动启动。检查xcrun simctl help bootstatus更多信息。 |
CopyRight 2018-2019 实验室设备网 版权所有 |