移动测试基础 Android 模拟器 Genymotion 安装配置与 ARM 支持

小马 · May 23, 2018 · Last by 洛凉 replied at May 10, 2019 · 27855 hits

简介

Genymotion是一款基于x86架构的Android模拟器,由于系统启动速度,应用运行速度远远快于Android SDK自带模拟器而受到广泛应用。

优缺点

优点

1 模拟器启动速度快 比AVD快很多
2 应用运行速度快
3 跨平台
4 IDE支持

缺点

1 与真机相比,无法支持一些硬件相关的传感器特性等
2 由于市场上大部分应用都是基于ARM架构来编译的,因此,与默认模拟器,真机相比,对于包含仅支持ARM架构的so的应用,默认不支持。

基于x86架构的模拟器/真机,兼容ARM指令有两个解决方案:
对于x86真机,x86处理器已经能够基本兼容ARM指令了。
对于Genymotion模拟器,则通过安装Genymotion-ARM-Translation来进行兼容。

安装Genymotion

安装步骤

1 安装虚拟机VirtualBox https://www.virtualbox.org/wiki/Downloads
2 注册Genymotion帐号 https://www.genymotion.com/account/create/
3 登录,下载并安装Genymotion https://www.genymotion.com/download/

安装指南

详细安装步骤,请参考以下文章:Installation
https://docs.genymotion.com/Content/01_Get_Started/Installation.htm

Genymotion的Github

https://github.com/Genymobile
开源了部分东西,感兴趣的可以了解下.

ARM-Translation兼容ARM

当我们安装某些apk 的时候,会发现无法正常安装.这时候实际就是还未支持ARM.
我们需要去向启动的模拟器安装Genymotion-ARM-Translation.zip. 该文件已上传至技术中心\测试组\PhoneTools\Genymotion
该包目前可以支持到android sdk API26 也就是android 8.0.0系统.

1 .windows下的安装

找到该zip,直接拖拽进启动的模拟器,模拟器即会提示,根据提示点击进行安装.安装成功后会有提示.
记得还需要重启模拟器一下.

2. ubuntu18.04下的安装

ubuntu16.04 的nautilus 也就是文件管理器,是支持拖拽的.但到了18.04 文件管理器该特性默认不支持(即使我们 sudo nautilus 启动的文件管理器也不行).
我们可以如下步骤安装:

### 2. 1 先adb push 到手机模拟器的/sdcard/Download

cmd@TR:~/MyDownload$ adb push Genymotion-ARM-Translation.zip /sdcard/Download
Genymotion-ARM-Translation.zip: 1 file pushed. 83.9 MB/s (13959459 bytes in 0.159s)

### 2.2 然后adb shell flash-archive.sh 该zip包 即可,记得安装成功后还需要重启模拟器一下.

