Android emulator in Docker

I`m trying to start Android emulator inside docker container, but I get error:

root@686d602e6ffa:~/android-sdk-linux/tools# ./emulator            
ERROR: 32-bit Linux Android emulator binaries are DEPRECATED, to use them
       you will have to do at least one of the following:

       - Use the '-force-32bit' option when invoking 'emulator'.
       - Set ANDROID_EMULATOR_FORCE_32BIT to 'true' in your environment.

       Either one will allow you to use the 32-bit binaries, but please be
       aware that these will disappear in a future Android SDK release.
       Consider moving to a 64-bit Linux system before that happens.

But the OS inside container is ( uname -a )

Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

And manually starting emulatox64-x86 works fine:

android-sdk-linux/tools# ./emulator64-x86 
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.

If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).

I may make a symbolic link - but I think it is not a good solution because there may be different architecture to emulate

Also this emulator should be started by Jenkins which live in container mentioned above

UPDATED: As @user2915097 suggested: root@686d602e6ffa:/# file /bin/bash /bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24


As just an FYI: I ran into this on docker based off of FROM ubuntu:16.04 and finally solved it by installing "file" apt-get install file

Apparently emulator uses file to look at $SHELL and if it doesn't contain "x86_64" it thinks it is 32bit.


extract from https://github.com/docker/docker/issues/611

uname will always tell you 64 bits. Look at eg "file /bin/sh" to see the real arch of the filesystem.


你可以做一个符号链接 - 但我认为这不是一个好的解决方案,因为可能有不同的体系结构来模拟

链接地址: http://www.djcxy.com/p/25242.html

上一篇: 如何了解ui状态更改取消的情况

下一篇: Docker中的Android模拟器