# ADB: Permission Denied



## infor42 (Aug 17, 2012)

My phone as suddenly stopped letting me use ADB. Yesterday it worked fine, and now any time I try to use an ADB command I get a Permission Denied error. I am trying to push an app to /system/app/ and I have mounted it r/w with rootexplorer, but it still will not let me push the app. I'm guessing I have something messed up in a config file somewhere in the OS but I don't have any clue how or where. Anyone know what I could do?


----------



## techspecs (Jul 16, 2011)

You could try a chmod 777. What OS are you using adb on?

Sent from my Galaxy Nexus using Tapatalk 2


----------



## knivesout (Dec 1, 2011)

There's no need for mounting/unmounting partitions in root explorer, partitions can be mounted in ADB, but I've never had to in order to able to push/pull a file. Are you on CM10 or a rom based on it? In developer options, the default for root access is "apps only", but you can also switch it to "apps and adb".


----------



## infor42 (Aug 17, 2012)

I am on a version of cm10. The problem isn't that system is mounted as rw. I have tried mounting it both through root explorer and adb shell, and it is successful both ways, but I still get the error of Permissions Denied (before I mount it it gives me an error about it not being mounted, and after mounting I get the Permission Denied error). I have had root access on adb and apps and adb only, but it still doesn't work.


----------



## jellybellys (Apr 3, 2012)

Have you tried starting adb with sudo?

sudo adb kill-server
sudo adb start-server
adb devices


----------



## infor42 (Aug 17, 2012)

jellybellys said:


> Have you tried starting adb with sudo?
> 
> sudo adb kill-server
> sudo adb start-server
> adb devices


I'm on windows! The problem isn't that my computer does not recognize the device. It recognizes it fine, but it gives me an error whenever I try to push anything to /system


----------



## jellybellys (Apr 3, 2012)

infor42 said:


> I'm on windows! The problem isn't that my computer does not recognize the device. It recognizes it fine, but it gives me an error whenever I try to push anything to /system


You did do adb remount right?


----------



## mwalt2 (Sep 12, 2011)

You need an insecure kernel to write to /system while it's running. You can push anything you want with a stock kernel while in recovery using adb.


----------



## Jubakuba (Sep 8, 2011)

adb shell
su
mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system
exit
exit

adb push away, sir.


----------



## nhat (Aug 21, 2011)

Running the cmd prompt with admin rights?


----------



## Jubakuba (Sep 8, 2011)

nhat said:


> Running the cmd prompt with admin rights?


LULZSHUTUP.


----------



## infor42 (Aug 17, 2012)

Wow. I don't understand what is wrong with this. I just tried Jubakuba's solution and it worked... but after I closed that command prompt the error is back and no matter how many times i recreate my exact steps when it worked, it will not work again. I have tried running cmd as administrator also.



mwalt2 said:


> You need an insecure kernel to write to /system while it's running. You can push anything you want with a stock kernel while in recovery using adb.


I'm pretty sure this is the problem. Should I just install another kernel?


----------



## infor42 (Aug 17, 2012)

bump?


----------



## sledge3n8 (Dec 1, 2011)

Have you tried to "fix permissions" in recovery? This fixes most of my issues when they occur.

Sent from my Galaxy Nexus using Tapatalk 2


----------



## infor42 (Aug 17, 2012)

sledge3n8 said:


> Have you tried to "fix permissions" in recovery? This fixes most of my issues when they occur.
> 
> Sent from my Galaxy Nexus using Tapatalk 2


Just tried this, didn't work


----------



## infor42 (Aug 17, 2012)

I just gave up and flashed a custom kernel, and the problem is gone. Oh well.


----------



## mwalt2 (Sep 12, 2011)

infor42 said:


> I just gave up and flashed a custom kernel, and the problem is gone. Oh well.


That was exactly your problem. You could type in that command Jubakuba gave you before pushing things to /system every time or just get an insecure boot.img. If you want the stock kernel, you can easily make it insecure by using dsixda kitchen to extract and modify the ramdisk from boot.img. I can't believe all of the suggestions people were giving you lol .


----------



## infor42 (Aug 17, 2012)

mwalt2 said:


> That was exactly your problem. You could type in that command Jubakuba gave you before pushing things to /system every time or just get an insecure boot.img. If you want the stock kernel, you can easily make it insecure by using dsixda kitchen to extract and modify the ramdisk from boot.img. I can't believe all of the suggestions people were giving you lol .


Yea I know lol. A lot of people didn't understand what I was asking. It wasn't that I couldn't mount /system as r/w, but that something else was denying me permission. The reason the kernel I was using was secure is because it is a kernel I built myself from source. Now that I know where the problem was I'll go in and fix the ramdisk. Thanks so much for the help!


----------

