Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell. You can make zsh the default in earlier versions of macOS as well.
So on your Mac:
1 – Open your .zshrc file:
open ~/.zshrc
2 – if .zshrc file doesn’t exist, you need to create one & open again(Step 1)
touch ~/.zshrc
3 – Add this to your .zshrc file
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_HOME=$ANDROID_SDK_ROOT
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
4 – Save and close
5 – Compile your changes
source ~/.zshrc
& make sure to restart your terminal.
参考:Setup React-Native for iOS and Android on Mac with VS Code – InTheTechPit