使用bat脚本,执行对android设备文件的覆盖
@echo off
adb root
adb push hosts /etc/
pause
adb已经获取到root权限,当尝试替换/etc/hosts文件,在执行adb push命令时,报错:read-only file system。
adb: error: failed to copy 'hosts' to '/etc/hosts': remote Read-only file system
这个问题是因为android的系统分区默认挂载为只读。解决方法就是重新挂载系统分区。
adb root
adb shell mount -o remount /system
adb push hosts /etc/