Samsung Galaxy with Android SDK on Ubuntu

When new Ubuntu Karmic came out I decided to install it from scratch instead of upgrading from Jaunty. Id didn’t take much time to migrate all my data and necessary software. However Android SDK made me some troubles as I forgot all the tricks I had to do to make it working and since I had to follow the same path again I decided to write it down in case me or anyone alse need it again.
Let’s start from the beginning:

  • download Linux version of SDK from developer.android.com
  • unpack it to a folder of your choice
  • launch android program from android-sdk-linux_86/toolssubdirectory; make sure you’re using Sun Java virtual machine, if not then I suggest to:
    • install Sun JDK if you don’t have one yet:

      sudo apt-get install java-6-sun

    • setup command line environment and run android tool:

      export JAVA_HOME=/usr/lib/jvm/java-6-sun
      export PATH=$JAVA_HOME/jre/bin:$PATH
      <SDK>/tools/android

  • you may need to select Force https://… sources to be fetched using http://…” option on the Settings page in case of errors when downloading packages list or packages
  • on the Available Packages page select and install packages you need
  • because of the bug in adb affecting Samsung Galaxy users, replace <SDK>/tools/adb program with patched one
  • create /etc/udev/rules.d/51-samsung-galaxy.rules file with the following content:

    SUBSYSTEM==”usb”, SYSFS{idVendor}==”04e8″, MODE=”0666″

  • reload udev rules:

    sudo /etc/init.d/udev reload

After all that you should be able to connect to your Samsung Galaxy with adb:

~/dev/android-sdk-linux_86/tools$ ./adb devices
List of devices attached
I7500fIf0cVtIYi device

or with ddms (Dalvik Debug Monitor, it also may not work with non-Sun Java) :

Related posts:

8 Comments

  1. Thanks for share, please keep us posting about this info. I’d like to read it more.

  2. Antoine Polatouche says:

    Thanks for the trick!

    Seems there is a typo
    > create /etc/udev/rules.d/51-samsung-galaxy.rule file with the following content:

    the file should be 51-samsung-galaxy.rules (ending with a ‘s’) ?

  3. Micha?? Jonik says:

    Of course there was a typo. I just fixed it.
    Thanks Antoine!

  4. Andrei says:

    hello, I have Ubuntu 10.10 and Samsung Galaxy S with Froyo. I folowed the instructions listed above and the
    adb devices command prints this

    List of devices attached
    ???????????? no permissions

    Does the phone need to have an unlocked SIM? I cannot insert a SIM from another carrier.

  5. Micha?? Jonik says:

    Sounds like a permission issue on your OS level (ubuntu). Try to run adb or fastboot as root (with sudo).

  6. Brad says:

    Hey thanks for the great writeup.

    I have been running Android and Ubuntu since 2008 and have always been able to find my answers online and thanks to your article I am ALMOST there with my Galaxy S.

    I have used 4 HTC phones and got ADB working great with all of them. WIth my GS, after replacing ADB with the one you have provided, I now get this for ADB Devices:

    brad@whitewale:~$ adb devices
    List of devices attached
    1000aa76e6b6 device

    But when I type adb reboot recovery, it just shows the adb help dialog.

    If I attach my Nexus One, again it will identify, but it will not boot into recovery. If I replace the ADB with the old ADB file, it will find and reboot the N1 but it will not find the GS at all.

    Thoughts? Help?
    Thanks

  7. HyoGi Sim says:

    Exactly what I need.
    I’ll test it on my gentoo box and post the result.

    Thanks.

Leave a Reply