This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 7
Mar 2018

HI,

I am setting up appium for executing tests on Android devices on a mac machine. I am also using serenity for reporting. When I start running the test I am getting the following error

Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: packageAndLaunchActivityFromManifest failed. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path. (WARNING: The server did not provide any stacktrace information)

I tried printing the ANDROID_HOME variable from intellij and it is reflecting correctly. Please help

  • created

    Mar '18
  • last reply

    Jul '18
  • 6

    replies

  • 3.4k

    views

  • 4

    users

  • 3

    likes

Hi @PoornimaSuraj,
Trye this:

  1. Open the terminal and type :

export ANDROID_HOME=/Applications/ADT/sdk

  1. Add this to the PATH environment variable

export PATH=$PATH:$ANDROID_HOME/bin

  1. After this, verify the settings by running:

appium-doctor

Hope this works

Hey @PoornimaSuraj

It will work Whatever @sachin925 says .If you still face the issue copy below thing in bash_profile

1.Open The Terminal
2.Type below command
nano ~/.bash_profile

then one window will open add the path as per ur system directory

export ANDROID_HOME=/Users/xxx/Library/Android/sdk
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platforms-tools
export PATH=${PATH}:${ANDROID_HOME}/build-tools/27.0.1
export PATH=${PATH}:${JAVA_HOME}

Once copied save the file by pressing command+x .

Hope this will resolve issue permanently

3 months later
11 days later

@Reem_Nasser : In windows 10 u have to set the environment variables of ANDROID_HOME and JAVA_HOME…

In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Reopen Command prompt window, and run your java code.