Could not find aapt with appium server

我怕爱的太早我们不能终老 提交于 2019-12-01 13:12:29

问题


I am currently trying to run a test on an android emulator device with appium, everything goes fine, appium unlocks the screen of the device but then I have this error:

[ADB] Error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path

I set the ANDROID_HOME varaibale im my bash file to :

export ANDROID_HOME=/home/tar/android/android-sdk-linux/ 

and I also set the other variables to :

export ANDROID_SDK_HOME=/home/tar/android/android-sdk-linux

export PATH=${PATH}:/home/tar/android/android-sdk-linux/platform-tools

export PATH=${PATH}:/home/tar/android/android-sdk-linux/tools 

But I am still facing the same error,

does someone have an idea how to solve this please?

Thank you


回答1:


First make sure that you've got the SDK installed correctly and that your path in ANDROID_HOME points to the folder containing the /bin folder.

Then try running:

source ~/.bashrc

or log-in and log-out to apply the new changes in the bash file.

You could also reuse your ANDROID_HOME variable:

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools

This way you don't have to change all the variables if the location of the SDK changes.




回答2:


For Windows:

  1. Open My Computer Properties
  2. Click on 'Advanced System Setting'
  3. Click on 'Environment Variables..'
  4. Create Variable for User and System both
  5. Restart the IDE.!

Please look the image below:




回答3:


sudo nano ~/bash_profile and add:

export ANDROID_HOME=/home/tar/android/android-sdk-linux/

export ANDROID_SDK_HOME=/home/tar/android/android-sdk-linux

export PATH=${PATH}:/home/tar/android/android-sdk-linux/platform-tools

export PATH=${PATH}:/home/tar/android/android-sdk-linux/tools



来源:https://stackoverflow.com/questions/37433718/could-not-find-aapt-with-appium-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!