Appium - 错误:无法找到要启动的设备

时间:2015-10-12 13:55:16

标签: ios xcode7 appium

使用XCode 7.0.1官方发行版和Appium:1.4.8并在使用“预启动应用程序”启动服务器时出现以下错误启用。 appium

2015-10-12 13:31:54:198 - info:[debug]仪器位于:/Applications/Xcode.app/Contents/Developer/usr/bin/instruments

2015-10-12 13:31:55:011 - info:[debug]从opts获取设备字符串:{" forceIphone":false," forceIpad":false, " xcodeVersion":" 7.0.1"" iOSSDKVersion":" 9.0"" DEVICENAME":&# 34; iPhone 6"," platformVersion":" 9.0"}

2015-10-12 13:31:55:012 - 错误:找不到要启动的设备。你要求iPhone(9.0模拟器)',但可用的设备是:[" iPad 2(9.0)[EC27516C-E5C8-4DC4-B44E-FEB21D05EA7B]",&# 34; iPad Air(9.0)[640E32F1-9570-48DC-9054-B3903852D228]"," iPad Air 2(9.0)[810119E5-5513-4CEB-BB48-5109BF43718B]",& #34; iPad Retina(9.0)[04D458AB-1B8F-471E-9E24-08BBC4FF137C]"," iPhone 4s(9.0)[6FDFD1F3-5C6D-4294-980E-3FCFE143C269]",& #34; iPhone 5(9.0)[E6E6B91F-831F-4A48-8F65-2C801806AF0F]"," iPhone 5s(9.0)[0BB3C5D0-236C-422E-AE21-CC60DEF535B2]",& #34; iPhone 6(9.0)[1F54D699-8136-4F4D-8E34-16B6CCA808E4]"," iPhone 6(9.0)+ Apple Watch - 38mm(2.0)[4AB9ED13-DE8B-49BF-9DB9- EC8B8284C2FF]"," iPhone 6 Plus(9.0)[96C00635-F3C3-4ED9-A158-683F2FC75E3B]"," iPhone 6 Plus(9.0)+ Apple Watch - 42mm(2.0 )[F69E6D85-4560-41B7-8B81-1791481FE91E]"," iPhone 6s(9.0)[23A3892C-1CE9-4879-B850-4FBB33959846]"," iPhone 6s Plus( 9.0)[00E59495-DB31-4F1F-AE94-5354A794F7CB]"]

2015-10-12 13:31:55:011 - info:[debug] fixDevice已启用 2015-10-12 13:31:55:011 - info:[debug]最终设备字符串是:' iPhone(9.0模拟器)'

2015-10-12 13:31:55:014 - 错误:无法启动Appium会话,错误是:错误:无法找到要启动的设备。你要求iPhone(9.0模拟器)',但可用的设备是:[" iPad 2(9.0)[EC27516C-E5C8-4DC4-B44E-FEB21D05EA7B]",&# 34; iPad Air(9.0)[640E32F1-9570-48DC-9054-B3903852D228]"," iPad Air 2(9.0)[810119E5-5513-4CEB-BB48-5109BF43718B]",& #34; iPad Retina(9.0)[04D458AB-1B8F-471E-9E24-08BBC4FF137C]"," iPhone 4s(9.0)[6FDFD1F3-5C6D-4294-980E-3FCFE143C269]",& #34; iPhone 5(9.0)[E6E6B91F-831F-4A48-8F65-2C801806AF0F]"," iPhone 5s(9.0)[0BB3C5D0-236C-422E-AE21-CC60DEF535B2]",& #34; iPhone 6(9.0)[1F54D699-8136-4F4D-8E34-16B6CCA808E4]"," iPhone 6(9.0)+ Apple Watch - 38mm(2.0)[4AB9ED13-DE8B-49BF-9DB9- EC8B8284C2FF]"," iPhone 6 Plus(9.0)[96C00635-F3C3-4ED9-A158-683F2FC75E3B]"," iPhone 6 Plus(9.0)+ Apple Watch - 42mm(2.0 )[F69E6D85-4560-41B7-8B81-1791481FE91E]"," iPhone 6s(9.0)[23A3892C-1CE9-4879-B850-4FBB33959846]"," iPhone 6s Plus( 9.0)[00E59495-DB31-4F1F-AE94-5354A794F7CB]"]

1 个答案:

答案 0 :(得分:0)

Because Appium1.4.13 doesn't deal with xcode7.You requested iPhone (9.0 Simulator), but iPhone 6 (9.0) [1F54D699-8136-4F4D-8E34-16B6CCA808E4] is available. You should modify ios.js in:

/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios This is the way I have modified.

else if (opts.xcodeVersion[0] === '5') {
    iosDeviceString += isRetina ? " Retina" : "";
    if (isiPhone) {
      if (isRetina && isTall) {
        iosDeviceString += is64bit ? " (4-inch 64-bit)" : " (4-inch)";
      } else if (deviceName.toLowerCase().indexOf("3.5") !== -1) {
        iosDeviceString += " (3.5-inch)";
      }
    } else {
      iosDeviceString += is64bit ? " (64-bit)" : "";
    }
  } 

  else if (opts.xcodeVersion[0] === '6') {
    iosDeviceString = opts.deviceName ||
      (isiPhone ? "iPhone Simulator" : "iPad Simulator");
  }

  else if (opts.xcodeVersion[0] === '7') {
    iosDeviceString = opts.deviceName ||
      (isiPhone ? "iPhone Simulator" : "iPad Simulator");
  }




  var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
  if (9>opts.iOSSDKVersion >= 8) {
    iosDeviceString += " (" + reqVersion + " Simulator)";
  } 
  else if (8>opts.iOSSDKVersion >= 7.1) {
    iosDeviceString += " - Simulator - iOS " + reqVersion;
  }
  else if(opts.iOSSDKVersion>=9){
    iosDeviceString += " (" + reqVersion+ ")";
  }