How to set ANDROID_HOME path in ubuntu?
I would like to share an answer that also demonstrates approach using the Android SDK provided by the Ubuntu repository:
Install Android SDK
sudo apt-get install android-sdk
Export environmental variables
export ANDROID_HOME="/usr/lib/android-sdk/"export PATH="${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platform-tools/"
Assuming you have the sdk extracted at ~/Android/Sdk
,
export ANDROID_HOME=$HOME/Android/Sdkexport PATH=$PATH:$ANDROID_HOME/toolsexport PATH=$PATH:$ANDROID_HOME/platform-tools
Add the above lines to the file
~/.bashrc
(located athome/username/.bashrc
) to make it permanent for the current user. Runsource ~/.bashrc
to apply the changes or restart your terminal.(or)
Run the above lines on a terminal window to make it available for the session.
To test if you have set it up correctly,
Run the below commands on a terminal window
echo $ANDROID_HOME
user@host:~$ echo $ANDROID_HOME/home/<user>/Android/Sdk
which android
user@host:~$ which android/home/<user>/Android/Sdk/tools/android
Run
android
on a terminal window, If it opens up Android SDK Manager, you are good to go.