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
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
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
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
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
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
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