I have Android Studio up and running without any issues. The problem is debugging the code on a device. I’ve tried to spin up an emulator but it never launched (kept loading and loading). Tried to connect to my physical device via WiFi but couldn’t get it to work either. When I tried pairing with QR code, my device wasn’t connecting with the adb server. When I tried pairing with pairing code, adb said it successfully connect but couldn’t see the device with “adb devices”.
I tried connecting my phone to the computer via USB and then attached the phone to the VM running Android studio but Android Studio didn’t detect the device.
Has anyone successfully done Android development on Qubes? If so, how do you do it?
I had recent success with a physical device, HVM qube, and USB connection. adb devices showed the device straight away but as unauthorized so I had to start adb as root outside Android Studio. PVH also seems to work fine. I find debugging adb problems frustrating - it always seems like everyone has a solution that doesn’t work for anyone else’s device/computer.
(ETA: this is with an Android 8 device that can only do USB connections.)
No success with the built-in emulator even with a PV qube and I don’t know nearly enough about the low level details on nested virtualization to go poking around, but when I looked on this forum I got the impression it was blocked. There are a few Waydroid threads if that’s an option for you.
HVM qube with Android Studio installed and some avd
Alter /usr/share/qubes/templates/libvirt/xen.xml in dom0, setting <feature name='vmx' policy='require' /> (different systems may use smx instead of vmx)
Restart libvirtd in dom0
Verify the avd starts from the HVM qube command line with emulator -avd <AVD> Do this from the command line because Android Studio hides errors.
It wasn’t working for me before because I had a disk space issue on the HVM qube. This was reported when I ran the emulator from the command line. It will also report if you haven’t got vmx/smx enabled.
At this point, the emulator starts up and gives a warning about nested virtualization (may not work at all, expect bad performance).
Boot time (Pixel 3a) was 3 minutes.
Then, running from Android Studio and deploying a hello world app, I had something weird going on with the emulator screen going blank, but that went away and it basically worked. It wasn’t quite as slow as I was expecting, so maybe it’s usable - not sure yet.
I’m not saying it’s a good or safe idea to enable nested virtualization, just that it works. You can find threads with more details by searching this forum for nested virtualization or android.