Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Like Tree1Likes

Thread: Debugging Android Programs via USB from Eclipse

  1. #1
    Soundwave
    Member #
    1494
    Join Date
    Jun 2011
    Location
    Ashford, Kent, England
    Tablet
    TF101
    Posts
    11
    Liked
    0 times

    Question Debugging Android Programs via USB from Eclipse

    Hello, all:

    I am trying to write some simple android applications; several texts suggest connecting the Android device, in this case my trusty Transformer, to a PC with a USB cable and Eclipse will recognize and use the device to permit testing of the application.

    My question - has anyone tried this with the Transformer and, if so, how did you get the PC to recognize the Transformer?

    Thanks in advance for any help you can suggest.

    Sparky

  2. #2
    Starscream
    Member #
    12558
    Join Date
    Oct 2011
    Location
    CA
    Tablet
    TF201
    Posts
    254
    Liked
    14 times
    Just want to throw one thing out that you may already know... I run Eclipse-Android apps in debug mode, but without the device attached. It steps through the code nicely, so connecting the device is not necessarily a requirement. All that being said, debug mode is really, really slow, so I avoid it as much as possible. When I want to test on the device, I simply push the .apk there, install it and run it directly on the device.

    I had read about debugging on the device itself (like you are attempting to do), but haven't had the need for it, yet. I do use ADB commands with my Transformer attached (to push/pull files), but that's as far as I have gone.
    Last edited by tedr108; 01-26-2012 at 02:15 PM.

  3. #3
    Soundwave
    Member #
    1494
    Join Date
    Jun 2011
    Location
    Ashford, Kent, England
    Tablet
    TF101
    Posts
    11
    Liked
    0 times

    Question Debugging Android Programs via USB from Eclipse

    Thanks for the information - the real reason I was trying to use my transformer as a debugging tool was that I could/can not get the emulator to do anything. That is, the emulator starts, I can run programs already there on it, but I cannot get even the Hello World program to do anything on it!!

    Did you have any problems? Do you have any suggestions? Any tricks I need to do in order to get things going?

    Thanks in advance...

    Sparky

  4. #4
    Supporting Member
    Supporting Member

    Member #
    8638
    Join Date
    Aug 2011
    Location
    United Kingdom
    Tablet
    TF101
    Posts
    2,958
    Liked
    362 times
    Quote Originally Posted by The Artful Dodger View Post
    Thanks for the information - the real reason I was trying to use my transformer as a debugging tool was that I could/can not get the emulator to do anything. That is, the emulator starts, I can run programs already there on it, but I cannot get even the Hello World program to do anything on it!!

    Did you have any problems? Do you have any suggestions? Any tricks I need to do in order to get things going?

    Thanks in advance...

    Sparky
    I had problems with the emulator too at first, opening Task Manager and ending "adb.exe" before trying to run your eclipse app on it fixed it, it was opening multiple instances of the emulator each time I wanted to test the app, and not running the app before that.

    Here is 200 Android App Development Tutorial videos that might help too
    [VIDEOS] 200 Free Android App Development Tutorial Videos
    The Artful Dodger likes this.
    TF No longer charges: Clicky
    Transformer won't boot: Clicky
    Power / Lock button issues: Clicky
    Flash downloaded ASUS Firmware: Clicky

  5. #5
    Soundwave
    Member #
    1494
    Join Date
    Jun 2011
    Location
    Ashford, Kent, England
    Tablet
    TF101
    Posts
    11
    Liked
    0 times
    First, I want to thank you for the link to the videos - the first five are great - I followed everything Travis said and did!

    At least until the end of the fifth one - where he runs the small app he creates - I do the same thing and the emulator begins to run but the app never shows up!

    I have tried to follow the instructions from other sources - texts, web pages, everything I can find but nothing allows me to get past that step!!

    Any suggestions? I am completely lost as to where to look!

    If it helps, here's what Eclipse put out on the Console:

    --------------------------
    [2012-01-29 16:51:32 - The New Boston] ------------------------------
    [2012-01-29 16:51:32 - The New Boston] Android Launch!
    [2012-01-29 16:51:32 - The New Boston] adb is running normally.
    [2012-01-29 16:51:32 - The New Boston] Performing XXXX.Test.Package1.StartingPoint activity launch
    [2012-01-29 16:51:32 - The New Boston] Automatic Target Mode: using device 'emulator-5554'
    [2012-01-29 16:51:32 - The New Boston] Uploading The New Boston.apk onto device 'emulator-5554'
    [2012-01-29 16:51:32 - The New Boston] Installing The New Boston.apk...
    [2012-01-29 16:51:32 - The New Boston] Success!
    [2012-01-29 16:51:32 - The New Boston] Starting activity XXXX.Test.Package1.StartingPoint on device emulator-5554
    [2012-01-29 16:51:32 - The New Boston] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=XXXX.Test.Package1/.StartingPoint }

    ----------------------------------

    Any suggestions?

    Thanks again and in advance for any help.

    Sparky

  6. #6
    Soundwave
    Member #
    24028
    Join Date
    Jan 2012
    Location
    N W London
    Posts
    1
    Liked
    0 times
    @The Artful Dodger: Hi, I found the emulator to be incredibly slowwww... on my Core i7-970 PC it takes something like 45sec for the app to appear in the emulator... I found at first i was simply not waiting long enough! But since I only got the Transformer on Friday and sorted out Eclipse and got it all running yesterday I'm pleased that my first attempt at a simple Android app did actually work.... (I followed the O'Reilly 'flashlight' tutorial). It would seem there is a problem with the connection as I get the following about 200 odd times before the app starts in the emulator...

    [2012-01-29 21:48:15 - ddmlib] An established connection was aborted by the software in your host machine
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(Unknown Source)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
    at sun.nio.ch.IOUtil.write(Unknown Source)
    at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
    at com.android.ddmlib.JdwpPacket.writeAndConsume(Jdwp Packet.java:213)
    at com.android.ddmlib.Client.sendAndConsume(Client.ja va:575)
    at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap. java:348)
    at com.android.ddmlib.Client.requestAllocationStatus( Client.java:421)
    at com.android.ddmlib.DeviceMonitor.createClient(Devi ceMonitor.java:854)
    at com.android.ddmlib.DeviceMonitor.openClient(Device Monitor.java:822)
    at com.android.ddmlib.DeviceMonitor.processIncomingJd wpData(DeviceMonitor.java:781)
    at com.android.ddmlib.DeviceMonitor.deviceClientMonit orLoop(DeviceMonitor.java:649)
    at com.android.ddmlib.DeviceMonitor.access$100(Device Monitor.java:42)
    at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonit or.java:577)
    @Detection: What I'm still trying to figure out is how to get the app to the real device via the network. I tried connecting via ADB [ adb connect <ip> ] but that didn't work so how did you do it?

  7. #7
    Soundwave
    Member #
    16010
    Join Date
    Nov 2011
    Posts
    9
    Liked
    0 times
    You need to be rooted to debug.

  8. #8
    Supporting Member
    Supporting Member

    Member #
    8638
    Join Date
    Aug 2011
    Location
    United Kingdom
    Tablet
    TF101
    Posts
    2,958
    Liked
    362 times
    Quote Originally Posted by irvingc View Post
    @The Artful Dodger: Hi, I found the emulator to be incredibly slowwww... on my Core i7-970 PC it takes something like 45sec for the app to appear in the emulator... I found at first i was simply not waiting long enough! But since I only got the Transformer on Friday and sorted out Eclipse and got it all running yesterday I'm pleased that my first attempt at a simple Android app did actually work.... (I followed the O'Reilly 'flashlight' tutorial). It would seem there is a problem with the connection as I get the following about 200 odd times before the app starts in the emulator...



    @Detection: What I'm still trying to figure out is how to get the app to the real device via the network. I tried connecting via ADB [ adb connect <ip> ] but that didn't work so how did you do it?
    This should help you with setting your tablet up as the test device

    Using Hardware Devices | Android Developers

    Main points being:

    1. Declare your application as "debuggable" in your Android Manifest.

    2. On the device, go to Settings > Applications and enable Unknown sources

    3. Turn on "USB Debugging" on your device.
    TF No longer charges: Clicky
    Transformer won't boot: Clicky
    Power / Lock button issues: Clicky
    Flash downloaded ASUS Firmware: Clicky

  9. #9
    Supporting Member
    Supporting Member

    Member #
    8638
    Join Date
    Aug 2011
    Location
    United Kingdom
    Tablet
    TF101
    Posts
    2,958
    Liked
    362 times
    Quote Originally Posted by carlos_online View Post
    You need to be rooted to debug.
    Nope, just enabling USB Debugging mode will do
    TF No longer charges: Clicky
    Transformer won't boot: Clicky
    Power / Lock button issues: Clicky
    Flash downloaded ASUS Firmware: Clicky

  10. #10
    Ratchet
    Member #
    2171
    Join Date
    Jun 2011
    Tablet
    TF101
    Posts
    102
    Liked
    12 times
    Quote Originally Posted by Detection View Post
    Declare your application as "debuggable" in your Android Manifest.
    As of SDK Tools version 8 (and the current version is 16), you no longer have to do that.

 

 
