Saturday, February 11, 2017

Android USB debugging sucks - using a kvm image


If you use Android Studio, you probably have tried to use the default Android images that it offers you.  They work pretty well, but they are really, really slow.   Unbearably slow if you are running anything complex - which is why are are nice companies like Genymotion who offer a snappy debug image along with a more industrial set up for serious coding.  I'm not going to blow $140 for my part time Android stuff though.

Pros use dedicated debug phones that are set to never turn off connected with good debug cables.  I'm not a pro by any stretch, but I do that with my own Pixel, but since I'm elderly it's just a pain since I've got desk arrangement and just eye focus problems looking from big screen to little screen, and I just don't like debug crap on my real phone.

So I just make my own Android image that doesn't suck.  It's actually pretty easy.  Assuming of course that you are running Linux (Windows is hideously slow for most tasks) - just install the kvm modules.

$ sudo apt-get install qemu-kvm

If you like typing lots of numbers, you can use the command line - but it's 2017 so I use the GUI - search for 'virtual' and you'll get the app:



Grab your favorite Android image from http://www.android-x86.org/download and install.  You can get by on 512MB memory for the image, but just use whatever works for your app.  1GB and 1-2 cores seems fine for me.

Once booted, Android is just Linux - switch to the text console with alt-F1 and get the IP


You can then connect with adb and use like usual in Android Studio:

lpreimesberger@ubuntu:~$ ./Android/Sdk/platform-tools/adb connect 192.168.122.69:5555
connected to 192.168.122.69:5555





No comments:

Post a Comment