genymotion 修改 hosts Root Access
Rooting allows Android mobile operating system users to reach privileged control (known as root access) over various Android subsystems. As Android uses the Linux kernel, rooting an Android device gives similar access to administrative (superuser) permissions as on Linux or any other Unix-like operating systems such as FreeBSD or macOS.
Only Android 10.0-13.0 images can be dynamically rooted or unrooted since Genymotion Device image ver. 13.2. Other images are all rooted and cannot be unrooted yet.
设置 Root 访问:
adb shell setprop persist.sys.root_access 3
还原Root访问:
adb shell setprop persist.sys.root_access 0
检查Root访问是否设置成功:
adb shell getprop persist.sys.root_access
重新挂载权限:
adb remount
此时再执行 vi /etc/hosts 即可以进行正常编辑文件
https://docs.genymotion.com/paas/10_Using_root_access/
其它问题:
经测试Android的版本号 11.0的是可以的, 而12.1或13都都无法正常remount
12.1 和 13 remount 时, 报错如下: