没有不值得去解决的问题,也没有不值得去学习的技术!

在 Windows 10 64、Oracle VM VirtualBox 5.2.2 下安装运行 Genymotion 2.11.0,以测试本地H5页面

打开 /sdcard/storage/kf.txt,复制某页面的链接,在浏览器中打开

1、打开网址:https://www.genymotion.com/download/ ,由于已经安装了 Oracle VM VirtualBox,所以选择 without VirtualBox,如图1

打开网址:https://www.genymotion.com/download/ ,由于已经安装了 Oracle VM VirtualBox,所以选择 without VirtualBox
图1

2、安装完毕后,新建一个虚拟设备,Android version 选择 7.0.0,最终选择 Samsung Galaxy S8 – 7.0.0,下一步,如图2

安装完毕后,新建一个虚拟设备,Android version 选择 7.0.0,最终选择 Samsung Galaxy S8 - 7.0.0,下一步
图2

3、新建完毕,点击 Start 按钮,启动设备,如图3

新建完毕,点击 Start 按钮,启动设备
图3

4、打开浏览器,输入百度网址,测试,正常,如图4

打开浏览器,输入百度网址,测试,正常
图4

5、打开 Windows PowerShell,执行命令:ipconfig,查看最后一个 VirtualBox Host-Only Network #3,如图5

打开 Windows PowerShell,执行命令:ipconfig,查看最后一个 VirtualBox Host-Only Network #3
图5

6、打开网址:192.168.118.2/phpinfo.php,报错:URISyntaxException: Illegal character in path at index 0: 192.168.118.2/phpinfo.php,如图6

打开网址:192.168.118.2/phpinfo.php,报错:URISyntaxException: Illegal character in path at index 0: 192.168.118.2/phpinfo.php
图6

7、打开 Oracle VM VirtualBox,设置 Samsung Galaxy S8 – 7.0.0 的网络,网卡1,混杂模式:全部允许,如图7

打开 Oracle VM VirtualBox,设置 Samsung Galaxy S8 - 7.0.0 的网络,网卡1,混杂模式:全部允许
图7

8、再次打开网址:192.168.118.2/phpinfo.php,正常,如图8

再次打开网址:192.168.118.2/phpinfo.php,正常
图8

9、使用域名(default.interact.shenzhen.localhost)连接到本地 摇一摇 网站,编辑hosts,类似于本地的hosts,如图9

使用域名(default.interact.shenzhen.localhost)连接到本地 摇一摇 网站,编辑hosts,类似于本地的hosts
图9

10、以管理员身份运行,打开 Windows PowerShell,进入工具目录,依次执行如下命令,如图10
cd ‘C:\Program Files\Genymobile\Genymotion\tools’
.\adb devices
.\adb root
.\adb remount
.\adb pull /system/etc/hosts hosts
ls

以管理员身份运行,打开 Windows PowerShell,进入工具目录,依次执行如下命令
图10

11、执行命令:ipconfig,复制 以太网适配器 以太网: IPv4 地址,如图11

执行命令:ipconfig,复制 以太网适配器 以太网: IPv4 地址
图11

12、编辑:C:\Program Files\Genymobile\Genymotion\tools\hosts,如图12
172.28.28.18 default.interact.shenzhen.localhost

编辑:C:\Program Files\Genymobile\Genymotion\tools\hosts
图12

13、执行如下命令,如图13
.\adb push hosts /system/etc/hosts

执行如下命令
图13

14、打开网址:default.interact.shenzhen.localhost,报错:Webpage not available,如图14

打开网址:default.interact.shenzhen.localhost,报错:Webpage not available
图14

15、调整第12步骤,放弃使用 Windows 编辑器 EditPlus,使用 Linux 编辑,通过 FTP 上传与下载,如图15

调整第12步骤,放弃使用 Windows 编辑器 EditPlus,使用 Linux 编辑,通过 FTP 上传与下载
图15

