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

小马 · 2018年05月23日 · 最后由 洛凉 回复于 2019年05月10日 · 1448 次阅读

简介

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 条回复 时间 点赞
小马 #10 · 2018年05月25日 Author

修正:

sudo nautilus

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

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

小马 回复

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

小马 回复

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

tangpizi 回复

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

小马 回复

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

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 后,能正常使用么。

小马 #11 · 2018年07月12日 Author
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 解决方法吗

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册