Appium iOS 错误 Could not find a device to launch 解决方法

Appium iOS 错误  Could not find a device to launch 解决方法

Appium 点击 Launch 按钮 报错:

error: Could not find a device to launch. You requested 'iPhone 6 (8.1 Simulator) [07F2CEAD-3639-4B25-BEDB-E25927D752FA] (8.1 Simulator)', but the available devices were: ["iPad 2 (7.1 Simulator) [DE208220-ED2F-44B6-BC7B-5471A0DF052E]","iPad 2 (8.1 Simulator) [533E865E-63AF-48C1-999F-2DB4C9202085]","iPad Air (7.1 Simulator) [BE3C2351-AFDC-4CE6-8642-6D6EDE401859]","iPad Air (8.1 Simulator) [9236FD38-9029-48DD-A91D-B63AE925D4A5]","iPad Retina (7.1 Simulator) [A6D3ED06-746D-467A-9CC1-ADC3251F185A]","iPad Retina (8.1 Simulator) [EB2B7995-603E-4F4D-BE75-0B43FE408CE9]","iPhone 4s (7.1 Simulator) [1071E759-3A14-4AA8-B6A6-DF861F29012A]","iPhone 4s (8.1 Simulator) [5FB6CBD8-D7FD-4823-BFB3-2B53522D26EA]","iPhone 5 (7.1 Simulator) [5C5FA830-F43D-4EE8-97D1-578797D9A2A3]","iPhone 5 (8.1 Simulator) [D2C40286-0585-4251-A8A4-85887A588E62]","iPhone 5s (7.1 Simulator) [716A7516-D590-43E3-B0EE-B2393AB159AB]","iPhone 5s (8.1 Simulator) [30AB59DA-3407-4EAC-8D74-3B6D21EF4B6C]","iPhone 6 (8.1 Simulator) [07F2CEAD-3639-4B25-BEDB-E25927D752FA]","iPhone 6 Plus (8.1 Simulator) [125E7974-D61E-4B40-BB25-1C74FDD7B432]"]

根据错误提示
请求的是 iPhone 6 (8.1 Simulator) [07F2CEAD-3639-4B25-BEDB-E25927D752FA] (8.1 Simulator),而实际 是 iPhone 6 (8.1 Simulator) [07F2CEAD-3639-4B25-BEDB-E25927D752FA]

原因是 appium在force device时,多加了个字符串"(8.1 Simulator)",所以报错。

解决的方法
修改  

/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios 目录下ios.js 文件

找到 iosDeviceString += " (" + reqVersion + " Simulator)" 行 改成 iosDeviceString +="";

重新Launch 问题解决。


你可能感兴趣的:(TO,ios,find,appium,自动化测试,device,could,a,Launch,not)