Reputation: 91
long time reader first time poster.
I am attempting to set up Appium on Mac OS 10.9.5. I have set my ANDROID_HOME in .profile set to the following:
export ANDROID_HOME=/Users/jfish/Documents/android-sdk-macosx
When attempt to start Appium I receive the following error:
error: Failed to start an Appium session, err was: Error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
But I have the correct file path specified. Do I need to add build-tools to my $PATH? At the moment I only have platform-tools and tools specified there.
I have tried copying and pasting aapt into the tools folder as was suggested this question but to no avail.
Thank you for your time, and if this was answered elsewhere I am sorry for repeating the question. I was not able to find a satisfactory answer on Google nor on here.
Upvotes: 3
Views: 6332
Reputation: 1
I also meet this problem. And I solve this problem by start appium by command.
FYI, the command to start appium is:
/Applications/Appium.app/Contents/MacOS/Appium
Upvotes: 0
Reputation: 11
After running into a similar error, I wanted to add a few details to the solution. If you know you have all correct path variables, this might help.
I ended up running Appium from the command line so I could confirm what it thought my environment variables were. The documentation says that it checks ~/.bashrc, ~/.bash_profile, and ~/.zshrc for your paths, and I had my paths in bashrc and could echo those from inside the automation project correctly. However, running echo $PATH from the terminal environment I was running Appium in showed only what I had in my bash_profile! To solve this I added
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
(source: Here under "Recommendation")to my bash_profile to make sure it also had access to the paths in bashrc, confirmed with echo, and restarted the server, and it then ran correctly.
(Running mac and working with Python 3 if that helps)
Upvotes: 1
Reputation: 91
The answer was "add build-tools and platform-tools to the PATH". Apparently you need both. Hope this helps someone.
Upvotes: 0