cmd@TR:~/MyDownload$ adb shell flash-archive.sh /sdcard/Download/Genymotion-ARM-Translation.zip
uid=0(root) gid=0(root) groups=0(root),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc) context=u:r:toolbox:s0
/sdcard/Download/Genymotion-ARM-Translation.zip seems to be a zip archive
[flash_archive] Creating tmp dir
rm: /data/local/tmp/flash-tmp-dir/: No such file or directory
rm: /data/local/tmp/sanitized.zip: No such file or directory
[flash_archive] Unzip archive
Archive: /sdcard/Download/Genymotion-ARM-Translation.zip
creating: META-INF/com/
creating: META-INF/com/google/
creating: META-INF/com/google/android/
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
creating: system/
creating: system/lib/
creating: system/lib/arm/
inflating: system/lib/arm/cpuinfo
inflating: system/lib/arm/libandroid.so
inflating: system/lib/arm/libandroid_runtime.so
inflating: system/lib/arm/libbinder.so
inflating: system/lib/arm/libc.so
inflating: system/lib/arm/libcamera_client.so
inflating: system/lib/arm/libcrypto.so
inflating: system/lib/arm/libcutils.so
inflating: system/lib/arm/libc_orig.so
inflating: system/lib/arm/libdl.so
inflating: system/lib/arm/libEGL.so
inflating: system/lib/arm/libemoji.so
inflating: system/lib/arm/libETC1.so
inflating: system/lib/arm/libexpat.so
inflating: system/lib/arm/libfacelock_jni.so
inflating: system/lib/arm/libfilterfw.so
inflating: system/lib/arm/libfilterpack_facedetect.so
inflating: system/lib/arm/libfilterpack_imageproc.so
inflating: system/lib/arm/libgabi++.so
inflating: system/lib/arm/libgcomm_jni.so
inflating: system/lib/arm/libGLESv1_CM.so
inflating: system/lib/arm/libGLESv2.so
inflating: system/lib/arm/libgui.so
inflating: system/lib/arm/libhardware.so
inflating: system/lib/arm/libhardware_legacy.so
inflating: system/lib/arm/libharfbuzz.so
inflating: system/lib/arm/libhwui.so
inflating: system/lib/arm/libicui18n.so
inflating: system/lib/arm/libicuuc.so
inflating: system/lib/arm/libjnigraphics.so
inflating: system/lib/arm/libjni_mosaic.so
inflating: system/lib/arm/libjpeg.so
inflating: system/lib/arm/liblog.so
inflating: system/lib/arm/libm.so
inflating: system/lib/arm/libmedia.so
inflating: system/lib/arm/libnativehelper.so
inflating: system/lib/arm/libnetutils.so
inflating: system/lib/arm/libnfc_ndef.so
inflating: system/lib/arm/libOpenMAXAL.so
inflating: system/lib/arm/libOpenSLES.so
inflating: system/lib/arm/libpixelflinger.so
inflating: system/lib/arm/libskia.so
inflating: system/lib/arm/libsonivox.so
inflating: system/lib/arm/libsqlite.so
inflating: system/lib/arm/libssl.so
inflating: system/lib/arm/libstagefright.so
inflating: system/lib/arm/libstagefright_foundation.so
inflating: system/lib/arm/libstdc++.so
inflating: system/lib/arm/libstlport.so
inflating: system/lib/arm/libui.so
inflating: system/lib/arm/libusbhost.so
inflating: system/lib/arm/libutils.so
inflating: system/lib/arm/libvideochat_jni.so
inflating: system/lib/arm/libvideochat_stabilize.so
inflating: system/lib/arm/libvoicesearch.so
inflating: system/lib/arm/libvorbisidec.so
inflating: system/lib/arm/libwpa_client.so
inflating: system/lib/arm/libWVphoneAPI.so
inflating: system/lib/arm/libz.so
inflating: system/lib/arm/linker
inflating: system/lib/libdvm_houdini.so
inflating: system/lib/libhoudini.so
[flash_archive] Remount /system/ in rw
[flash_archive] Start file install
[ERROR][flash_archive] META-INF/com/google/android/update-binary is an ARM binary, using system updater
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libandroid.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libandroid_runtime.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libbinder.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libc.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libcamera_client.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libcrypto.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libcutils.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libc_orig.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libdl.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libEGL.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libemoji.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libETC1.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libexpat.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libfacelock_jni.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libfilterfw.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libfilterpack_facedetect.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libfilterpack_imageproc.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libgabi++.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libgcomm_jni.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libGLESv1_CM.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libGLESv2.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libgui.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libhardware.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libhardware_legacy.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libharfbuzz.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libhwui.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libicui18n.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libicuuc.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libjnigraphics.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libjni_mosaic.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libjpeg.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/liblog.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libm.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libmedia.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libnativehelper.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libnetutils.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libnfc_ndef.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libOpenMAXAL.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libOpenSLES.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libpixelflinger.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libskia.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libsonivox.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libsqlite.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libssl.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libstagefright.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libstagefright_foundation.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libstdc++.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libstlport.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libui.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libusbhost.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libutils.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libvideochat_jni.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libvideochat_stabilize.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libvoicesearch.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libvorbisidec.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libwpa_client.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libWVphoneAPI.so ARM lib
[sanitize_zipfile_and_execute_update_binary] Repackaging system/lib/arm/libz.so ARM lib
adding: META-INF/ (stored 0%)
adding: META-INF/com/ (stored 0%)
adding: META-INF/com/google/ (stored 0%)
adding: META-INF/com/google/android/ (stored 0%)
adding: META-INF/com/google/android/update-binary (deflated 35%)
adding: META-INF/com/google/android/updater-script (deflated 37%)
adding: system/ (stored 0%)
adding: system/lib/ (stored 0%)
adding: system/lib/arm/ (stored 0%)
adding: system/lib/arm/cpuinfo (deflated 9%)
adding: system/lib/arm/libandroid.so (deflated 75%)
adding: system/lib/arm/libandroid_runtime.so (deflated 65%)
adding: system/lib/arm/libbinder.so (deflated 67%)
adding: system/lib/arm/libc.so (deflated 48%)
adding: system/lib/arm/libcamera_client.so (deflated 74%)
adding: system/lib/arm/libcrypto.so (deflated 55%)
adding: system/lib/arm/libcutils.so (deflated 48%)
adding: system/lib/arm/libc_orig.so (deflated 48%)
adding: system/lib/arm/libdl.so (deflated 65%)
adding: system/lib/arm/libEGL.so (deflated 74%)
adding: system/lib/arm/libemoji.so (deflated 64%)
adding: system/lib/arm/libETC1.so (deflated 50%)
adding: system/lib/arm/libexpat.so (deflated 57%)
adding: system/lib/arm/libfacelock_jni.so (deflated 54%)
adding: system/lib/arm/libfilterfw.so (deflated 64%)
adding: system/lib/arm/libfilterpack_facedetect.so (deflated 46%)
adding: system/lib/arm/libfilterpack_imageproc.so (deflated 53%)
adding: system/lib/arm/libgabi++.so (deflated 72%)
adding: system/lib/arm/libgcomm_jni.so (deflated 58%)
adding: system/lib/arm/libGLESv1_CM.so (deflated 74%)
adding: system/lib/arm/libGLESv2.so (deflated 73%)
adding: system/lib/arm/libgui.so (deflated 70%)
adding: system/lib/arm/libhardware.so (deflated 63%)
adding: system/lib/arm/libhardware_legacy.so (deflated 52%)
adding: system/lib/arm/libharfbuzz.so (deflated 48%)
adding: system/lib/arm/libhwui.so (deflated 56%)
adding: system/lib/arm/libicui18n.so (deflated 54%)
adding: system/lib/arm/libicuuc.so (deflated 55%)
adding: system/lib/arm/libjnigraphics.so (deflated 65%)
adding: system/lib/arm/libjni_mosaic.so (deflated 45%)
adding: system/lib/arm/libjpeg.so (deflated 49%)
adding: system/lib/arm/liblog.so (deflated 53%)
adding: system/lib/arm/libm.so (deflated 39%)
adding: system/lib/arm/libmedia.so (deflated 72%)
adding: system/lib/arm/libnativehelper.so (deflated 54%)
adding: system/lib/arm/libnetutils.so (deflated 52%)
adding: system/lib/arm/libnfc_ndef.so (deflated 53%)
adding: system/lib/arm/libOpenMAXAL.so (deflated 66%)
adding: system/lib/arm/libOpenSLES.so (deflated 65%)
adding: system/lib/arm/libpixelflinger.so (deflated 55%)
adding: system/lib/arm/libskia.so (deflated 49%)
adding: system/lib/arm/libsonivox.so (deflated 23%)
adding: system/lib/arm/libsqlite.so (deflated 43%)
adding: system/lib/arm/libssl.so (deflated 54%)
adding: system/lib/arm/libstagefright.so (deflated 53%)
adding: system/lib/arm/libstagefright_foundation.so (deflated 62%)
adding: system/lib/arm/libstdc++.so (deflated 66%)
adding: system/lib/arm/libstlport.so (deflated 61%)
adding: system/lib/arm/libui.so (deflated 60%)
adding: system/lib/arm/libusbhost.so (deflated 55%)
adding: system/lib/arm/libutils.so (deflated 57%)
adding: system/lib/arm/libvideochat_jni.so (deflated 52%)
adding: system/lib/arm/libvideochat_stabilize.so (deflated 46%)
adding: system/lib/arm/libvoicesearch.so (deflated 61%)
adding: system/lib/arm/libvorbisidec.so (deflated 27%)
adding: system/lib/arm/libwpa_client.so (deflated 54%)
adding: system/lib/arm/libWVphoneAPI.so (deflated 59%)
adding: system/lib/arm/libz.so (deflated 45%)
adding: system/lib/arm/linker (deflated 52%)
adding: system/lib/libdvm_houdini.so (deflated 70%)
adding: system/lib/libhoudini.so (deflated 71%)
chmod: updater: No such file or directory
[flash_archive] Remount /system/ in ro
[flash_archive] Delete tmp directory
[flash_archive] Done successfully !
{Result:OK};

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 11 条回复 时间 点赞
小马 #1 · May 25, 2018 作者

