# [Q] adb push- why am I getting permission denied?



## jorozco077 (May 3, 2012)

phone: LG esteem ms910
Rooted: Yes
I'm trying to adb push a .apk file into my phones /system/app folder. These are the steps I am taking in trying to do this, but I am getting a permission denied response at the "adb push" part. Oh and my phone is under the "internet connection" setting. The other two (mass storage, charge only) wont let my phone enter debugging mode. 


```
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
exit
exit

adb push C:\Myfile.apk /system/app
```

Also when I enter the "mount -o remount,rw /dev/block/stl9 /system" command, It pops up twice but without the # symbol, not sure if there is an error there but it ends up looking like this:


```
C:\Android\android-sdk\platform-tool>adb shell
$ su
# mount -o remount,rw /dev/block/stl9 /system
mount -o remount,rw /dev/block/stl9 /system
# exit
exit
$ exit
exit 

C:\Android\android-sdk\platform-tool>
```


----------



## imheroldman (May 3, 2012)

I think you would want it to be on charge only, as the other options are utilizing the USB while charge only does not.  That is how my setup functions... I did have the permission denied error before when I was using Ubuntu 10.04.  Are you sure you have an up to date version of JDK? And the USB rules?


----------



## djodjoni (May 3, 2012)

your command should be 

adb push C:\Myfile.apk /system/app/myfile.apk

you have also to run adb as root or enable rw for /system/app

Basically:
______________________________________________
 adb shell
su
mount -o remount,rw /dev/block/stl9 /system
chmod 777 /system/app
exit
exit

adb push C:\Myfile.apk /system/app/myfile.apk

________________________________________________

should do the job


----------



## jorozco077 (May 4, 2012)

@imheroldman- I tried leaving it on charge only, but the devices wasnt found when I ran the adb devices command, and yes the JDK is the latest.

@djodjoni -Hey I tried your suggestions and it worked.

Thanks to the both of you for helping.


----------



## Ajfink (Nov 29, 2014)

FWIW, I got permission denied errors when I tried to push busybox via adb.  I just downloaded a busybox .zip and flashed it via TWRP, it seems to have worked, and the busybox app recognizes it as installed.


----------



## kavinzhao (May 8, 2015)

I can't use adb push. It says Read Only file system when I try to push things to /sdcard.  Don't know why


----------



## NOOK!E (May 9, 2015)

kavinzhao said:


> I can't use adb push. It says Read Only file system when I try to push things to /sdcard.  Don't know why

Click to collapse



Use this:


```
[path] > adb shell
# mount -o rw,remount rootfs /
# chmod 777 /sdcard
# exit

[path] > adb push [file path on your PC] /sdcard
```


----------



## kavinzhao (May 9, 2015)

ИΘΘK¡€ said:


> Use this:
> 
> 
> ```
> ...

Click to collapse



Thanks. I was using the recovery to receive before this. I think that should save me some time.


----------



## Administr4tor (Feb 17, 2016)

hello, I am having same problem, can you please help me out? 
[email protected]_himaulatt:/data/local # adb push C:\firewater /data/local/temp
adb push C:\firewater /data/local/temp
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/local/
adb push C:\firewater /data/local/
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/l
adb push C:\firewater /data/l
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/
adb push C:\firewater /data/
error: device not found
1|[email protected]_himaulatt:/data/local # cd ..
cd ..
[email protected]_himaulatt:/data # cd ..
cd ..
[email protected]_himaulatt:/ # exit
exit
[email protected]_himaulatt:/ $ exit
exit

C:\Users\Winpc\Downloads\fastboot-win>adb push C:\firewater /data/local/temp
failed to copy 'C:\firewater' to '/data/local/temp/firewater': Permission denied

C:\Users\Winpc\Downloads\fastboot-win>adb wait-for-devices push firewater /data/local/temp
failed to copy 'firewater' to '/data/local/temp/firewater': Permission denied

C:\Users\Winpc\Downloads\fastboot-win>adb shell
[email protected]_himaulatt:/ $ su
su
[email protected]_himaulatt:/ # mount -o rw,remount rootfs/
mount -o rw,remount rootfs/
Usage: mount [-r] [-w] [-o options] [-t type] device directory
1|[email protected]_himaulatt:/ # mount -o rw,remount rootfs /
mount -o rw,remount rootfs /
[email protected]_himaulatt:/ # chmod 777 /sdcard
chmod 777 /sdcard
[email protected]_himaulatt:/ # exit
exit
[email protected]_himaulatt:/ $ adb push C:\firewater /data/
adb push C:\firewater /data/
error: device not found
1|[email protected]_himaulatt:/ $ exit
exit

C:\Users\Winpc\Downloads\fastboot-win>adb wait-for-devices push firewater /data/local/temp
failed to copy 'firewater' to '/data/local/temp/firewater': Permission denied

C:\Users\Winpc\Downloads\fastboot-win>


----------



## XeoNoX (Oct 8, 2016)

Make sure you have phone detected and correct drivers and adb installed. 

*Once ADB is functioning properly*, then let's PUSH files!

First let's make sure adb is running and make sure adb see's the phone. Please run these commands:


```
adb kill-server
adb start-server
adb devices
```

The output after devices will be a serial number, if this looks good, move on. First you need to make 
sure the apk you want to push is in the same directory as adb.exe 
once you have moved the apk to the adb.exe directory, then run the following:


```
[FONT=Verdana]adb remount 
adb push myfile.apk /system/app/ 
adb shell chmod 644 /system/app/myfile.apk
adb reboot[/FONT]
```

adb remount mounts the phone as read write so you can write thru adb, it will be automatically unmounted when phone disconnected or rebooted
assuming your APK you want moved is called "myfile.apk"
adb push file_myfile.apk /system/app/  this command moves the "myfile.apk" (the apk you want moved) to the  /system/app/  directory on your phone
adb shell chmod 644 /system/app/myfile.apk  this command sets the correct file permissions for APKs
adb reboot  this reboots the phone so that the new apk can be detected

Good luck


----------



## opalescent (Feb 7, 2018)

hi:
phone is rooted;
android 5.0 ;
adb start-server is OK;
adb devices is OK;
adb root is adbd is already running as root;
system and system/app are "chomd is 777 ";

I want to "adb push myfile /system/app/ "
Question:  Permission denied .
 - - 
thx

other:
adb remount is Permission denied too.
"adb push ./build.gradle /storage/sdcard0/ " is OK.


----------



## XeoNoX (Dec 5, 2018)

opalescent said:


> hi:
> phone is rooted;
> android 5.0 ;
> adb start-server is OK;
> ...

Click to collapse



sounds like you possibly do not have proper permission for the user you are logged into your computers operating system with. make sure you have the proper permissions and rights to access the folders you are trying to access. For a quick fix you can try loging into the system using the root user or administrator of the system that you are using and then try the adb commands. and you can just do a quick su switch from the Computer OS's konsole/terminal.


----------



## slicer2k (Mar 28, 2019)

XeoNoX said:


> First you need to make sure the apk you want to push is in the same directory as adb.exe

Click to collapse



OMG thanks, mine wasn't working because something as simple as that!


----------

