Android Development using Huawei Phone on Linux

Hiho! So this post will be a little different from the norm. I noticed on the internet that a lot of developers have had problems with testing <their android programs on a Huawei phone. So I thought I would contribute to the collective hive knowledge by explaining how to successfully connect your Huawei mobile phone (in my case the IDEOS) to your linux (in my case xubuntu) machine. Our understanding of the situation is that Huawei is selling the IDEOS (touchscreen, android 2.2, 3.2MP) as a smartphone for developing countries. It was the obvious choice for our pilot study (we are NOT sponsored by Huawei, but are open for offers).


Chris with the Ideos

So why the need for this guide? Well, when I tried to run the program on the phone the android device chooser showed a bunch of questions marks (??????????). This is a guide which will fix this. It is furthermore assumed that you have downloaded eclipse and the android development tools (ADT), but this guide should work even if you are not running eclipse.

$ signifies the terminal prompt. The information which is to be executed in the terminal comes AFTER the $. Make sure the telephone is not mounted, by ejecting it but leaving the cable plugged in to the computer.

Step 1: Can you run adb from the terminal?

This is more of a convenience, since you can stand in the platform-tools directory and run adb using $ ./adb but I will now tell you how to add it to your PATH in your .bashrc file so you can run it from wherever you are. So if you cannot run adb from wherever navigate to your home directory and add the following at the bottom of your .bashrc file. I will here use nano to edit the file directly in the terminal, but you can do it with whatever text editor you choose.

$sudo nano ~/.bashrc

Add the following to the bottom of the .bashrc file. NOTE: Replace ~/dev/android-sdk-linux_x86 with the location of your android sdk location!

export PATH=${PATH}:~/dev/android-sdk-linux_x86/platform-tools"

export PATH=${PATH}:~/dev/android-sdk-linux_x86/tools"

Close it down by pressing Ctrl-x -> y + return.
You should now be able to run the adb command as is. Try it by typing

$adb devices

You should see “list of devices attached” regardless of whether a device is attached or not. If a device is attached and you have a problem it should show a bunch of questionmarks.

Step 2: add the android.rules file
We are now going to help adb out by telling it which type of device it is trying to find. First find what type it is:


You should see something like this Bus 002 Device 011: ID 12d1:1038 Huawei Technologies Co., Ltd.. We are going to be using the ID 12d1 to let adb know it is a Huawei phone.
Since we know that it is a Huawei phone we will create a file in /etc/udev/rules.d/ called 50-android.rules.
Digression: the name of the file is explained in the README file which is in the /etc/udev/rules.d folder. Briefly, higher file name numbers are given precedence. End of digression

$sudo nano /etc/udev/rules.d/50-android.rules

We then add the following line to to the file before we save and close it.

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”12d1″, MODE=”0666″

Notice how the idVendor attribute value is the same as the Device value above (12d1). This is not a coincidence!

Step 3: Restart adb and some other stuff…
After you have saved the file it should work if you restart udev and the adb server.

$sudo restart udev

$sudo adb kill-server

$sudo adb start-server

You can now check if it recognizes the device by executing:

$adb devices

If it is still showing a bunch of question marks, try unplugging and replugging the usb (I had to). If the /etc/udev/rules.d/50-android.rules file is correctly added you should now be able to run your android program on this device.

Hope this helps someone so they don’t have to spend the time i spent figuring this out.


2 responses

  1. Male

    Bra Chris!

    September 5, 2011 at 09:44

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s