修正:

sudo nautilus

去启动的文件管理器的 标题栏 找到一个设置nautilus的图标 ,点击 选择 首选项

在 视图标签页 找到 Experimental 去掉下边的打钩 Use the new views 就可以支持拖拽了.

小马 回复

你好,请问你提到的Genymotion-ARM-Translation.zip,支持8.0的这个包在哪里下载?可否提供一下下载地址呢。谢谢

小马 回复

感谢提供,不过这个arm包我试了,只能让x86模拟器安装不支持x86指令集的app,但是如果app本身只包含arm的so库,即使安装上去了,加载so库也会是失败的,不支持arm指令集,就是说这个arm包没有真正做到指令集的转换

小马 #5 · July 04, 2018 作者
tangpizi 回复

对 就是让包含arm的app能安装到genymotion里啊 你想arm指令集转换用什么高级功能 实现什么目标?

小马 回复

请教一个问题,安装完ARM指令包以后,apk能安装了,但是安装完成后直接报错,Wechat keeps stopping.
想通过模拟器来做微信小程序的自动化的,从AVD找到Genymotion,X86让人很无奈啊。
有没有其他解决方案啊?多谢。

小马 #7 · July 12, 2018 作者
Kevin Gu 回复

用7.1.0 7.0.0 的试一下 我这边8.0 也是安装apk正常的

