Sunday, December 5, 2010

Developing with Android Devices on Linux, the complete solution!

To summarise some previous posts regarding the process for getting Android adb to see your device in Linux (Mint/Ubuntu) and tie the whole lot up in a nice convenient script:

1 - create /etc/udev/rules.d/51-android.rules and add
  SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
    This assumes you're using an HTC phone. For more vendor IDs, see here

2 - execute
  sudo udevadm control --reload-rules
     to load the new android rule

3 - create restart_adb.sh and add the following:
  #!/bin/bash
  # android_device_reset script
  sudo /usr/bin/android/android-sdk-linux_86/tools/adb kill-server
  sudo service udev stop
  sudo /usr/bin/android/android-sdk-linux_86/tools/adb start-server
  sudo /usr/bin/android/android-sdk-linux_86/tools/adb devices
  eclipse

    Change your SDK path accordingly. 'eclipse' starts eclipse(!) so is of course optional.

4 - make your script executable:
  chmod 744 restart_adb.sh

5 - Bob's your uncle. Double-click your script to start eclipse and run your app/tests on a device rather than the emulator

An extra step for 64bit environments is:
  apt-get install ia32-libs


Thanks to Marc Cooper (@auxbuss) for help with the script

No comments:

Post a Comment