Page 1 of 2 1 2 LastLast

Remove Ads

Sponsored Links

Posting Permissions

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

Similar Threads

  1. Where do programs go when installed?
    By opentoe in forum Transformer Prime Help
    Replies: 1
    Last Post: 01-14-2012, 07:45 PM
  2. Browser with debugging tools?
    By skallal in forum Asus Transformer (TF101) Development
    Replies: 0
    Last Post: 11-17-2011, 09:04 AM
  3. URLs not working from mail programs.
    By skerr11 in forum Asus Transformer (TF101) Help
    Replies: 5
    Last Post: 08-19-2011, 03:14 PM
  4. USB debugging
    By TransformerZeus in forum Asus Transformer (TF101) Help
    Replies: 7
    Last Post: 08-18-2011, 08:19 PM

Search tags for this page

android debugging using asus transformer
,
android eclipse usb debugging
,
android tablet not getting detected by eclipse
,

connection android sdk

,
could not find newboston.apk
,

eclipse usb debug

,

eclipse usb debugging

,

how to turn off usb debugging on asus transformer

,
software to debug asus tablet running 4.2
,
testing android apps with eclipse in asus transformer
,

tf201 eclipse

,
usb debugging android eclipse
Click on a term to search for related topics.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
Search Engine Optimization by vBSEO 3.6.1
All times are GMT -6. The time now is 04:16 AM.