如何解决在为 ios 启动 appium 时找不到启动设备的问题?

How to resolve the couldn't find a device to launch issue, while launching the appium for ios?

  1. 我使用的是 1.3.6 appium 版本。当我单击启动按钮时,出现以下问题。

信息:[调试] 清理了仪器套接字 /tmp/instruments_sock 信息:[调试]设置Xcode文件夹

信息:[调试]设置Xcode版本

信息:[调试]设置iOSSDK版本

信息:[调试] 从 xcrun 获取 sdk 版本超时

信息:[调试] iOS SDK 版本设置为 8.1

info: [debug] 检查仪器是否支持我们的设备字符串

信息:[调试] 获取仪器支持的设备列表

信息:[调试] 仪器位于:/Applications/Xcode.app/Contents/Developer/usr/bin/instruments

信息:[调试] 从选项获取设备字符串:

{"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone 5s (E5723F7E-05AC-4858-9C9F-495C1FA3A00B)","platformVersion":"7.1"}

信息:[调试] fixDevice 已打开 信息:[调试] 最终设备字符串为:'iPhone 5s (E5723F7E-05AC-4858-9C9F-495C1FA3A00B) (7.1 Simulator)'

信息:[调试] 清理 appium 会话

error: Could not find a device to launch. You requested 'iPhone 5s (E5723F7E-05AC-4858-9C9F-495C1FA3A00B) (7.1 Simulator)', but the available devices were: ["iPad 2 (8.1 Simulator) [3DD93343-67D4-4EAD-92AA-C005B7933E6D]","iPad Air (8.1 Simulator) [77400AA8-80E0-4ECB-ADCD-08DF3767B57E]","iPad Retina (8.1 Simulator) [A6C0CF5A-255B-4029-AE95-569DA7B29B90]","iPhone 4s (8.1 Simulator) [9CA88BC6-E3ED-44CA-89D8-05487C88A944]","iPhone 5 (8.1 Simulator) [C68E6A43-DBE7-4D85-9CE5-BB87B9915BB0]","iPhone 5s (8.1 Simulator) [E5723F7E-05AC-4858-9C9F-495C1FA3A00B]","iPhone 6 (8.1 Simulator) [4391D23F-BA21-4FB8-8887-0972D2911420]","iPhone 6 Plus (8.1 Simulator) [71B23D13-3F3F-4828-910A-2FAEEABD1C1A]"]

错误:无法预启动 appium:错误:找不到要启动的设备。

You requested 'iPhone 5s (E5723F7E-05AC-4858-9C9F-495C1FA3A00B) (7.1 Simulator)', but the available devices were: ["iPad 2 (8.1 Simulator) [3DD93343-67D4-4EAD-92AA-C005B7933E6D]","iPad Air (8.1 Simulator) [77400AA8-80E0-4ECB-ADCD-08DF3767B57E]","iPad Retina (8.1 Simulator) [A6C0CF5A-255B-4029-AE95-569DA7B29B90]","iPhone 4s (8.1 Simulator) [9CA88BC6-E3ED-44CA-89D8-05487C88A944]","iPhone 5 (8.1 Simulator) [C68E6A43-DBE7-4D85-9CE5-BB87B9915BB0]","iPhone 5s (8.1 Simulator) [E5723F7E-05AC-4858-9C9F-495C1FA3A00B]","iPhone 6 (8.1 Simulator) [4391D23F-BA21-4FB8-8887-0972D2911420]","iPhone 6 Plus (8.1 Simulator) [71B23D13-3F3F-4828-910A-2FAEEABD1C1A]"]

尝试断开并重新连接设备。这在我身上发生了很多次,但只需断开连接并重新连接即可。

尝试使用设备描述 -

(iPhone 5s (8.1 Simulator)) 

或 udid -

(E5723F7E-05AC-4858-9C9F-495C1FA3A00B) 

不是两者。

此外,还有一件事: 根据日志,它说 -

You requested 'iPhone 5s (E5723F7E-05AC-4858-9C9F-495C1FA3A00B) (7.1 Simulator)'

但根据与设备 ID 匹配的日志显示的可用设备:

[E5723F7E-05AC-4858-9C9F-495C1FA3A00B] 

在 v8.1 上而不是 v7.1 -

"iPhone 5s (8.1 Simulator) [E5723F7E-05AC-4858-9C9F-495C1FA3A00B]"

所以在 运行 之前也应该仔细检查 platformVersion。

供参考 - http://www.openradar.me/radar?id=5758355129761792

根据日志,我想您正试图在模拟器上启动该应用程序。启动失败的原因是你请求了一个 7.1 的模拟器,因为你似乎没有这些你需要进入 Xcode 首选项-> 下载并下载旧的 iOS 模拟人生。另外作为提示,对于模拟器,您不需要将 UDID 添加为名称的一部分。尝试仅将 UDID 用于物理设备。