16、执行如下命令:,正常,如图16
.\adb push hosts /system/etc/hosts
.\adb shell cat -e /system/etc/hosts
.\adb shell ping default.interact.shenzhen.localhost

执行如下命令:,正常
图16

17、打开网址:default.interact.shenzhen.localhost,报错:Webpage not available,如图14

打开网址:default.interact.shenzhen.localhost,报错:Webpage not available
图14

18、打开网址:http://www.ghisler.com/android.htm#download ,下载 Total Commander,如图18

打开网址:http://www.ghisler.com/android.htm#download ,下载 Total Commander
图18

19、拖拽 tcandroid280.apk 至 虚拟设备中,点击 Allow 按钮,如图19

拖拽 tcandroid280.apk 至 虚拟设备中,点击 Allow 按钮
图19

20、依次点击 File system root、etc、hosts、Edit file ,如图20、21、22、23

File system root
图20
etc
图21
hosts
图22
Edit file
图23

21、虽然发现hosts文件中已经存在修改记录,建议重新编辑一次,如图24、25、26、27、28

Save as...
图24
OK
图25
Overwrite File?
图26
Superuser Request
图27

22、编辑失败,如图29

编辑失败
图29

23、新建一个虚拟设备,Samsung Galaxy S7 – 6.0.0,基于 Total Commander 编辑 hosts 成功,如图30

新建一个虚拟设备,Samsung Galaxy S7 - 6.0.0,基于 Total Commander 编辑 hosts 成功
图30

24、打开网址:default.interact.shenzhen.localhost,报错:Webpage not available,如图14

打开网址:default.interact.shenzhen.localhost,报错:Webpage not available
图14

25、新建一个虚拟设备,Samsung Galaxy S6 – 5.1.0,基于 Total Commander 编辑 hosts 成功,且打开网址:default.interact.shenzhen.localhost,正常,如图31

新建一个虚拟设备,Samsung Galaxy S6 - 5.1.0,基于 Total Commander 编辑 hosts 成功,且打开网址:default.interact.shenzhen.localhost,正常
图31

26、由于需要复制网址至虚拟设备中,在VirtualBox中,Samsung Galaxy S6 – 5.1.0,常规 – 高级 – 共享粘贴板与拖放 – 双向,如图32

由于需要复制网址至虚拟设备中,在VirtualBox中,Samsung Galaxy S6 - 5.1.0,常规 - 高级 - 共享粘贴板与拖放 - 双向
图32

27、关闭虚拟设备,拖拽 kf.txt 至虚拟设备中,提示成功,但是在虚拟设备中不存在,如图33

关闭虚拟设备,拖拽 kf.txt 至虚拟设备中,提示成功,但是在虚拟设备中不存在
图33

28、以管理员身份运行,打开 Windows PowerShell,进入工具目录,依次执行如下命令:
cd ‘C:\Program Files\Genymobile\Genymotion\tools’
.\adb devices
.\adb root
.\adb remount
.\adb push kf.txt /sdcard/storage/kf.txt

29、在虚拟设备中,/sdcard/storage/kf.txt已经存在,如图34

在虚拟设备中,/sdcard/storage/kf.txt已经存在
图34

30、打开 /sdcard/storage/kf.txt,复制某页面的链接,在浏览器中打开,如图35

打开 /sdcard/storage/kf.txt,复制某页面的链接,在浏览器中打开
图35

31、此页面是摇一摇的页面,发现还是无法测试了,没有找到有效方法模拟的。

 

 

需要长期技术维护或远程问题排查?

我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。

如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:

  • ✅ PHP / Laravel / Yii2 老项目无人维护
  • ✅ Go / Gin 后端接口需要排查或优化
  • ✅ WordPress 网站访问慢、报错或插件冲突
  • ✅ Nginx / MySQL / Redis / Linux 服务器异常
  • ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
  • ✅ 需要长期远程技术支持或兼职维护

更多介绍请查看:关于我 & 合作

微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理