install to emulator via adb is too slow

I am using the command
adb.exe -s emulator-5554 install -r ba.apk
to install an application onto an emulator (MonoForAndroid_API_10 emulator). The results show
78 KB/s (7048697 bytes in 87.593s)
which shows that it takes 87 seconds to install. This is too slow to be useable as I am installing to multiple devices as I am developing and debugging.

When I use the same command to install on a cell phone attached via a USB cable the results are
1965 KB/s (7048697 bytes in 3.502s)
Under 4 seconds is perfect.

If I installed directly from Visual Studio 2012 to either the emulator or the cell phone, the time is 15 seconds.

My question is whether there is a way to make the installation to the emulator as fast as to the cell phone.

Answers

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai
    edited November 2013

    That sounds ridiculously slow. What happens if you restart the adb daemon:

    adb kill-server
    adb start-server
    adb install -r ba.apk
    

    Alternately, what happens if you try Genymotion's emulator?

  • RyanSavilleRyanSaville USMember

    stopping and starting adb gave the same results. I will try the other emulator but I would like to get this working first without other products.

    Any other ideas?

    Thanks

  • wallymwallym USInsider, Beta ✭✭✭

    I've been using genymotion. Works really well. Its a big step up from the android emulator.

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    You should have been using Android Intel x86 images, not ARM ones. The former is mucho faster (huge difference).
    Here is how to config the emulator for x86.
    Genymotion is even faster but it is free only for personal use (albeit worth the price).

  • RyanSavilleRyanSaville USMember

    I tried the x86 emulator, but there is no difference in the installation speed.

    Here's the problem: the debug version of the .apk is 805k, the release version is 6.9 MB. That is why the install via adb is taking so much longer then via Visual Studio, the amount of data transfered to the emulator is almost an order of magnitude larger.

    I looked inside the .apk files, libmonodroid.so in the debug version is 463K, in release it is 3.4 MB. The release version also has mscorlib.dll (1.3 MB) and Mono.Android.dll (655 K). I am assuming that the debug version is smaller because Visual Studio is ensuring that the emulator has all required files.

    I can "deploy" to the emulator from Visual Studio, then run the application on the emulator without VS involved. The deploy time is 20 seconds.

    I can sign the debug version of the .apk and install via adb, but it does not run on the emulator, dies immediately. I assume this is because the extra files Visual Studio provides are not there.

    How can I make a .apk file that is small that can run on the emulator?

Sign In or Register to comment.