1.查看手机是否连接
C:\Users\wuxl>adb devices
List of devices attached
7z4abc0d device
2.获取root权限
C:\Users\wuxl>adb root
3.将手机hosts文件拉取到电脑
(/system/etc/hosts 是手机hosts所在目录;C:\Users\wuxl\Desktop\ 是拉取文件到电脑上的目录)
C:\Users\wuxl>adb pull /system/etc/hosts C:\Users\wuxl\Desktop\
4.在电脑上将hosts文件更改完成后,再push到手机上
C:\Users\wuxl>adb push C:\Users\wuxl\Desktop\hosts /system/etc/
如果在push的时候出现 failed: Read-only file system 的错误,分别执行下面命令即可
C:\Users\wuxl>adb disable-verity
C:\Users\wuxl>adb reboot
adb reboot之后会重启手机
C:\Users\wuxl>adb root
C:\Users\wuxl>adb remount
C:\Users\wuxl>adb push C:\Users\wuxl\Desktop\hosts /system/etc/
网友评论