Friday, September 23, 2011

Getting Ubuntu to play nice with your Android phone

Doing Android app testing on virtual devices isn't really that bad but it aint the good either. It's always much, much better to test that app on a real device.

But Ubuntu (and possible the other *nixs) doesn't recognize your Android phone. You instead get something like this:

$ adb devices
List of devices attached
???????????? no permissions

Unfortunately this is easily fixed. All you have to do is to create a file in the /etc/udev/rules.d directory which contains one (1) line.
Now, what that line is depends on what your phone is. You can figure that one out by using this command:

$ lsusb

And if you haven't connected your phone via the USB before your typed in the command then pat yourself in the back because your are just as brain dead as the rest of the world.
lsusb output
At any rate, you'll notice that my phone is on Bus 002 and the Vendor ID is "0489" and the Product ID is "c000". Remember these values.

Now, lets make the file:
$ sudo gedit /etc/udev/rules.d/51-android.rules
And then, type in the following line: 
SUBSYSTEM=="usb",ATTRS{idVendor}=="0489",ATTRS{idProduct}=="c000",MODE="0666" 
All that's left then is to restart udev. Some devices will require you to disconnect and reconnect them to be recognized.
$ sudo restart udev
To check if your phone is now recognized.
$ adb devices

Monday, September 19, 2011

Rooting your CM Magnum again

Ok, so you had to update your CM Magnum to Gingerbread via the official Cherry Mobile ROM. This will basically "unroot" your already rooted phone and bring it to 2.3.4 or something. I know its been months since then but I have been doing stuff. I do have a life.

But that still brings us back to the issue at hand, how do I root my Magnum, Ideos X6, etc. again? OK, I can answer that but remember,

I. Will. Laugh. At. You(twice as hard). If. You. Blame. Me. If. You. Brick. Your. Phone.

 So, as far as I know, these don't work:
How do I know? Duh, I tried them of course.
The only one that I have verified that works is tj_styles CWM recovery procedure. Najmods has posted the procedure here.

But if you are too lazy to open a new tab (sheesh...) then here is the procedure:

AWRRR! Walk the Plank, Android!
First step: Replace original recovery with ClockWorkmod Recovery
1. Download ClockWorkMod Recovery
2. Put the device in download mode (Power+Vol Up) and connect to PC,
and the PC will recognize the device as Removable Disc/Storage open it and you will find FIH > Image folder and select recovery.img, copy it anywhere to your PC as backup just in case if anything go wrong
3. Replace recovery.img in 'image' folder with recovery.img inside the Clockworkmod Recovery v4.0.0.9 you download and extracted earlier
4. Disconnect device from PC, open up the battery and reboot.

Second step (DO FIRST STEP FIRST): Rooting the phone
1. Download Su 2.3.6.3 signed.zip and put it in sdcard (but don't put it in any folder)
2. Put the device in recovery mode (Power+Vol Up & Vol Down)
3. Select "install zip from sdcard" and select "Choose zip from sdcard" and search for 'Su 2.3.6.3 signed.zip' and click install.
4. Select "back" and click "reboot system now"

Now to install busybox and do something really stupid/cool like put a perl/ruby/whatever interpreter in my phone. Why install a perl/ruby/whatever interpreter in my phone, you ask? Because I can.

What is your excuse?