2017-10-13 68 views
3

我同時用appium如何設置ANDROID_HOME環境變量在Ubuntu 16.04

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)

我已經設置了ANDROID_HOME在我的.bashrc已經

運行Java移動自動化測試用例面臨着這樣的錯誤
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

+0

在你的'$ ANDROID_HOME'中嘗試命令'find -name aapt',你會發現它在'build-tools/ /'中。 –

+0

嘿@LymZoy它是這樣的回報./build-tools/26.0.2/aapt。該怎麼做? –

+0

將'/ 26.0.2'附加到'$ PATH'變量中的'$ ANDROID_HOME/build-tools'。 –

回答

0

我得到同樣的問題。 Appium無法找到ANDROID_HOME env變量。 在我的情況下,這個問題背後的原因是我在我的linux機器上運行ipod sudo訪問。如果您使用root權限運行,請嘗試在沒有它的情況下運行。