Android: adb: copy file to /system (Permission denied)

a 夏天 提交于 2019-12-30 00:57:05

问题


actually I try to install busybox on my HTC Desire. Therefore I try to copy a busybox-binary to /system/bin. So I remounted /system with rw:

mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

After this I didn't get a "Read-only file system"-error. But now I'm experiencing "Permission denied" when trying to push the file to /system/bin. I also tried pushing my file to /sdcard and then move this to /system/bin, but this doesn't work either:

$ mv /sdcard/busybox /system/bin
failed on '/sdcard/busybox' - Cross-device link

Some ideas, how to solve this problem?


回答1:


Do a mount to check if the device really was remounted as RW.

The same error happened to me, then I simply made a cp orig dest and then a rm on orig, weird but seams mv behaves this way.




回答2:


Mounting is not enough, you have to run as root (this is the reason for permission denied). This is how I push busybox:

adb root
adb remount
adb push busybox /system/bin

I run into some devices that you need to remount with mount -o remount,rw /system and not with adb remount.




回答3:


Not sure but since you asked for ideas I'll mention that I never specified the -t option.

mount -o remount,rw /system

always worked for me




回答4:


mv just moves a hardlink within a single filesystem. If you want to move files between two filesystems you need to copy and then delete the original. e.g.

if ( cp -R /sdcard/busybox /system/bin ); then
rm -fR /sdcard/busybox
fi



回答5:


If some command is not working, try putting busybox in front of it. (if installed)

f.ex.

root@android:/ # mv /sdcard/androidLTheme/bootanim/bootanimation.zip /system/media/
failed on '/sdcard/androidLTheme/bootanim/bootanimation.zip' - Cross-device link
root@android:/ # _

but

root@android:/ # busybox mv /sdcard/androidLTheme/bootanim/bootanimation.zip /system/media/
root@android:/ # _


来源:https://stackoverflow.com/questions/10864907/android-adb-copy-file-to-system-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!