10

I never had any problem uploading my applications on my devices (Galaxy SPlus and Nexus 10) but for an unknown reason, now uploading an APK on my Nexus 10 take ages... on 20 times I tried, I reached the end only one time.

Did anyone know how I can debug/verbose APK uploading to know at which speed it goes ? I don't know what is the way the APK is uploaded, can someone give me a hint of where to look for ? I want to investigate but I don't know what to do ?

The device is correctly responding to adb commands, I can see it under Eclipse, I can download/upload files with DDMS file explorer, everything is working as usual, but when running/debugging my application, Eclipse get stuck on "Uploading my-application.apk onto device 'R32D1035MCE'".

Could you please help ?

EDIT :

I have reseted my device to factory default, it does no help.

Also, I have enabled traces with ADB_TRACE=all in my environment settings, and the trace show that adb is waiting for something, but I have no clue.

EDIT :

Still investigating, my Nexus 10 was working again, and then suddenly it stopped working. In the DDMS log, I have the following error message :

[2013-06-23 01:09:30 - 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(SocketDispatcher.java:51)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89)
    at sun.nio.ch.IOUtil.write(IOUtil.java:60)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
    at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
    at com.android.ddmlib.Client.sendAndConsume(Client.java:607)
    at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:348)
    at com.android.ddmlib.Client.requestAllocationStatus(Client.java:453)
    at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:835)
    at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:803)
    at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:621)
    at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:44)
    at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:580)

It looks like related to this problem : An established connection was aborted by the software in your host machine

But none of the solutions given are working for me.

Is there a way to reset the network connection that adb is doing with the device ?

EDIT : a solution have been found as suggested by chris-stratton, using "adb install -r package.apk", usage of -r command switch that force a re-installation unblocks the device frozen state.

Community
  • 1
  • 1
Alexis Pautrot
  • 1,128
  • 1
  • 14
  • 18
  • 2
    It may not be the install which is taking time, but rather for the development machine to realize it is done. Try adb install -r your.package.apk from a command line terminal. The .apk is probably in the bin/ folder of your project. – Chris Stratton Jun 22 '13 at 15:59
  • also try resetting the device back to factory default settings – Alex P. Jun 22 '13 at 17:52
  • I have reseted the device to factory default but it do not help. This was my best luck. It still works fine with with my other device, so I guess it is something in a setting or cache of the adb installation on my PC. – Alexis Pautrot Jun 22 '13 at 18:07
  • 2
    And the result of your command line install attempt was??? – Chris Stratton Jun 23 '13 at 00:10
  • Okay, I confirm that running the command line "adb install -r my.package.apk" is unblocking the frozen device state I was encountered while uploading. The command line works fine, and uploading also rework under Eclipse with no restart. Still an annoying bug, but easy workaround. Thank you !!! – Alexis Pautrot Jun 23 '13 at 21:39

5 Answers5

11

Ok, I finally found the answer. The reason is that I used another mini USB cable than the one provided with the Nexus device. I'm reproducing it at 100%.

When I use the cable from my Galaxy SPlus, the Nexus don't want to upload the file (even if the device is recognized, and that everything seems fine). The upload never ends.

And the inverse is true too, when using the USB cable device of my Nexus 10 with my Galaxy SPlus, this time the device itself is not recognized.

I tried that on two different PCs. I thought that mini USB cables were all compatible. But no. The answer I don't have is : why ?

Alexis Pautrot
  • 1,128
  • 1
  • 14
  • 18
5

A slight variation of the different USB cable solution is that I just switched USB ports; problem solved. This was even after rebooting both my desktop and phone not being enough.

Donovanr
  • 81
  • 1
  • 3
2

I don't know how to monitor the upload speed of an APK so the following won't help speed up the transfer but if what you mean is that the transfer fails because of a time out then you can change that value in Window->Preferences->Android->DDMS->ADB Connection time out.

Mine is set up for 10000 (which is 10s) and rarely fails.

But none of the solutions given are working for me.

There are plenty there, which ones did you try so we know not to propose those?

Is there a way to reset the network connection that adb is doing with the device ?

You can reset ADB from eclipse by going to the DDMS perspective and in the Devices part click on the downward facing triangle near the maximise and minimise buttons for that Devices subwindow to get to a menu that contains Reset ADB.

You can also try to get your device out of USB debugging mode and back in or to reboot it completely (although given that it would have been part of resetting to factory default it is unlikely to work).

Also, does uploading other applications work? If you only have the one project in your workspace try File -> New -> Other -> Android -> Android Sample Project (any of them).

Julien Rousseau
  • 975
  • 1
  • 9
  • 15
  • I have changed the time out setting for 10s and it is timing out after this time. – Alexis Pautrot Jun 22 '13 at 17:59
  • I have this problem on many of my android projects, it is not related to this application. I also tried to switch on/off the USB debugging mode and also tried to do a complete reboot of the device. I even have reseted it to factory defaults. – Alexis Pautrot Jun 23 '13 at 09:38
0

I faced this problem as well. After having typed on the windows command : adb devices, there is (at least) 2 possibilities:

  1. List of devices attached 41006XXXXXXX device
  2. List of devices attached 41006cXXXXXX unauthorized

The second line indicates the problem with the connection of the device to the PC. I solved it on configuring my mobile for debug and then it worked perfectly.

alvaro562003
  • 678
  • 1
  • 6
  • 27
0

I've seen things like this when I, for one reason or another, failed to send SIGABRT to adb processes (adb shell commands for example).

ps -xo pid,comm | grep adb | xargs kill -9
Nick
  • 19,198
  • 51
  • 185
  • 312