The reasons for such phenomenon is: Android is not configured environment variables. Therefore, you need to configure the environment variables for the Mac in the Android SDK.
- Start Mac comes with the terminal Terminal.
- Into the current user's home directory.
- At the command line, type echo $ HOME
- Create a .bash_profile file.
- Command line input touch .bash_profile
- Open the .bash_profile file.
- Command line open -e .bash_profile This command-line input is completed, it will automatically pop up .bash_profile file editor window
- Enter the .bash_profile file export PATH = / Users / your user name / file path / platform-tools /: $ PATH
Note:
apart (English colon): If you need to add more paths to the PATH, the need to use "."
Because these commands are android adb and in different folders, the format is:
the PATH = $ {} the PATH: Path 1: Path 2
In addition, if a plurality of paths specified, the end do not write: $ PATH up.
E.g:
export ANDROID_HOME=/Users/*/Library/Android/sdk/
export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin
- save document.
- Directly off .bash_profile file, you can automatically save your input.
- Updating the environment variables you just configured.
- Enter the source .bash_profile in the command line
- Verify that the configuration is successful
- Enter adb, if -bash not appear: adb: command not found; adb emergence of Syntax. It indicates a successful configuration environment variable.
- Then execute the command adb
Remarks:
adb kill-server
adb start-server