A, problem,

Starting with macOS Catalina Beta, ZSH (Z Shell) is the default shell for all new user accounts. The previous version had been bash. In this version of macOS, the environment variables we configured in.bash_profile may not be used, causing the following problems: ➜ ~ ADB Devices

zsh: command not found: adb

Second, the analysis

To configure ADB we need to add commands to.bash_profile

 export PATH=${PATH}: / Users/your own user name/Library/Android/SDK/platform - the toolsCopy the code

First, we will open the system hidden file in Finder by shortcut “Shift + Command +.” and find the.bash_profile file as shown in the problem

Adb environment variables have been configured, but are still unavailable. Then we use disk full path to see if the Unix executable is valid

3. From here, we can check whether the environment variable is wrong and ADB is ok. Here we use the source command to reactivate the.bash_profile file. Then execute the ADB command again, as shown

source ~/.bash_profile
Copy the code

But there is a catch. The same problem occurs when we exit the terminal and open the application again

Third, solve

We know that using ZSH as the default terminal, the.zshrc file is loaded by default when the terminal is started. Then we can consider putting the source command in this configuration file.

Conclusion: We use the shortcut key “Shift + Command +.” to open the hidden system file and find the. ZSHRC file as shown in the picture

After adding the source ~/. Bash_profile command, restart the terminal application