Jam*_*mes 5 android push file hosts adb
所以我只是想修改家庭成员手机上的主机文件。我已将手机置于调试模式并提取主机文件,对其进行编辑,但是当我尝试推送它时,我收到消息“adb:错误:无法将‘D:/hosts\hosts’复制到‘/system’ /etc/hosts/hosts':远程无法创建文件:不是目录”
这是我使用过的命令:
adb pull /system/etc/hosts D:\hosts
/system/etc/hosts: 1 file pulled. 0.0 MB/s (56 bytes in 0.003s)
adb push D:\hosts /system/etc/
adb: error: failed to copy 'D:\hosts\hosts' to '/system/etc/hosts/hosts': remote couldn't create file: Not a directory
Run Code Online (Sandbox Code Playgroud)
这是我第一次使用 android debug/adb,我读过的其他内容都没有帮助。提前致谢。
编辑:所以我取得了一些进展。我意识到主机文件不在主机目录中,所以我将其更改为adb push D:\hosts /system/etc
仍然不起作用,但adb push D:\hosts\hosts /system/etc
给了我响应adb: error: failed to copy 'D:\hosts\hosts' to '/system/etc/hosts': remote couldn't create file: Read-only file system
所以看起来我的问题现在在adb shell chmod
EDIT2:所以经过一些更多的研究,我在 Android 上发现了这个只读文件系统。当我尝试时,mount -o rw,remount /system
我得到了mount: '/dev/block/dm-0' not user mountable in fstab
。在挂载文件 /dev/block/dm-0 中,位于 /system 上。新问题是 fstab 不在 /etc 中
EDIT3:看来我的大问题是我认为我必须root手机。我没有 su 或 sudo 来重新安装。既然它不是我的,我不想root手机。