解锁并刷入三方recovery
首先需要解锁bootloader,否则无法刷入三方recovery。笔者几年前就已经解锁了,解锁过程忘记了,且解锁链接www.emui.com/plugin.php?id=unlock已经失效。
将下载的twrp-3.1.1.img镜像重命名为recovery.img,开启usb调试并将手机通过usb连接电脑,使用如下命令刷入recovery镜像
1.进入fastboot模式
adb reboot bootloader
使用fastboot devices查看是否已连接
2.将recovery.img刷入recovery分区
fastboot flash recovery recovery.img
出现如下结果即为安装成功
3.重启
fastboot reboot
root
将下载的SuperSU.zip发送到sd卡adb push SuperSU.zip /mnt/sdcard/,手机关机后按住音量+与电源键,进入recovery模式。点击install,在sdcard下选择SuperSU.zip,安装成功后重启即可。
安装xposed framework
安卓5以上版本下安装xposed需要卡刷xposed-vXX-sdkXX-XXX.zip,下载地址https://dl-xda.xposed.info/framework/ 。
vXX代表xposed framework版本号
sdkXX代表安卓系统api级别, sdk21代表5.0系统;sdk22代表5.1系统;sdk23代表6.0系统
XXX代表设备cpu架构,笔者手机为arm。
将下载的zip文件(华为4a对应的zip文件是xposed-v86-sdk22-arm.zip)发送到sd卡根目录下,使用与安装SuperSU.zip相同的步骤安装。安装完成后下载安装xposed-installer.apk即可。
安装xposed成功
启用调试(安卓5.1.1无效)
修改/system/build.prop,添加ro.secure=0, ro.debuggable=1
adb shell进入设备
# mount -o rw,remount /system # echo '\nro.secure=0\nro.debuggable=1\n' >> /system/build.prop # mount -o ro,remount /system # reboot |
启用hierachyViewer
安装并激活xinstaller模块,打开调试应用选项。
如果hierachy viewer报如下错误
[2018-05-11 18:04:57 - ViewServerDevice]Unable to debug device: scl_tl00h-JTJ4C15717045443 [2018-05-11 18:04:57 - hierarchyviewer]Missing forwarded port for JTJ4C15717045443 [2018-05-11 18:04:57 - hierarchyviewer]Unable to get the focused window from device JTJ4C15717045443 |
关闭android studio与其他ddms进程
$ export ANDROID_HVPROTO=ddm $ /Opt/tools/android-sdk/tools/monitor |
引用自Profile Your Layout with Hierarchy Viewer
1.Enable Developer Options on your device.
2.Set the environment variable ANDROID_HVPROTO=ddm on your development machine.
This variable tells Hierarchy Viewer to connect to the device using the ddm protocol, which is the same as the DDMS protocol. The caveat is that there can be only one process on the host that connects to the device, so you must kill any other DDMS session to run Hierarchy Viewer.
就是说使hierachy viewer通过ddm协议连接设备,但只能有一个进程与设备连接,所以需要关闭其他ddms会话。
上文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理。