Sunday, November 1, 2009

Setting up Android SDK on Ubuntu for the Samsung Galaxy

On my quest to get the Samsung Galaxy a new "ROM" to fix the issues mentioned in my last post, i installed the GalaxyHero ROM which is a custom (or "cooked") ROM.
The GalaxyHero does offer solutions to many of the issues i mentioned with the original Galaxy firmware and even the IIE update.
As usual when dealing with new devices, firmware updates of this nature,are a good way to "brick" your device so i took my time Googling, reading and taking notes of the actions required for the update, which among other things give you root access to the phone.

The first problem i encountered after downloading and installing the Android SDK and the Eclipse plugin on my 64bit Ubuntu desktop is that the phone was not recognized by the SDK.
Typing in the SDK tools dir

adb devices

came up with an empty list.

After a bit more search here is what you need to do to get your Samsung Galaxy to connect with adb on Ubuntu and allow debugging on the phone.

On the phone, in Settings/Applications/Development, check the box "USB debugging".

Then add a new udev rule for the phone
Create a file using your favorite text editor in /etc/udev/rules.d/11-android.rules
and add the following line

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04e8", MODE="0666"

Please note that the USB vendor ID is not the same for Samsung and other Android phones (aka HTC) and most of the documentation i found refers to HTC's id.

Then type this:

sudo chmod a+rx /etc/udev/rules.d/11-android.rules
sudo /etc/init.d/udev restart
./adb kill-server

The above will make the phone "recognizable" by Ubuntu,but still if you try connect with adb it does not work.
The problem is that the adb shipped with the Android SDK up to this writting (Nov 1st 2009) does not work with the Galaxy.

To overcome this you need a patched version of adb
More details and the source to build the adb yourself can be found in the German Galaxy forum

cd to your Android SDK tools dir

rename the original adb

mv adb orig-adb

download,unzip and make executable the patched adb

gunzip adb.gz
chmod +x adb

then start the adb server

./adb start-server

see if the phone is recognized

./adb devices
List of devices attached
I7500c0xVS8PQ4H device

Next i will post a few simple steps to get the GalaxyHero ROM installed even without the adb