OsamaA
OsamaA

Reputation: 481

Appium - error: Could not find a device to launch

Using XCode 7.0.1 official release and Appium: 1.4.8 and getting following error on Launching server with 'Pre-Launch Application' enabled. appium

2015-10-12 13:31:54:198 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

2015-10-12 13:31:55:011 - info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.0.1","iOSSDKVersion":"9.0","deviceName":"iPhone 6","platformVersion":"9.0"}

2015-10-12 13:31:55:012 - error: Could not find a device to launch. You requested 'iPhone (9.0 Simulator)', but the available devices were: ["iPad 2 (9.0) [EC27516C-E5C8-4DC4-B44E-FEB21D05EA7B]","iPad Air (9.0) [640E32F1-9570-48DC-9054-B3903852D228]","iPad Air 2 (9.0) [810119E5-5513-4CEB-BB48-5109BF43718B]","iPad Retina (9.0) [04D458AB-1B8F-471E-9E24-08BBC4FF137C]","iPhone 4s (9.0) [6FDFD1F3-5C6D-4294-980E-3FCFE143C269]","iPhone 5 (9.0) [E6E6B91F-831F-4A48-8F65-2C801806AF0F]","iPhone 5s (9.0) [0BB3C5D0-236C-422E-AE21-CC60DEF535B2]","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 is on 2015-10-12 13:31:55:011 - info: [debug] Final device string is: 'iPhone (9.0 Simulator)'

2015-10-12 13:31:55:014 - error: Failed to start an Appium session, err was: Error: Could not find a device to launch. You requested 'iPhone (9.0 Simulator)', but the available devices were: ["iPad 2 (9.0) [EC27516C-E5C8-4DC4-B44E-FEB21D05EA7B]","iPad Air (9.0) [640E32F1-9570-48DC-9054-B3903852D228]","iPad Air 2 (9.0) [810119E5-5513-4CEB-BB48-5109BF43718B]","iPad Retina (9.0) [04D458AB-1B8F-471E-9E24-08BBC4FF137C]","iPhone 4s (9.0) [6FDFD1F3-5C6D-4294-980E-3FCFE143C269]","iPhone 5 (9.0) [E6E6B91F-831F-4A48-8F65-2C801806AF0F]","iPhone 5s (9.0) [0BB3C5D0-236C-422E-AE21-CC60DEF535B2]","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]"]

Upvotes: 0

Views: 1621

Answers (1)

youxian
youxian

Reputation: 1

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+ ")";
  }

Upvotes: 0

Related Questions