Android real machine testing (in Linux)

Source: Internet
Author: User
Test todayProgramRun a problem on the virtual machine, so the real machine is used for testing, but it is found that it is not recognized under Ubuntu .. The call./ADB devices is shown as follows .. The result cannot be tested on a real machine.

List of devices attached
Emulator-5554 Device
???????????? No Permissions

Google Xiaomi real machine test fruitless, Google Ubuntu Android real machine test found the clue (http://www.linuxidc.com/Linux/2011-04/34131.htm), but wondered again, he listed the deviceCodeIf there is no Xiaomi mobile phone, continue to Google, and there is no result. Then you can find a solution and list the solution first:

First, run the command lsusb without connecting your phone to your computer. The result is as follows:

Alfredtofu @ alfredtofu-LAPTOP :~ /MyApp/Eclipse/android-sdk-linux_x86/platform-tools $ lsusbbus 002 device 002: Id 8087: 0024 bus 002 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root hubbus 001 device 009: id 093a: 2510 pixart imaging, Inc. hama optical mousebus 001 device 004: Id 058f: B002 Alcor micro Corp. bus 001 device 002: Id 8087: 0024 bus 001 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub

Connect your mobile phone to your computer and run lsusb again. The result is as follows:

 
Alfredtofu @ alfredtofu-LAPTOP:/$ lsusbbus 002 device 005: Id 18d1: 9025 bus 002 device 002: Id 8087: 0024 bus 002 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root hubbus 001 device 009: Id 093a: 2510 pixart imaging, Inc. hama optical mousebus 001 device 004: Id 058f: B002 Alcor micro Corp. bus 001 device 002: Id 8087: 0024 bus 001 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub

Compared with the reference website, we found that 18d1 is the device ID, and the problem is easily solved.

Sudo Vim/etc/udev/rules. d/51-android.rules

Add the following content:

Ubsystem = "USB", sysfs {idvendor} = "18d1", mode = "0666"

For the above commands, you only need to change sysfs {idvendor} = "18d1" to 18d1 in different mobile phones. As for how to find this code, we have introduced it above.

Sudo chmod A + R/etc/udev/rules. d/51-android.rules

Sudo/etc/init. d/udev restart

Sudo./ADB kill-Server

Sudo./ADB Devices

The final result is as follows:

 
* Daemon not running. Starting it now on port 5037 ** daemon started successfully * List of devices attached emulator-5554device00c49bd2device

So we can use a real machine for testing.

Related Article

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.