So I'm just trying to modify the hosts file on a family members phone. I've put the phone in debug mode and pulled the hosts file, edited it, but when I try to push it I get the message, "adb: error: failed to copy 'D:/hosts\hosts' to '/system/etc/hosts/hosts': remote couldn't create file: Not a directory"
Here's the commands I've used:
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
This is my first time using android debugging/adb and nothing else I've read helped. Thanks in advance.
EDIT: So I've made a little progress. I realized that the hosts file is not in a hosts directory, so I changed it to adb push D:\hosts /system/etc
which still didn't work, but adb push D:\hosts\hosts /system/etc
gave me the response adb: error: failed to copy 'D:\hosts\hosts' to '/system/etc/hosts': remote couldn't create file: Read-only file system
So it looks like my problem is now in adb shell chmod
EDIT2: So after some more research I came across this Read only file system on Android. When trying mount -o rw,remount /system
I get mount: '/dev/block/dm-0' not user mountable in fstab
. In the mounts file /dev/block/dm-0 is on /system. The new problem is fstab is not located in /etc
EDIT3: It looks like my big problem is I have to root the phone I think. I don't have su or sudo to do the remount. Seeing as it's not mine, I don't want to root the phone.