Docker中的Android仿真器
我试图在docker容器内启动Android emulator,但出现错误:Docker中的Android仿真器,android,jenkins,docker,Android,Jenkins,Docker,我试图在docker容器内启动Android emulator,但出现错误: 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: - U
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.
但是容器中的操作系统是(uname-a
)
Ubuntu SMP周二3月10日20:06:50 UTC 2015 x86\u 64 x86\u 64 x86\u 64 GNU/Linux
手动启动EmulatorOx64-x86也可以正常工作:
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).
android sdk linux/tools#/模拟器64-x86
emulator:错误:您没有提供Android虚拟设备的名称
使用“-avd”选项。有关更多信息,请阅读帮助avd。
如果您真的想*不运行AVD,请考虑使用“-DATA”。
指定一个数据分区映像文件(我希望您知道您在做什么)。
我可能会做一个符号链接,但我认为这不是一个好的解决方案,因为可能有不同的体系结构可以模仿
这个模拟器也应该由Jenkins启动,Jenkins住在上面提到的容器中
更新:
正如@user2915097所建议的:
root@686d602e6ffa:/#file/bin/bash
/bin/bash:ELF 64位LSB可执行文件,x86-64,版本1(SYSV),动态链接(使用共享libs),适用于GNU/Linux 2.6.24
从
uname将始终告诉您64位。查看例如“file/bin/sh”以查看文件系统的真正拱门。您可以创建一个符号链接,但我认为这不是一个好的解决方案,因为可能有不同的体系结构可以模仿,仅供参考:我在docker上根据ubuntu:16.04中的
遇到了这个
并最终通过安装“file”apt get install file解决了这个问题
显然,emulator使用
文件查看$SHELL,如果它不包含“x86_64”,则认为它是32位的 root@686d602e6ffa:/#file/bin/bash
/bin/bash:ELF 64位LSB可执行文件,x86-64,版本1(SYSV),动态链接(使用共享库),适用于GNU/Linux 2.6.24,BuildID[sha1]=54967822da027467f21e65a1eac7576dec7dd821,剥离的
root@686d602e6ffa:~/android sdk linux/tools#文件仿真器
仿真器:ELF 32位LSB可执行文件,英特尔80386,版本1(SYSV),动态链接(使用共享libs),适用于GNU/linux 2.6.15,与主机PC(纯x64)相同一切都很好除了仿真器
行为怪异之外,还有什么理由不使用仿真器64-x86
?(据我所知,我想这为我节省了时间,而我一开始还没有在你的问题中看到这个解决方案。)我想唯一的原因是我不知道emulator的确切功能是什么。可能是它给实际的仿真器或其他东西添加了一些标志,因此使用I simulink而不是实际的程序可能是危险的,尽管它是解决方案,但我现在也遇到了这个问题,你找到了什么解决方案?你可以制作一个符号链接-请参阅下面的名称android,它将直接指向仿真器64-x86