iMac for the Android Studio win

Early days I know, but so far, so good.  The Android Studio install was painless.  Only issue was having to grant a security exception to allow HAXM to be installed, but other than that, the Studio install process was really slick and easy.

I was able to pretty quickly get an emulated device to appear, and I came here to declare success, but I realize it’s been sat on the boot screen for a while.  And with that, I complain and it’s up, though there’s the spinning wheel.  Still not happy.

I’ve killed it from the menu bar, and am trying again from the play button inside Android Studio.  Looks somewhat happier, and I even managed to get a screen grab.

But then all hell broke loose, and the emulator crashed again.  I shut down and restarted Android Studio, and Hello World! is back, but I shall definitely keep an eye on it.

So yeah, easy install.  Looks good.  Fast compiles.  Emulator seems snappy, but the crashes and hangs are a bit worrying.  Watch this space!

Android Virtual Device crashes on startup

I carefully followed the instruction in the Udacity course for setting up a Nexus 5 virtual device for launching my first app.  The device kept crashing as soon as I brought it up.

I did the usual googling, and eventually came across a post explaining how to start the emulator from the command line

For me, in Fedora, the emulator binary is in

/home/pjr/Android/Sdk/emulator

You can see what AVDs are available.

[pjr@localhost emulator]$ ./emulator -list-avds
Nexus_5X_API_25

You can then start it disabling the hardware acceleration like this

./emulator -avd Nexus_5X_API_25 -gpu guest

Tada!  It’s a phone.

However, I couldn’t find a way to then execute with the guest GPU setting in Android Studio.  Though the option appears, and it looks selectable, its not!

Grr.  Turns out, this is a known problem with images downloaded from the playstore (shown with the little triangle)

So I’m trying the Nexus 6 with Nougat API level 24.  Finally, I get the option to select SW rendering

And now I have a lovely Nexus 6 running Android 7.0

Faster Android emulator performance on Fedora

I’ve ditched the ancient Dell, and am now running on an old work laptop which was reimaged with Fedora. I’m normally a Ubuntu man, but whatever.

I started to install the Android Studio, and I got a notification that said

We have detected that your system can run the Android emulator in an accelerated performance mode.
Linux-based systems support virtual machine acceleration through the KVM(Kernel-mode Virtual Machine) software package.

Search for install instructions for your particular Linux configuration (Android KVM Linux Installation) that KVM is enabled for faster Android emulator performance.

So here’s what I did to enable this

egrep ‘^flags.*(vmx|svm)’ /proc/cpuinfo;

This printed out a bunch of stuff which means that Android Studio was correct: my cpu does support kvm

sudo dnf group install –with-optional virtualization;

sudo systemctl start libvirtd;

sudo systemctl enable libvirtd;

lsmod | grep kvm

The lsmod showed that kvm_intel is in fact now running, and though I haven’t rebooted, the systemctl enable command should start the service each time.