@penguinho @rusuo @tarunsujit @sebv
Still this issue is noticed with the appium 1.3.3 and 1.3.6 and 1.4.3 … while starting appium server through java code the below error log is displayed .
Using MAC MACHINE osx yosemite
Appium start server code
public static void startAppiumServer() throws ExecuteException,
IOException, InterruptedException {
CommandLine command = new CommandLine(
“/usr/local/bin/node”);
command.addArgument(
“/usr/local/lib/node_modules/appium/bin/appium.js”,
false);
command.addArgument("–address", false);
command.addArgument(“127.0.0.1”);
command.addArgument("–port", false);
command.addArgument(“4723”);
command.addArgument("–no-reset", false);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
executor.execute(command, resultHandler);
Thread.sleep(5000);
System.out.println(“Appium server started”);
}
Error Log :
[TestNG] Running:
/private/var/folders/gd/c4rghf9d5zv8phtq6zbf99t40000gp/T/testng-eclipse–418167106/testng-customsuite.xml
Appium server stop
Appium server started
[36minfo[39m: Welcome to Appium v1.4.3 (REV a357c7fa73222315dd85c3d2dd8334767cca1b0d)
[36minfo[39m: Appium REST http interface listener started on 127.0.0.1:4723
[36minfo[39m: [debug] Non-default server args: {“address”:“127.0.0.1”,“noReset”:true}
[36minfo[39m: Console LogLevel: debug
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
[36minfo[39m: [37m–>[39m [37mPOST[39m [37m/wd/hub/session[39m [90m{“desiredCapabilities”:{“platformVersion”:“5.0.1”,“platformName”:“Android”,“deviceName”:“HTC One_M8”,“browserName”:“Android”,“appActivity”:“com.digby.lptester.activity.DetailsActivity”,“uuid”:“SH43WWM15617”,“appPackage”:“com.digby.lptester”}}[39m
[36minfo[39m: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
[36minfo[39m: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : uuid
[36minfo[39m: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
[36minfo[39m: [debug] Creating new appium session e408a90a-d0a9-42e9-9b68-7f7c3659607d
[36minfo[39m: Starting android appium
[36minfo[39m: [debug] Getting Java version
[36minfo[39m: Java version is: 1.8.0_25
[36minfo[39m: [debug] Checking whether adb is present
[33mwarn[39m: 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.
[36minfo[39m: [debug] executing cmd: which adb
[36minfo[39m: [debug] Cleaning up android objects
[36minfo[39m: [debug] Cleaning up appium session
[31merror[39m: Failed to start an Appium session, err was: Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
[36minfo[39m: [debug] Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at [object Object]. (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:12)
at ChildProcess.exithandler (child_process.js:758:5)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Socket. (child_process.js:1183:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:485:12)
[36minfo[39m: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.)”,“origValue”:“Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.”},“sessionId”:null}
[36minfo[39m: [37m<-- POST /wd/hub/session [39m[31m500[39m[90m 874.709 ms - 342[39m [90m[39m
Please help me out for the above error since from one week back i am facing this issue with android platform.