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

标签 java android android-studio intellij-idea 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)

我已经在 .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

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

How to set IntelliJ IDEA Project SDK

最佳答案

我遇到了同样的问题。 Appium 无法找到 ANDROID_HOME 环境变量。 就我而言,此问题背后的原因是我在 Linux 计算机上运行具有 sudo 访问权限的 appium。如果您使用 root 权限运行,请尝试在没有 root 权限的情况下运行。

关于java - 如何在ubuntu 16.04中设置ANDROID_HOME环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46725038/

相关文章:

java - 横向上的 TabLayout 不显示 gravity_fill 和 mode_fixed

java - libgdx -- Gdx.files.internal(); --> 找不到文件

java - Android 应用程序抛出 Guice 异常

java - 在原型(prototype) bean 中使用 Spring singleton-bean。会发生什么?

java - 使用 RadioButtons 实现 TextWatcher

android - 如何获取我的应用程序 APK 的 URL? (Google Play 保护申诉)

android - 即时导入正在添加随机资源和静态 ID

android - 使用 Build Flavors - 正确构建源文件夹和 build.gradle

java - 混淆会影响性能吗?

java - Hibernate 对多个条件的条件限制