Mac Android Studio Real Machine test configuration

Source: Internet
Author: User

Android Real-computer test on Mac, relative to the iphone or a bit of trouble, the hands-on, write the process, hope to be helpful to the Code friends

Configuration:
Android Studio 3.0

mac:12.6

Mobile: Xiaomi 5x

First Step: Phone settings

1, PC and phone USB connection, if eject, let choose USB for use, then select: File Transfer (MTP)
2, open the phone's developer mode; Click on phone Settings-"More Settings-" developer mode,. If there is no developer mode, then click on the phone: settings-"My Device--" Click on the 7 MIUI version, will show in more settings show developer mode, now many Andorid phones are like this, general
3. After entering the developer option; Open: Developer options, USB debugging, USB installation, other open on your specific needs on the line

Second part; Mac configuration (ADB configuration)

1. First locate the file directory for ADB:

The following section is an online copy, which is a simple generic configuration path

The path in the text box under the SDK location is copied down.

Open the terminal CD to this directory, LS view the files in this directory, and then CD to Platform-tools, ls to view, you can see the adb file. So the ADB directory that needs to be configured is:

/users///android/sdk/platform-tools (add Platform-tools to the previously copied path)

2. Configure the ADB environment variable.

Open the terminal CD to the/home directory with the sudo command to open the Bash_profile file with the code:

sudo vim ~/.bash_profile, need to enter the password (is the computer's boot password)

After entering the password: will be entered into the configuration file, if not previously configured should be blank.

Add the previously found ADB directory (if you do not use VIM please Baidu, simply say vim after opening the file by pressing the keyboard "I" for the Insert command, you can copy the following command):

Export path=${path}:/users///android/sdk/platform-tools: $PATH

Press "ESC" to enter ": Wq" and press ENTER when you are finished adding. (: Wq is the meaning of saving and exiting)

At this point the ADB has been configured successfully. You can see the configured path in the terminal by entering the Echo $PATH.

Then enter the ADB verification in the terminal, if you do not prompt "command not found" instructions have been installed successfully.

3. Modify the Adb_usb.ini file.

Connect your phone to your Mac computer and enter it at Terminal: System_profiler spusbdatatype

Check the phone's information, my is Huawei. Find your phone information to copy the vendor ID.

Then CD to the directory before Android studio/users///android (note only CD to Android directory) to see if there are adb_usb.ini files, if not, create this file and then vendor The ID is added to the Adb_usb.ini file, and the save exits. Restart the Finder (the Apple flag in the upper-left corner of Apple, Force exit->finder-> restart). Restart the terminal, in Terminal input: adb kill-server view the operation. Enter the ADB devices to see if the device is authorized (if the unauthorized is displayed, your phone does not allow USB debugging, select OK to connect), and finally the device description is connected.

3 You can now perform a real-world test on Android studio.

If error: errorrunning QPP no target device found. Choose the Android mointor option and Android Studio automatically recognizes the device.

DDMS: Location Tools--"Android"-"Android Device Monitor"

Mac Android Studio Real Machine test configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.