I am trying to start the Appium server programmatically as follows:
AppiumDriverLocalService service = AppiumDriverLocalService.buildDefaultService();
service.start();
Seems that the service is starting
Then I try to initiate the android driver as follows:
driver = new AndroidDriver(service.getUrl(),capabilities);
Now The execution is failing with the below =log.
Any idea what am I missing?
ENV:
Appium 1.6.1
mac osx 10.12.1
java-client 4.1.1
Eclipse
[TestNG] Running:
/Users/sgmacbookpro/Appium/Projects/SG_Android_Appium/src/resources/Testng.xml
[Appium] Welcome to Appium v1.6.1 (REV ee51200036dac07568da29b8aa88c0335ea6a514)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.6.1â,ârevisionâ:âee51200036dac07568da29b8aa88c0335ea6a514â}}
[HTTP] <-- GET /wd/hub/status 200 26 ms - 121
[HTTP] --> POST /wd/hub/session {âdesiredCapabilitiesâ:{âappâ:"/Users/sgmacbookpro/Appium/Android/SkyGiraffe.apk",ânewCommandTimeoutâ:1200,âappiumVersionâ:â1.6.1â,âplatformVersionâ:â5.0â,âbrowserNameâ:âandroidâ,âplatformNameâ:âAndroidâ,âversionâ:"",âdeviceNameâ:âSamsungâ,âplatformâ:âANDROIDâ}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{âappâ:"/Users/sgmacbookpro/Appium/Android/SkyGiraffe.apk",ânewCommandTimeoutâ:1200,âappiumVersionâ:â1.6.1â,âplatformVersionâ:â5.0â,âbrowserNameâ:âandroidâ,âplatformNameâ:âAndroidâ,âversionâ:"",âdeviceNameâ:âSamsungâ,âplatformâ:âANDROIDâ},null,null,null,null]
[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] app: â/Users/sgmacbookpro/Appium/Android/SkyGiraffe.apkâ
[Appium] newCommandTimeout: 1200
[Appium] appiumVersion: â1.6.1â
[Appium] platformVersion: â5.0â
[Appium] browserName: âandroidâ
[Appium] platformName: âAndroidâ
[Appium] version: ââ
[Appium] deviceName: âSamsungâ
[Appium] platform: âANDROIDâ
[debug] [AndroidDriver] AndroidDriver version: 1.10.35
[BaseDriver] The following capabilities were provided, but are not recognized by appium: appiumVersion, version, platform.
[AndroidDriver] The desired capabilities should generally not include both an app and a browser
[BaseDriver] Session created with session id: 23b3342f-fc2b-49a1-8fd4-3e0793371cde
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_40
[ADB] Checking whether adb is present
[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
[ADB] Error: Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (lib/tools/system-calls.js:85:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (lib/tools/system-calls.js:85:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasnât active
[MJSONWP] Encountered internal error running command: Error: Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (lib/tools/system-calls.js:85:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 281 ms - 246