+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to Install Apps using ADB

  1. #1
    Join Date
    Oct 2008
    Posts
    5

    Default How to Install Apps using ADB


    Developing on Device Hardware

    If you have an Android device, you can develop and debug your Android applications just as usual. Launching your apps on a device works just the same as on the emulator, but there are a few things to do before you can start.
    1. Declare your application as "debuggable" in your Android Manifest. In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml file, add android:debuggable="true" to the <application> element.
    2. Turn on "USB Debugging" on your device. On the T-Mobile G1, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.
    3. Setup your system to detect your device.
      • If you're developing on Windows (32-bit only), you need to install the USB driver for adb:
        1. Download the driver ZIP file (android_usb_windows.zip) and unzip it.
        2. Connect your Android device via USB. When the Found New Hardware Wizard appears, you'll be asked if you'd like Windows Update to search for software, select No, not this time and click Next.
        3. Select Install from a list or specified location and click Next.
        4. Select Search for the best driver in these locations. Browse and select the unzipped file.
        5. Click Finish. You're all set.
      • If you're developing on Mac OS X, it just works. Skip this step.
      • If you're developing on Ubuntu Linux, you need to add a rules file:
        1. Login as root and create this file: /etc/udev/rules.d/50-android.rules. For Gusty/Hardy, edit the file to read:
          SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
          For Dapper, edit the file to read:
          SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
        2. Now execute:
          chmod a+rx /etc/udev/rules.d/50-android.rules
    You can verify that your device is connected by executing adb devices from your SDK tools/ directory. If connected, you'll see the device name listed as a "device."
    If using Eclipse, select run or debug as usual. If you have an emulator running, then you will be presented with a Device Chooser dialog that lists the emulator(s) running and the connected device(s). Otherwise, the device will be used by default, instead of launching a new emulator.
    If using the Android Debug Bridge (adb), you can issue commands with the -d flag to target your connected device.

    Installing an Application after your connected

    You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the install command. With the command, you must specify the path to the .apk file that you want to install:
    adb install <path_to_apk>For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt).
    Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you.


    Source: Google =)

  2. #2
    Join Date
    Sep 2008
    Posts
    32

    Default Re: How to Install Apps using ADB

    Hey will this work with a N810 running a hack install of Android? Is it possible to get my programs to work on N810?

  3. #3
    Join Date
    Oct 2008
    Posts
    25

    Default Re: How to Install Apps using ADB

    Note the usb drivers does not include Windows 64-bit yet, however they said they are working on them (over at the Android Groups).

  4. #4
    Join Date
    Sep 2008
    Posts
    32

    Default Re: How to Install Apps using ADB

    I wonder if my N810 that runs android has the "enable debugging" feature and if I can get my .apk files to run on a N810 that runs the hacked Android?

    Please if anyone knows if this is possible I would be most most appreciative.

  5. #5
    Join Date
    May 2009
    Posts
    2

    Default Re: How to Install Apps using ADB

    I hope someone out there can help me. I just bought my G1 yesterday and I'm very excited about developing on Android. I did the simple Hello World app in Eclipse and tested it in the emulator ...all good.

    So then I followed the steps listed above exactly for Ubuntu adding udev rules as prescribed for the Gutsy/Hardy Ubuntu release (suspecting those are the most recent) even though I have the very latest Jaunty release of Ubuntu.

    Anyway, so I connect my phone with the USB cable. The phone notices and links up. I can mount my SD card in it as a drive and access it from my desktop so that all works...

    I'm all smiles until I issue the "adb devices" command and all I see is my emulator.

    /usr/bin/eclipse/android/v1.5/tools$ adb devices
    List of devices attached
    emulator-5554 device

    I've unplugged the phone and plugged it back in several times ...no new adb devices show up.

    I've tried a few other suggestions I've found on other sites:
    - I've restarted the udev daemon like so: sudo /etc/init.d/udev restart
    - I've listed the connected usb devices with "lsusb" and my phone shows up as:
    Bus 002 Device 009: ID 0bb4:0c02 High Tech Computer Corp.
    - Reset adb from the Devices view inside Eclipse.
    Then all I get in the console are these errors:
    [2009-05-19 00:44:03 - DeviceMonitor]Adb connection Error:EOF
    [2009-05-19 00:44:03 - DeviceMonitor]Connection attempts: 1

    I see the directions you've listed above are the same official directions listed here: http://developer.android.com/guide/d...tml#setting-up

    Please someone tell me the Jaunty version of Ubuntu is why I'm having problems I don't want to have to go back to an earlier version of Ubuntu. Surely someone knows how I'd add appropriate rules for a Jaunty version of Ubuntu? It appears the only difference between the Dapper rules and the Gutsy/Hardy rules is the name of the subsystem and as far as I can tell this 'usb' subsystem name hasn't changed in Jaunty.

    Thanks,
    Justin

  6. #6
    Join Date
    Nov 2008
    Location
    Houston (Friendswood), TX
    Posts
    242

    Default Re: How to Install Apps using ADB

    There are Vista 64bit drivers now. I've got them working at the house.
    Steve
    Bronze G1
    Virtudude's Rogers/HTC Cupcake

  7. #7
    Join Date
    Sep 2008
    Location
    The Boonies of Pinal County, Arizona
    Posts
    1,187

    Default Re: How to Install Apps using ADB

    If you're not using an ADP1, I think you need to set "USB Debugging" on the G1 (it's in the Settings).
    I blame
    To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts.
    for most programming problems.

  8. #8
    Join Date
    Feb 2009
    Location
    Capistrano Park, Texas
    Posts
    3

    Lightbulb Re: How to Install Apps using ADB

    Quote Originally Posted by jisnut View Post
    I hope someone out there can help me. I just bought my G1 yesterday and I'm very excited about developing on Android. I did the simple Hello World app in Eclipse and tested it in the emulator ...all good.

    So then I followed the steps listed above exactly for Ubuntu adding udev rules as prescribed for the Gutsy/Hardy Ubuntu release (suspecting those are the most recent) even though I have the very latest Jaunty release of Ubuntu.

    Anyway, so I connect my phone with the USB cable. The phone notices and links up. I can mount my SD card in it as a drive and access it from my desktop so that all works...

    I'm all smiles until I issue the "adb devices" command and all I see is my emulator.

    /usr/bin/eclipse/android/v1.5/tools$ adb devices
    List of devices attached
    emulator-5554 device

    I've unplugged the phone and plugged it back in several times ...no new adb devices show up.

    I've tried a few other suggestions I've found on other sites:
    - I've restarted the udev daemon like so: sudo /etc/init.d/udev restart
    - I've listed the connected usb devices with "lsusb" and my phone shows up as:
    Bus 002 Device 009: ID 0bb4:0c02 High Tech Computer Corp.
    - Reset adb from the Devices view inside Eclipse.
    Then all I get in the console are these errors:
    [2009-05-19 00:44:03 - DeviceMonitor]Adb connection Error:EOF
    [2009-05-19 00:44:03 - DeviceMonitor]Connection attempts: 1

    I see the directions you've listed above are the same official directions listed here: http://developer.android.com/guide/d...tml#setting-up

    Please someone tell me the Jaunty version of Ubuntu is why I'm having problems I don't want to have to go back to an earlier version of Ubuntu. Surely someone knows how I'd add appropriate rules for a Jaunty version of Ubuntu? It appears the only difference between the Dapper rules and the Gutsy/Hardy rules is the name of the subsystem and as far as I can tell this 'usb' subsystem name hasn't changed in Jaunty.

    Thanks,
    Justin

    I've got the fix for you brother

    Though the website tells you this:
    1. Login as root and create this file: /etc/udev/rules.d/50-
    android.rules.
    For Gusty/Hardy, edit the file to read:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

    For Dapper, edit the file to read:
    SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
    2. Now execute:
    chmod a+rx /etc/udev/rules.d/50-android.rules
    rename the file to "51-android.rules" by going into Nautilus with root:
    Code:
    gksu nautilus
    and make sure there is no trace of a 50-android.rules by viewing hidden files using Ctrl+H

    then reboot your machine

    i hope this helps

    EDIT: This info should be added to the main post.

    Found in Google Groups thanks to JBQ
    http://groups.google.com/group/andro...3488c601243686
    Last edited by wddglr; 05-24-2009 at 02:27 AM.

  9. #9
    Join Date
    May 2009
    Posts
    2

    Thumbs up Re: How to Install Apps using ADB

    Wddglr, you're a lifesaver!


    Thanks for the suggestions they worked great. I thought about fiddling with that rule level but figured I should research what exactly it does first to this udev system I am completely unfamiliar with in Linux. But since you seemed pretty sure of yourself I just tried it and yeah, that seemed to be the only problem.


    I can now see my phone in the Eclipse devices view and after struggling with the minSdkVersion attribute in the application manifest I can set breakpoints and debug the silly HelloWorld app so far. Very very cool!


    Just a note for others who chose not to shell out for the Google Dev phone and just go to a T-Mobile store to buy the G1. It seems it comes out of the box with version 1.0 (API level 1) ...so presumably were stuck with that version of the operating system until T-Mobile rolls out new versions or maybe we can take our locked phones into a store eventually to be re-flashed?? Not sure, anyway setting this in the application manifest file was apparently a prerequisite:


    <uses-sdkandroid:minSdkVersion="1"/>


    I get the following warning in Eclipse, but at least it lets me launch and debug apps on my phone:

    Code:
    Manifest min SDK version (1) is lower than project target API level (2)	AndroidManifest.xml
    ...because I'm using the latest 1.1/1.5 SDK available. I don't know what other problems this might present for me down the road if I try to use features only in SDK 1.1 for example?


    This minSdkVersion value is also the last field you can specify in the New Android Project wizard, and it immediately defaults to “2” which of course wouldn't work with my phone. Maybe others had figured this out right away, but it was a stumbling block for me for a while.


    Again, Thank you so much Wddglr! This tip for Jaunty users should definitely be added to Google's main Android dev pages if someone knows who to contact about that.


    Justin

  10. #10
    Join Date
    Dec 2009
    Posts
    4

    Default Re: How to Install Apps using ADB


    These are great instructions but though I downloaded the USB driver via AVD Manager, and followed the instructions on this page (http://developer.android.com/sdk/win...taFreshInstall), Windows never seems to recognize the device. It does recognize the SD card and I can mount/unmount it. But it never prompts with the "Found new hardware.." message.

    I went into Manage Devices and there is no "ADB Interface" listed so it seems my system still have it and the "Upgrade an existing driver" instructions from that page don't seem to apply. I do see the device's SD card listed under "Disk Drives" (Motorola A855 USB Device).

    I'm running Vista x64 SP2. Though these instructions state Win32 only I assumed that is because they are old? I can see the amd64 folder under ~\Android SDK\tools\usb_driver.

    I could really use some help. Thanks.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Install apps onto memory card?
    By trumani in forum General Android Chat
    Replies: 14
    Last Post: Yesterday, 05:04 PM
  2. How to install Android SDK
    By Mr Android in forum Developers General Chat
    Replies: 41
    Last Post: 12-27-2011, 08:34 PM
  3. Install Android
    By Ujjwol in forum General Android Chat
    Replies: 12
    Last Post: 11-02-2010, 12:30 PM
  4. can i install android on nokie e71?
    By wafy8a in forum Developers General Chat
    Replies: 11
    Last Post: 01-05-2010, 02:09 AM
  5. Install Python
    By chanchad_tejas in forum Developers General Chat
    Replies: 0
    Last Post: 01-26-2008, 08:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts