Skip to main content

Chinese Android Debugging: How to use a Unbranded Android Device for Application Testing on Ubuntu with Eclipse

developer.android.com has a nice writeup on how to setup a hardware android device for application testing on the Using Hardware Devices page. It also gives a list of USB Vendor IDs, which are required to setup your hardware device. But the list of vendors may not include your Chinese / Unbranded android phone or tablet.

For eg. The vendor ID of a NATPC/MID tablet is apparently not on the list of vendor ids which includes the likes of HTC, Asus, Google,Foxconn, etc.

In such a case, these are the errors you may get:

On selecting Run app in Eclipse, you are greeted with a prompt asking you to select an Android Device. However the list of Android devices shows a Android Device with Serial Number as "??????????" i.e a series of question marks and same for the state of the device. Additionally, this device is not selectable.

Eclipse: Prompt showing unrecognised android device

 Open Terminal and cd into your android-sdk/platform-tools folder and run adb (Android Debug Bridge)
android-sdk/platform-tools$ ./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
????????????    no permissions


This is because the Vendor ID is not recognised by adb. Which is because we could not specify a Vendor ID, as the same is not available to us.


Here are the steps to setup your Unbranded Android device for application testing.

1. USB Debugging: Go to the settings on your android device and turn on USB debugging.

2. Connect your android device via USB.

3. Open a terminal and run lsusb

$lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 18d1:0003 Google Inc. 


In the case of the Chinese device that I used, this was what lsusb returned. The last line of the above result shows a device labelled Google Inc. The Vendor ID is (see bold) 18d1

lsusb gives you a list of USB buses and the devices attached to your computer via USB.

Apparently, the Chinese device I used, makes itself appear as a device by Google Inc and uses the same Google Vendor ID. Your device may have a different Vendor & Vendor ID , but using lsusb you can easily access the same.

4. With root privileges, create a xx-android.rules file at /etc/udev/rules.d where xx is a number.

 for eg. I created a file called 51-android.rules with the following content

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" 


(Instructions given in Using Hardware Devices)

The device id in this case is in bold (18d1) and is all that you have to change.


The /etc/udev/rules.d/ folder contains custom rules that are read by udev.
If it is the only rules file you create for your android devices, the name of the rules file will not matter. The number is used for order of preference. (More info:  udev , the README file in the /etc/udev/rules.d/ folder)


5. Reboot

Now when you run ./adb devices from terminal you will get the serial number and Vendor of your device.

cd into your android-sdk/platform-tools folder and run ./adb devices

android-sdk/platform-tools/$ ./adb devices
List of devices attached
12345678    device


Eclipse will also recognize the device and you can select your device to test run your android application.

tl;dr:

If you do not know the Vendor ID of your android device, which is needed for the 51-android.rules file and your device vendor is not on the Vendor ID list on the Android Developers website, run lsusb from Terminal to get a list of devices with vendor ids attached via usb and use this id in your rules file.

Sources & Further Reading:
1. Android Developer: Using Hardware Devices
2. lsusb
3. udev
  

Comments

  1. Great article. A lot of people have this problem with no practical solutions out there like you provided.

    ReplyDelete

Post a Comment

Popular posts from this blog

CPU Temperature Guide for Intel Core 2 Duo : Range of Normal CPU Temperatures

Is your CPU Temperature too High? How high is high enough? Is 60 degree Celsius high enough or is 70 degree Celsius the threshold? Hipatic covers your temperature problems right here. Below we discuss Intel Core 2 Duo.
If your CPU is overheating, visit our CPU Overheating Guide and CPU Overheating: Symptoms, Causes, & Solutions

To measure CPU Temperatures you may need Real Temp

Intel Core 2 Duo:
(If you wish to access the PDF related to your processor, please first follow the link given under sources at the end of the article instead of directly accessing the pdf link given under each sub heading. This will help you access the latest information on your processor from Intel's website & will also prevent hotlinking.)

1. Intel® Core™2 Duo Processor E8000 Series
Intel ® Core™2 Duo Processor E8600, E8500, E8400, E8300, E8200, E8190 Thermal Profile
Range: 45.1 degree Celsius (Power - 0W) to 72.4 degree Celsius (Power 65W)
Source:http://download.intel.com/design/processor/datashts/3187…

CPU Overheating: Symptoms, Causes and Solutions

The most hit pages on this blog are the CPU Temperature Guides, so here is a comprehensive(work in progress) guide to everything(almost) related to CPU Overheating.

Symptoms of a Overheating CPU :

1. Random Crashes:
Your system may switch off or restart automatically while you are using it. And this may happen repeatedly. If the overheating problem is not severe enough, then your PC may only crash when you are running many CPU intensive applications or running a CPU intensive game. If your CPU temperature is very high, then the system may restart as it is booting up ending into a endless and dangerous loop.

2.Sluggish System:
An overheating CPU underperforms, result being a sluggish computing experience. The system may experience random lock-ups too.

Differential Diagnosis:
A PC may also crash due to RAM, Motherboard, Hard Disk & Power Supply Unit issues.

Causes of CPU Overheating:

1. Improper CPU + Heatsink installation:
If your system is new and you have overheating issues, or if you…

CPU Temperature Guide for Intel Pentium 4: Range of Normal CPU Temperatures

Is your CPU Temperature too High? How high is high? Is 60 degree Celsius high enough or is 70 degree Celsius the threshold? Hipatic covers your temperature problems right here. Below we discuss Intel Pentium 4.

Pentium 4 Processors:
Temperatures Specified are Maximum Processor Case Temperatures(Tc). For details refer the sources given.
For 65 nm Process in the 775-land LGA Package supporting Hyper-Threading Technology and Intel® 64 architecture

Thermal Profile for 775_VR_CONFIG_05A ProcessorsRange 44.3 degree (at Power - 0W) Celsius to 69.2 degree Celsius (at Power - 86W)
Source: http://www.intel.com/Assets/PDF/datasheet/310308.pdf Page:77 Table:28

Thermal Profile for 775_VR_CONFIG_06 Processors
Range 43.6 degree (at Power - 0W) Celsius to 64.1 degree Celsius (at Power - 64W)
Source: http://www.intel.com/Assets/PDF/datasheet/310308.pdf Page:78 Table:29


For 90 nm Process in the 775-land LGA Package supporting Intel® Extended Memory 64 Technology & Supporting Intel® Virtualization Tech…