我在使用 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)
我已经在 .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 也在另一个终端上运行
配置:
IntelliJ IDE --> ideaIC-2017.2.4 Android-studio --> android-studio-ide-162.4069837-linux appium --> 1.7.1
我已经尝试过以下链接:
https://discuss.appium.io/t/error-could-not-find-aapt/671/5 Could not find aapt with appium server
最佳答案
我遇到了同样的问题。 Appium 无法找到 ANDROID_HOME 环境变量。 就我而言,此问题背后的原因是我在 Linux 计算机上运行具有 sudo 访问权限的 appium。如果您使用 root 权限运行,请尝试在没有 root 权限的情况下运行。
关于java - 如何在ubuntu 16.04中设置ANDROID_HOME环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46725038/