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
Open the terminal and type :
export ANDROID_HOME=/Applications/ADT/sdk
Add this to the PATH environment variable
export PATH=$PATH:$ANDROID_HOME/platform-tools
If the terminal doesn't locate the added path(s) from the .bash_profile, please run this command
source ~/.bash_profile
Hope it works to you!
If you are setting up the ANDROID_HOME environment on MacOS Catalina , .bash_profile is no longer apple's default shell and it won't persist your path variables. Use .zprofile instead and follow the environment setup instructions in react-native documentation or others. .bash_profile will keep creating new file which won't make the path permanent or persist on closing the terminal on your system path.
Modified as it's providing answer to the frustration of setting up android_home environment on MacOS.
Based on Abraham Mayowa Oluwasina answer provided above is the correct one. MacOS Catalina, .bash_profile is no longer apple's default shell and it won't persist your path variables instead use .zprofile instead.
In root directory,
touch .zprofile
open -e .zprofile
Add the following in file,
export ANDROID_HOME=/Users/<username>/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
Save and exit
To activate
source ~/. zprofile
echo $ANDROID_HOME
As a noob I was struggling a lot with setting up the variable.I was creating copies of .bash_profile files, the text in file was not saving etc ..
MacOS
add this string in file ~/.bashrc or ~/.zshrc
export ANDROID_HOME="/Users/<userlogin>/Library/Android/sdk"
try with this after add ANDROID_HOME on your Environment Variable, work well on my mac
flutter config --android-sdk ANDROID_HOME