0

When the IDE Android Studio is running, it is very easy to launch the Android emulator from the command line under Ubuntu. I my case, I just issue:

$HOME/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386 -avd My_Galaxy_Nexus

But when the IDE is not running, this fails. I get next error message (and a warning that can be ignored, in my opinion):

emulator: WARNING: encryption is off
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: linuxfb, minimal, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

I suppose this is due to the fact that the Android Studio IDE is creating an environment and loading libraries (the Qt platform) that I am missing for launching the emulator as stand-alone.

Since the IDE is very heavy in consuming resources on my laptop, I would prefer to launch only the emulator, because it is a useful way for me to have WhatsApp running without having an Android or Mac smartphone.

My question is: how to launch the emulator as a stand-alone app?

Pierre François
  • 5,850
  • 1
  • 17
  • 38
  • 2
    Have you tried this https://stackoverflow.com/a/42845150/2354845 ? – Badr Apr 24 '18 at 08:51
  • @Badr Thank you, I was looking for that, also on SO. Strange it didn't appear in my search results. – Pierre François Apr 24 '18 at 14:13
  • @Badr: following stackoverflow.com/a/42845150/2354845 gives me a java error: `Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema` – Pierre François Apr 24 '18 at 14:28
  • Have you already installed the Android SDK ? Please check that before . – Badr Apr 24 '18 at 15:59
  • @Badr: sure, Android SDK is installed. Anyway, since my problem is solved by launching `./emulator ...` in the correct directory, I no longer need to execute `./avdmanager list avd`,which was causing the problem. – Pierre François Apr 24 '18 at 18:27

1 Answers1

1

The QT platform error might be because you are not running your command in "tools" directory.

And for whatsapp you can always use genymotion or nox emulators if you don't really need to develop anything.

Alexandru Sandu
  • 314
  • 2
  • 13
  • It works. Even after a reboot. I will take a look at genymotion and nox emulators. – Pierre François Apr 24 '18 at 14:49
  • Genymotion is expensive. For that money, I can get an Android. NoxPlayer is not running on Ubuntu. I will stick on Android Studios emulator, which is starting very fast now. – Pierre François Apr 24 '18 at 15:06
  • Sorry about that, i forgot about your os, i am using a mac and told you what works for me. You can find a list of emulators that work for you here: http://techapple.net/2014/05/5-best-android-emulators-linux-run-android-apps-linux-ubuntulinuxmintfedoraarchlinuxopensusemageiacentos-etc/ – Alexandru Sandu Apr 24 '18 at 15:07