Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adb install/uploading of apk taking ages

Tags:

android

adb

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.

like image 806
Alexis Pautrot Avatar asked Jun 22 '13 15:06

Alexis Pautrot


1 Answers

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 ?

like image 62
Alexis Pautrot Avatar answered Oct 14 '22 16:10

Alexis Pautrot