小马 回复

试了7.0,7.1还是不行,和8.0是一样的错误。
现在Genymotion下载的image都是没有google apps和arm的。
刷完上面Genymotion-ARM-Translation.zip后,还需要自己刷Gapps啊?
我尝试自己刷了apps(https://opengapps.org/)后,还是一样无法运行微信。
你正常安装apk后,能正常使用么。

小马 #9 · July 12, 2018 作者
Kevin Gu 回复

我都可以 装apk 提示我什么arm不支持的话 我就用Genymotion-ARM-Translation.zip 要不你在去搜搜其他类似的Genymotion-ARM-Translation.zip 装试试 网上有挺多版本的Genymotion-ARM-Translation.zip 但我没找到官方的这个发布地址 你可以试试找找官方的发布地址 用官方的看看 我是用的别人网盘里的。

Update:
给需要帮助的人,楼主贴的Genymotion-ARM-Translation.zip文件不是通用的,每个Android版本对应ARM指令集的版本也是不一样。
简而言之就是:libhoudini.so是有Android版本要求的。
所以,如果你在Genymotion上使用Android 8.0(Oreo),就需要刷对应的Genymotion-ARM-Translation文件。


分割线,怎么确定自己刷的libhoudini.so文件是否正确呢?
1.通过adb install安装arm apk时,比如安装wechat,如果terminal有下面的报错:

WARNING: linker: libhoudini.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

这说明libhoudini.so文件的版本不对。
2.安装完APK后,APK无法征程运行。


附件:下面的链接中有几个Android版本对应的Genymotion-ARM-Translation,亲测oreo有效。
https://mega.nz/#F!JhcFwKpC!yfhfeUzvIZoSdBgfdZ9Ygg

楼主有AVD arm解决方法吗

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up