xcode UITests检查测试是否在真实设备上运行(xcode UITests check if the test is running on real devices)
Xcode版本8.2(8C38)
有没有办法检测UITests是否在真实设备上运行?
谢谢
Xcode Version 8.2 (8C38)
is there a way to detect if UITests is running on real devices?
Thanks
最满意答案
您可以从ProcessInfo类获取此信息:
if let simulatorName = ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] { print("Running on \(simulatorName) simulator") } else { print("Running on device") }You can get this information from the ProcessInfo class:
if let simulatorName = ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] { print("Running on \(simulatorName) simulator") } else { print("Running on device") }更多推荐
发布评论