I am new in developing native app using Salesforce SDK. I tried to create android project from command line using forcedroid tool but there is problem in setting environment
source ~/.bash_profile
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
Here are the steps:
To verify if Path is set successfully open terminal again and type adb if adb version and other details are displayed that means path is set properly.
The only solution worked for me was @Tiago Gouvêa answer, after adding it android and emulator commands worked fine, but sdkmanager command was not working so I have added one extra line to his solution:
nano ~/.bash_profile
Add lines:
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
If some one is still finding difficulties, i have made a video on this
https://www.youtube.com/watch?v=tbLAHKhjjI4
Because the new version of Apple does not support bash shell so i have explained in details how do we set variables in 2020.
Open Terminal
nano ~/.bash_profile
export ANDROID_HOME=/Users/qss/Library/Android/sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
Control+S to save
Control+X to exit
Y to save changes
Update changes in terminal
source ~/.bash_profile
Validate Path:
echo $PATH
Confirm if all okay:
adb devices