Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 496
red_trumpet Avatar asked Jun 02 '12 18:06

red_trumpet


People also ask

How do I fix denied permission on adb?

The reason for "permission denied" is because your Android machine has not been correctly rooted. Did you see $ after you started adb shell ? If you correctly rooted your machine, you would have seen # instead. If you see the $ , try entering Super User mode by typing su .

How do I get root permission from adb?

The general steps to enable it is Settings>About Phone and tab the Build Number seven times to unlock Developer Options. Now go to Developer Options in System Settings and activate the root option (ADB only or Apps and ADB). After this, adb will restart and you will be able to use root from the cmd line.


1 Answers

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.

like image 95
Ofir Luzon Avatar answered Sep 18 '22 15:09

Ofir Luzon