如何在ubuntu 16.04中设置ANDROID_HOME环境变量

时间:2021-10-08 23:07:55

I am facing this error while running the java mobile automation test case with appium

我在使用appium运行java移动自动化测试用例时遇到此错误

mvn -Dtest=SavedPhotosTest  test -DFILEPATH="sample.apk"

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)

处理命令时发生未知的服务器端错误。原始错误:packageAndLaunchActivityFromManifest失败。原始错误:无法找到aapt请使用Android SDK根目录路径设置ANDROID_HOME环境变量。 (警告:服务器未提供任何堆栈跟踪信息)

I've set the ANDROID_HOME in my .bashrc already

我已经在我的.bashrc中设置了ANDROID_HOME

export ANDROID_HOME=/home/user/Android/Sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools

appium is also running on the another terminal

appium也在另一个终端上运行

Configurations:

IntelliJ IDE --> ideaIC-2017.2.4 Android-studio --> android-studio-ide-162.4069837-linux appium --> 1.7.1

IntelliJ IDE - > ideaIC-2017.2.4 Android-studio - > android-studio-ide-162.4069837-linux appium - > 1.7.1

I've already tried the following links:

我已经尝试过以下链接:

https://discuss.appium.io/t/error-could-not-find-aapt/671/5 Could not find aapt with appium server

https://discuss.appium.io/t/error-could-not-find-aapt/671/5无法找到appium服务器

https://discuss.appium.io/t/error-could-not-find-aapt/671

How to set IntelliJ IDEA Project SDK

如何设置IntelliJ IDEA Project SDK

1 个解决方案

#1


0  

I was getting same issue. Appium was not able to locate ANDROID_HOME env variable. In my case reason behind this issue was I was running appium with sudo access on my linux machine. If you are running with root privilege, try running without it.

我遇到了同样的问题。 Appium无法找到ANDROID_HOME env变量。在我的情况下,这个问题背后的原因是我在我的linux机器上使用sudo访问运行appium。如果您使用root权限运行,请尝试在没有root权限的情况下运行。

#1


0  

I was getting same issue. Appium was not able to locate ANDROID_HOME env variable. In my case reason behind this issue was I was running appium with sudo access on my linux machine. If you are running with root privilege, try running without it.

我遇到了同样的问题。 Appium无法找到ANDROID_HOME env变量。在我的情况下,这个问题背后的原因是我在我的linux机器上使用sudo访问运行appium。如果您使用root权限运行,请尝试在没有root权限的情况下运行。