Android模拟器怎么root

首先,参考这两篇文章,我这里是作补充说明
https://www.jianshu.com/p/fd39ec466e88

https://blog.csdn.net/ocean20/article/details/82798004

1.启动模拟器
emulator -list-avds查看avd列表
emulator -avd Nexus_5X_API_26 -writable-system启动avd

  • 在我的windows电脑上emulator -avd Nexus_5X_API_26 -writable-system报错

emulator: WARNING: System image is writable
emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
Please use -read-only flag to enable this feature.

解决方法如下:

Open Andrid Studio.打开AS。
Go to AVD Manager. 打开AVDManager。
In the Actions column, for the respective avd, click on the down arrow and click on Stop.
在AVD Manager中action一栏点击下拉箭头,点击stop关闭现有的模拟器。

启动成功后是这样的,然后光标不能动了,只能再开一个cmd窗口。

emulator: WARNING: System image is writable
HAX is working and emulator runs in fast virt mode.
Your emulator is out of date, please update by launching Android Studio:

  • Start Android Studio
  • Select menu “Tools > Android > SDK Manager”
  • Click “SDK Tools” tab
  • Check “Android Emulator” checkbox
  • Click “OK”

2.安装SuperSU
这一步没问题。

3.将su文件放入系统
这一步似乎没问题。但不应该拷贝su,而是su.pie
我选的x86,拷贝的是su文件,

adb -e push C:\Users\xxx\Downloads\supersu2.79recovery\supersu2.79recovery压缩包\x86\su /system/bin/su

后来遇到到这一步偶尔报错:

adb: error: failed to copy ‘C:\Users\linkage\Downloads\supersu2.79recovery\supersu2.79recovery压缩包\x86\su.pie’ to ‘/system/bin/su’: remote Read-only file system

解决方法:

首先,尝试以下命令:
adb root
adb remount
我到这里就直接OK了,可以push成功了。如果还不行,您就先执行一下:
adb disable-verity
adb reboot

还遇到过启动模拟器始终停在启动页,我直接在AVDManager里wipe data了

4.修改su文件权限
然后su root报错:

error: only position independent executables (PIE) are supported.

解决方法:
我电脑是windows,应该用x86下的su.pie

adb -e push C:\Users\linkage\Downloads\supersu2.79recovery\supersu2.79recovery压缩包\x86\su.pie /system/bin/su

接下来的步骤都很顺利了。

你可能感兴趣的:(逆向,root)