I’ve been trying to get the Appium server to run programmatically and was successful with iOS projects but am having some difficulty with Android. I am running a native app on Android and the project specs are below:
- Appium 1.3.7
- Eclipse IDE (Luna)
- Java bindings
When I launch the server I immediately get the error that it cannot find adb. When I run the doctor diagnostics, it finds adb just fine. ANDORID_HOME is set to the proper sdk folder and a direct line to adb is also included in my PATH. One thing to note is that I have both Eclipse and Android Studio installed on my machine. The Android SDK is coming from the Android Studio install, but I am running my project out of Eclipse at the moment and pointing to the sdk installed from Android Studio. Curious if anyone may have a suggestion outside of migrating projects to Android Studio (that is my last resort). Code snippet to launch Appium is below (this code does successfully start an iOS project).
CommandLine command = new CommandLine("/usr/local/bin/node");
command.addArgument("/usr/local/bin/appium", false);
command.addArgument("–address", false);
command.addArgument(“127.0.0.1”);
command.addArgument("–port", false);
command.addArgument(“4723”);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
Executor executor = new DefaultExecutor();
executor.setExitValue(1);
executor.execute(command, resultHandler);
Error raised:
Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.