Tuesday, November 15, 2011

Developing on the Kindle Fire

We're incredibly excited about all of the new eReader tablets that are being released this fall, like the Kobo Vox, B&N Nook Tablet, and Kindle Fire.

We took delivery of our Kindle Fire here in the office today and of course the first thing I wanted to do was to sideload some of our apps onto it…while we know it runs Android apps, unfortunately I couldn't find any docs at Amazon's site on how to enable USB Debugging via the 'adb' tool.

So, I did a little spelunking. It turns out you just need to add the USB Vendor ID for the device into the file ~/.android/adb_usb.ini and then adb can find it.

Here's the steps, at least on MacOS:

  1. On the Kindle Fire Settings screen, go to "Device" and turn On "Allow Installation of Application From Unknown Sources"
  2. Plug your Kindle Fire into your Mac.
  3. Open ~/.android/adb_usb.ini with your favorite text editor
  4. Add the value "0x1949" to the end of the file and save it.
  5. You'll need to restart the adb server process to get it to re-read that file. Do that with "adb kill-server".
  6. Run "adb devices" and you should see the attached device.

Now, if you've got an .apk you want to throw on there, just do "adb install myfavoriteapp.apk". The app should now be shown on the "Apps" page when you select the "Device" tab (not "cloud").

P.S. Super-nerd note: 0x1949 is the Vendor ID for Lab126, Amazon's Skunkworks that develops all their hardware devices.

13 comments:

  1. For Windows users the file is:
    C:\Users\[YOUR USER NAME]\.android\adb_usb.ini

    ReplyDelete
  2. sorry to be such a dweeb but please be more explict about steps 5 & 6 ie from a terminal in a mac or whatever.

    Thanks

    ReplyDelete
    Replies
    1. Execute those commands from your platform-tools folder in the Android SDK.

      Delete
  3. Hi Hal

    Yes, those are run from the terminal. You'll need to have downloaded the Android developer tools in order to have 'adb' available. They're free on developer.android.com.

    ReplyDelete
  4. This doesn't work on Mac OS 10.7.2
    $ cat ~/.android/adb_usb.ini
    # ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
    # USE 'android update adb' TO GENERATE.
    # 1 USB VENDOR ID PER LINE.
    0×1949
    $ adb devices
    List of devices attached

    $

    ReplyDelete
    Replies
    1. I'm looking for someone to walk me through this step by step. I'm new to android- completely new. I'm on a MacBook, Lion, 10.7.2. Trying to install a No Root Screenshot app (need to debug USB) to my Kindle Fire and keep getting stuck. I have downloaded SDK tools, etc.. and get to the step in Terminal of adb kill-server and the command is not recognized. Usually savvy with computers but not with Terminal and all the code needed.

      Thank you very very very much.

      I just want to be able to take screenshots of someone's order when I make a sale at a jewelry party. Would love to take a screenshot of their order and be able to email it to them, cutting down on paperwork.

      Delete
  5. I'll ask an even dweebier question: How do you do step 3? And could you give me just a teensy bit information about how to install the android sdk for steps 5 and 6? Or tell me how and then I'll write it up (and share it back for others).

    Background: I have never used Android before, so have nothing installed as yet. I just want to take screenshots of the Kindle Fire.

    ReplyDelete
  6. On OS X you don't need to do this, or anything else really, to get it to work.

    The only trick is you have to have the debug bridge turned off then you plug in your Fire.

    Just follow these steps:

    1) Stop the Android Debug Bridge `adb kill-server`
    2) If your Fire is plugged in eject it in Finder and disconnect the USB.
    3) Connect the USB and wait for the Kindle to show up in Finder.
    4) Start the Android Debug Bridge `adb start-server`

    Now you will see your Fire when you run `adb devices`.

    Works like a charm. I'm looking at my own apps I'm debugging from Eclipse right now. The only thing that sucks is Eclipse itself.

    ReplyDelete
  7. On 10.7.2 make sure the x in 0×1949 is capitalized in adb_usb.ini so it should look like 0X1949.

    ReplyDelete
  8. xp doesnt allow file names with dots in them so wtf to do know... over?

    ReplyDelete
  9. I can get the device to show up after restarting the ADB, but it fails to write files to the device.

    --- STARTING ----
    --- WAITING FOR DEVICE
    --- cleaning
    rm failed for *, No such file or directory
    --- pushing zergRush
    4100 KB/s (23056 bytes in 0.005s)
    --- correcting permissions
    --- executing zergRush

    [**] Zerg rush - Android 2.2/2.3 local root
    [**] (C) 2011 Revolutionary. All rights reserved.

    [**] Parts of code from Gingerbreak, (C) 2010-2011 The Android Exploid Crew.

    [+] Found a GingerBread ! 0x00015118
    [*] Scooting ...
    [*] Sending 149 zerglings ...
    [*] Sending 189 zerglings ...
    [-] Hellions with BLUE flames !
    --- WAITING FOR DEVICE TO RECONNECT
    if it gets stuck over here for a long time then try:
    disconnect usb cable and reconnect it
    toggle USB DEBUGGING (first disable it then enable it)
    --- DEVICE FOUND
    --- pushing busybox
    5445 KB/s (1075144 bytes in 0.192s)
    --- correcting permissions
    --- remounting /system
    mount: permission denied (are you root?)
    --- copying busybox to /system/xbin/
    /system/xbin/busybox: cannot open for write: Read-only file system
    --- correcting ownership
    Unable to chmod /system/xbin/busybox: No such file or directory
    --- correcting permissions
    Unable to chmod /system/xbin/busybox: No such file or directory
    --- installing busybox
    /system/xbin/busybox: not found
    --- pushing SU binary
    failed to copy 'su' to '/system/bin/su': Read-only file system
    --- correcting ownership
    Unable to chmod /system/bin/su: No such file or directory
    --- correcting permissions
    Unable to chmod /system/bin/su: No such file or directory
    --- correcting symlinks
    rm failed for /system/xbin/su, Read-only file system
    link failed Read-only file system
    --- pushing Superuser app
    failed to copy 'Superuser.apk' to '/system/app/./Superuser.apk': Read-only file system
    --- cleaning
    --- rebooting
    --- WAITING FOR DEVICE
    5181 KB/s (3104805 bytes in 0.585s)
    Error: Could not access the Package Manager. Is the system running?

    ReplyDelete
  10. >akaSurrealNov 15, 2011 06:15 PM
    >For Windows users the file is:
    >C:\Users\[YOUR USER NAME]\.android\adb_usb.ini

    file not found :(

    ReplyDelete
  11. I am thankful to you that you have done well to place this without hesitation.At the same time unfortunately,I don't have more RAM to upgrade to a 4GB environment.Some time or another,I might want to show signs of improvement system that can deal with no less than 4 GB of memory for a mother-board.When I do get an opportunity to get another Mother-board w/4GB RAM,then I can proceed onward with your innovative kindle Fire programming.Much obliged concerning your input.
    ~~~~~~~~~~~~~~~~~~>>>
    Super Hero-Mobile Game

    ReplyDelete