Sean
Sean

Reputation: 47

What is the best way to run the Android emulator on Ubuntu 16.04?

Running Android Emulator on Ubuntu seems a bit more involved than the Windows version. I don't see the same option for downloading Intel's hardware assisted virtualization software in the SDK manager any more, and instead I was instructed to run it using KVM according to How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulator link, which requires Qt, but even when I installed it I got the following errors:

./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5: version `Qt_5' not found (required by ./emulator64-arm)

I tried installing qt version 5.7. When I issue qmake -version, I see QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu , so I tried to install the new version of qt in the same directory using the procedures here but the installer just hangs. But I can install qt in my home folder; that however is not useful to me since it does not change the system configuration and qmake still shows the old version of qt which I have. Here is all the different versions of qt on my machine now:

$ ls -al /usr/lib/x86_64-linux-gnu/qt*
/usr/lib/x86_64-linux-gnu/qt4:
total 116
drwxr-xr-x   4 root root   4096 Jul 19  2016 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x   2 root root   4096 Jul 19  2016 bin
drwxr-xr-x  16 root root   4096 Dec  1  2016 plugins

/usr/lib/x86_64-linux-gnu/qt5:
total 128
drwxr-xr-x   7 root root   4096 Jun 16 22:31 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x   2 root root   4096 May 16 15:30 bin
drwxr-xr-x   2 root root   4096 Jul 19  2016 libexec
drwxr-xr-x  97 root root   4096 May 16 15:30 mkspecs
drwxr-xr-x  17 root root   4096 Jun 16 22:31 plugins
drwxr-xr-x  11 root root   4096 Jul 19  2016 qml

/usr/lib/x86_64-linux-gnu/qt7:
total 108
drwxr-xr-x   2 root root   4096 Jul 26 17:25 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..

/usr/lib/x86_64-linux-gnu/qtchooser:
total 108
drwxr-xr-x   2 root root   4096 May 16 15:30 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
lrwxrwxrwx   1 root root     50 Nov  7  2016 4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx   1 root root     50 May 12 14:47 5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx   1 root root     50 May 12 14:47 default.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx   1 root root     50 Nov  7  2016 qt4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx   1 root root     50 May 12 14:47 qt5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf

/usr/lib/x86_64-linux-gnu/qt-default:
total 112
drwxr-xr-x   3 root root   4096 Jul 19  2016 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x   2 root root   4096 Jul 19  2016 qtchooser

I am wondering maybe there is a better method for running the emulator since I see comments about Genymotion and a number of other virutalization software for Android on Ubuntu, which I downloaded but I don't see how I can run the avd I created in the SDK folder with genymotion. Instead there are some images, which you can choose from. What is the best way to run Android emulator on Ubuntu for the purpose of testing your apps?

I saw this link, which suggested the following command: `LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 ./emulator -avd Nexus -qemu -m 2047 -enable-kvm

Which seems to cause the emulator to come up for a brief second before I get a core dump, and the following errors:

emulator: WARNING: Ignoring invalid http proxy: Empty proxy configuration string

*** Error in `/home/sansari/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386': double free or corruption (fasttop): 0x00007f82f0029670 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f83e7ed77e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f83e7ee037a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f83e7ee453c]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x4a4db5)[0x7f83c5e61db5]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x4a50a3)[0x7f83c5e620a3]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x1de93d)[0x7f83c5b9b93d]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x1de980)[0x7f83c5b9b980]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x45e9a)[0x7f83d090de9a]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x32f42)[0x7f83d08faf42]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x646e)[0x7f83d08ce46e]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x67884)[0x7f83d092f884]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f83ea46d6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f83e7f673dd]
======= Memory map: ========

`

Upvotes: 0

Views: 1148

Answers (1)

Lorenzo Barbagli
Lorenzo Barbagli

Reputation: 1281

Download Android Studio.

Import your Android project.

From the menu click RUN > RUN APP

Android Studio will prompt you with a popup: click Create New Virtual Device. It will drive you through the steps to download the Android system image you prefer and start the emulator in a few seconds.

Upvotes: 1

Related Questions