Help on pushing files to device (ADB)

Search This thread

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
Hello guys, experiencing another problem now :silly:

Have search all around, couldn't find any valid answers so I decided to ask myself.

So I was just making a rom, which I have already installed. It's based on Cataclysm (personal use only - Till I ask for perm).
I have installed the rom, then I decided to theme some system files. And so I did. I theme the "Settings.apk" for now, and decided to push it to my device instead of installing the whole rom over again. Now mind you when I made roms and modified system apps, pushing these files to the device was straight forward. However on this Hammerhead, I've been running into some issues.

When pushing the file to my device like this
Code:
adb push Settings.apk system/priv-app
.
I get an error that says -
Code:
failed to copy "Settings.apk" to "system/priv-app/Settings.apk" : Read only file system.

So I then decided to try the following -

Code:
[x] adb root - Permission Denied
[x] adb remount - Permission Denied

So then I decided to use some shell commands to set the system as rw, I did the following.

Code:
[x] adb shell
[x] $ su - gave it permission
[x] $ mount -o rw,remount /system - It mounts it.

I then restarted cmd with root permission.
Code:
adb root"
- it restarted however, this time it stated.
Code:
Device not found.

I probably did the wrong thing above, so how exactly can I push files to /system?

SOLVED

Thanks to everyone that answered my question in detail.
 
Last edited:

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
Why not use usb or AirDroid to transfer files?

Is it possible to push files to /sustem/priv-app with it?

The easiest way I know to push files to /system is using a custom recovery . Try with it.

How would I do so? I've ever only used recovery to flash. And that was it, thanks if you can guide me through it?

Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;
 

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
Is it possible to push files to /sustem/priv-app with it?



How would I do so? I've ever only used recovery to flash. And that was it, thanks if you can guide me through it?

Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;

Boot into recovery and connect the usb cable. Open a cmd prompt.

Code:
adb shell
mount /system
exit
adb push c:\users\krishneelg3\desktopmyfile /system/priv-app

You can also use the "mount system" option in recovery and skip the first 2 commands above.
 
  • Like
Reactions: TheArc

varuntis1993

Senior Member
Apr 7, 2013
383
78
New Delhi
How would I do so? I've ever only used recovery to flash. And that was it, thanks if you can guide me through it?

Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;

Open recovery, mount system partition and connect it to pc and then normal procedure.
It will be running as adbd to no need to type adb root. Hope this helps
 
  • Like
Reactions: TheArc

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
Boot into recovery and connect the usb cable. Open a cmd prompt.

Code:
adb shell
mount /system
exit
adb push c:\users\krishneelg3\desktopmyfile /system/priv-app

You can also use the "mount system" option in recovery and skip the first 2 commands above.

Thank you so much! Greatly appreciated.

Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;
 

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
You can still do it through Android, but it's more difficult because adb root doesn't always work (requires kernel) and you have to mount r/w which is just a pain. I always adb push in recovery.

However, here is an example of a successful attempt to adb push on my nexus 5.

Code:
C:\Users\rootsu\Desktop\tools>adb root
adbd is already running as root
C:\Users\rootsu\Desktop\tools>adb shell
root@android:/ # mount -o remount,rw /system
mount -o remount,rw /system
root@android:/ # exit
exit

C:\Users\rootsu\Desktop\tools>adb push [B][COLOR="Red"]test.txt[/COLOR][/B] /system/

C:\Users\rootsu\Desktop\tools>adb shell
root@android:/ # cd system
cd system
root@android:/system # ls
ls
addon.d
app
bin
build.prop
core
etc
fonts
framework
lib
lost+found
media
priv-app
[B][COLOR="red"]test.txt[/COLOR][/B]
tts
usr
vendor
xbin
root@android:/system #
 

TheArc

Inactive Recognized Themer
Jan 1, 2012
2,512
2,122
26
Auckland
You can still do it through Android, but it's more difficult because adb root doesn't always work (requires kernel) and you have to mount r/w which is just a pain. I always adb push in recovery.

However, here is an example of a successful attempt to adb push on my nexus 5.

Code:
C:\Users\rootsu\Desktop\tools>adb root
adbd is already running as root
C:\Users\rootsu\Desktop\tools>adb shell
root@android:/ # mount -o remount,rw /system
mount -o remount,rw /system
root@android:/ # exit
exit

C:\Users\rootsu\Desktop\tools>adb push [B][COLOR="Red"]test.txt[/COLOR][/B] /system/

C:\Users\rootsu\Desktop\tools>adb shell
root@android:/ # cd system
cd system
root@android:/system # ls
ls
addon.d
app
bin
build.prop
core
etc
fonts
framework
lib
lost+found
media
priv-app
[B][COLOR="red"]test.txt[/COLOR][/B]
tts
usr
vendor
xbin
root@android:/system #

Thank you I will keep my eye on this and see if the process is similar. Thanks for the info.

Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    You can still do it through Android, but it's more difficult because adb root doesn't always work (requires kernel) and you have to mount r/w which is just a pain. I always adb push in recovery.

    However, here is an example of a successful attempt to adb push on my nexus 5.

    Code:
    C:\Users\rootsu\Desktop\tools>adb root
    adbd is already running as root
    C:\Users\rootsu\Desktop\tools>adb shell
    root@android:/ # mount -o remount,rw /system
    mount -o remount,rw /system
    root@android:/ # exit
    exit
    
    C:\Users\rootsu\Desktop\tools>adb push [B][COLOR="Red"]test.txt[/COLOR][/B] /system/
    
    C:\Users\rootsu\Desktop\tools>adb shell
    root@android:/ # cd system
    cd system
    root@android:/system # ls
    ls
    addon.d
    app
    bin
    build.prop
    core
    etc
    fonts
    framework
    lib
    lost+found
    media
    priv-app
    [B][COLOR="red"]test.txt[/COLOR][/B]
    tts
    usr
    vendor
    xbin
    root@android:/system #
    1
    Is it possible to push files to /sustem/priv-app with it?



    How would I do so? I've ever only used recovery to flash. And that was it, thanks if you can guide me through it?

    Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;

    Boot into recovery and connect the usb cable. Open a cmd prompt.

    Code:
    adb shell
    mount /system
    exit
    adb push c:\users\krishneelg3\desktopmyfile /system/priv-app

    You can also use the "mount system" option in recovery and skip the first 2 commands above.
    1
    How would I do so? I've ever only used recovery to flash. And that was it, thanks if you can guide me through it?

    Sent from this toast making Nexus 5, you wish your Nexus could make toast don't you? (;

    Open recovery, mount system partition and connect it to pc and then normal procedure.
    It will be running as adbd to no need to type adb root. Hope this helps