First step: Configure the environment variables for the ADB command for Mac computers, divided into 2 small steps
1. Find the SDK that Android Studio installed for you:
To open the software for Android Studio Tools in your computer, in the interface of the software that launches Android studio, click the "Configure" option in the list below. In the click on the "Project defaults" option in the list. Finally click on the options for project structure.
The path to the SDK is then in the Android SDK location of the popup interface.
2. Configure the environment variables for ADB
2.1 Enter the command in the terminal, enter the user directory
$ cd ~
2.2 Enter the command to create the. bash_profile file (if one is not created)
$ touch. Bash_profile
2.3 Enter a command to open the file you just created
2.4 In the file, add 2 lines of instruction (where the library is the SDK path behind the repository, and change it yourself according to the path in step 1th)
Export path=${path}:~/library/android/sdk/platform-toolsexport PATH=${path}:~/library/android/sdk/tools
2.5 Save the. bash_profile File and exit
2.6 Test adb, open terminal, enter command, show "Android Debug Bridge version 1.0.39" For configuration success
$ adb version
The second step is to create and modify the Adb_usb.ini file, which is also divided into 2 small steps.
1. Open terminal, enter command, view device information
$ System_profiler Spusbdatatype
1.2 get their corresponding device information, where the information in the vendor ID, need to be retained, etc under use
samsung_android:product ID:0x6753Vendor ID:0x05e4(Samsung Electronics Co., Ltd.) Version:6.00Serial number:7d0076027c174055 speed:up to420MB/sec Manufacturer:samsung Location ID:0x13200000/TenCurrent Available (MA): -Current Required (MA): theExtra Operating Current (MA):0
2. Create, modify the Adb_usb.ini file, you can enter the command at the terminal, you can also find files
2.1 Find Adb_usb.ini files
2.1.1 Input command
VI ~/.android/adb_usb.ini
2.1.2 Finding files
2.2 After you enter the vendor ID of the device in Adb_usb.ini, save and exit
2.3 Restart Finder
Step three: In Terminal input command, close and restart ADB
$ adbkill-server$ adbstart-server
Fourth step: Turn on the USB debugging feature in the developer options on your phone
Fifth step: Create a project in Android studio to run to the phone
Mac computer uses Android studio for real-machine debugging