Android studio real machine debugging on Mac system

      My mobile phone is Meizu mx5. Directly connecting the data cable on the mac cannot use Android studio for testing. Need to configure adb to realize the real machine debugging function.

     adb : The Android Debug Bridge (  adb  ) is a development tool that facilitates communication between Android devices and personal computers. Most of this communication takes place over a USB cable, but Wi-Fi connections are also supported. adb  can also be used to communicate with an Android emulator running on a computer. adb  is like a "Swiss Army Knife" for Android development.

 

1. Make sure that adb has been installed, and check whether there is Library/Android/sdk/platform-tools in your user directory.

 

2. In .bash_profile, add it

export PATH=$PATH:/Users/user/Library/Android/sdk/platform-tools
//user is your own username

 

3. Execute the command to check whether the adb configuration is successful.

$ adb version
Android Debug Bridge version 1.0.36
Revision af05c7354fe1-android

 

4. Connect the phone with a data cable, and select the built-in CD as the connection option. After that, the connected usb_driver will appear on the mac computer.

 

5. Execute the command in the terminal, you can find the vendor ID of the device

$ system_profiler SPUSBDataType

USB:

    USB 2.0 Bus:

      Host Controller Driver: AppleUSBEHCIPCI
      PCI Device ID: 0x1e2d
      ..............
      ..............
      ..............
       
      MX5:

          Product ID: 0x0c03
          Vendor ID: 0x2a45
          Version: ff.ff

    The Vendor ID of my Meizu mx5 is 0x2a45

 

6. Find ~/.android/adb_usb.ini and add your own Vendor ID at the end of the file. For example my 0x2a45

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x2a45

 

7. Turn on USB debugging in the developer options of the phone. The developer options of Meizu MX5 are in Settings - Accessibility - Developer Options

 

8. Restart adb, the terminal command is:

$ adb kill-server
$ adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
85GBBM822TJB	unauthorized

 

9. Open Android studio, run a Demo casually, and your own mobile phone option will appear.


 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326491583&siteId=291194637
Recommended