Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adb transfers file with a very slow speed

Tags:

I'm having a problem with adb on my machine, it runs on OSX Yosemite. I was trying to adb install a 44mb apk and it took 5 minutes for the apk to be installed. I try to narrow the problem, and it seems that the adb push has something to do with this.

I tested with adb push -p src dest to see the transfer progress. The transfer works fine for small files, leaving about 1300KB/s transfer rate. It slows down a lot when transferring large files, about 120KB/s transfer rate. The transfer always slows down at byte 8388608/total.

I've tested adb push with the same device and same USB cable at my coworker's Mac using OSX Yosemite and it works fine. I don't know what causes the problem, could somebody help me?

like image 847
esam091 Avatar asked Feb 04 '15 05:02

esam091


People also ask

How fast is adb push?

I tested with adb push -p src dest to see the transfer progress. The transfer works fine for small files, leaving about 1300KB/s transfer rate. It slows down a lot when transferring large files, about 120KB/s transfer rate.


2 Answers

According to Performance Tuning the Network Stack on Mac OS X Part 2,
edit your /etc/sysctl.conf file as follows and reboot your machine.

kern.ipc.somaxconn=2048 net.inet.tcp.rfc1323=1 net.inet.tcp.win_scale_factor=4 net.inet.tcp.sendspace=1042560 net.inet.tcp.recvspace=1042560 net.inet.tcp.mssdflt=1448 net.inet.tcp.v6mssdflt=1412 net.inet.tcp.msl=15000 net.inet.tcp.always_keepalive=0 net.inet.tcp.delayed_ack=3 net.inet.tcp.slowstart_flightsize=20 net.inet.tcp.local_slowstart_flightsize=9 net.inet.tcp.blackhole=2 net.inet.udp.blackhole=1 net.inet.icmp.icmplim=50 

I was faced with the same problem and solved it by the above settings.

like image 121
sumio Avatar answered Sep 18 '22 20:09

sumio


I was struggling with this, then saw a suggestion to just start a webserver on the host machine and let your android device/emulator just download the apk.

cd build/outputs/apk/ python -m SimpleHTTPServer 8000 

Then, in the android device I just open a browser to http://<host_ip>:8000/ - it downloads in seconds.

like image 34
Marcel Chastain Avatar answered Sep 19 '22 20:09

Marcel Chastain