- Start the Mac comes with terminal terminal.
- Enter the home directory of the current user.
- Enter Echo $HOME on the command line
- Create a. bash_profile file.
- Command line Input touch. Bash_profile
- Open a. bash_profile file.
- Command line Input open-e. Bash_profile After this command line is entered, the. bash_profile file's edit window is automatically ejected
- Enter export path=/users/Your user name/file path in the. bash_profile file/platform-tools/: $PATH
Note: If you need to add more than one path to the path, you need to separate the words ":" (a colon in English). Because Android and adb these commands are in different folders, the format is:Path=${path}: Path 1: Path 2, plus, If you specify more than one path, you do not have to write at the end: $PATH. For example:
Export Path=${path} :/users/shanechen/documents/android-sdk-macosx/platform-tools :/users/shanechen/documents/android-sdk-macosx/tools
- Save the file.
- Simply close the. bash_profile file to automatically save what you have entered.
- Update the environment variables you just configured
- On the command line, enter source. Bash_profile
Verify that the configuration is successful
Enter adbif-bash:adb:command not found is present, and the ADB command parameter is interpreted. Indicates that the environment variable is configured successfully.
[Mac Environment]adb command not found