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


alexcohn said...

Thanks for bringing all this info in a nice package.

In the long run, it's nice to have adb server running under user authority, but the first connection can be tried before going into the udev changes. You can simply run sudo full-path/adb devices to see that the binary works with the device.

tmb_ayebe said...

Thanks for the info but it didn't work for me. After following the instructions
adb devices
still brings up an empty list.

I am running Ubuntu 9.10 with a Samsung Galaxy GT-I5700. I think this is a slightly different model from your 7500.

Can you help me? I really don't want to go back to windows to develop on this phone.

Stelios S. Koroneos said...

@alexcohn : yep, you are right, that would be a much quicker way to test that the binaty would work with the phone.

@tmb_ayebe : I am not sure adb supports the GT-i5700

//Ales said...

@tmb_ayebe: for me works, but udev rule for ubuntu 9.10 have to be:
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666

Ecommerce Web Developers said...

Now a days most of the peoples are likes android, because its interesting to use and different from others, so i think it will easily to reach the market place and to increase the business revenues for most of android companies.

Android app developer