Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Help on pushing files to device (ADB)

OP TheArc

12th March 2014, 08:34 AM   |  #1  
TheArc's Avatar
OP Recognized Themer
Flag Auckland City
Thanks Meter: 1,833
 
2,369 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Hello guys, experiencing another problem now

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 by TheArc; 12th March 2014 at 01:37 PM.
12th March 2014, 08:50 AM   |  #2  
Senior Member
Flag New Delhi
Thanks Meter: 57
 
336 posts
Join Date:Joined: Apr 2013
More
The easiest way I know to push files to /system through adb is using a custom recovery . Try with it.
Last edited by varuntis1993; 12th March 2014 at 10:24 AM.
12th March 2014, 10:17 AM   |  #3  
gee2012's Avatar
Recognized Contributor
Flag Heerlen
Thanks Meter: 3,248
 
8,819 posts
Join Date:Joined: Jul 2010
More
Why not use usb or AirDroid to transfer files?
12th March 2014, 10:25 AM   |  #4  
TheArc's Avatar
OP Recognized Themer
Flag Auckland City
Thanks Meter: 1,833
 
2,369 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Quote:
Originally Posted by gee2012

Why not use usb or AirDroid to transfer files?

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

Quote:
Originally Posted by varuntis1993

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? (;
12th March 2014, 10:27 AM   |  #5  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 13,476
 
24,582 posts
Join Date:Joined: Aug 2010
More
Quote:
Originally Posted by krishneelg3

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.
The Following User Says Thank You to rootSU For This Useful Post: [ View ]
12th March 2014, 10:30 AM   |  #6  
Senior Member
Flag New Delhi
Thanks Meter: 57
 
336 posts
Join Date:Joined: Apr 2013
More
Quote:
Originally Posted by krishneelg3


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
The Following User Says Thank You to varuntis1993 For This Useful Post: [ View ]
12th March 2014, 10:30 AM   |  #7  
TheArc's Avatar
OP Recognized Themer
Flag Auckland City
Thanks Meter: 1,833
 
2,369 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Quote:
Originally Posted by rootSU

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? (;
12th March 2014, 10:34 AM   |  #8  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 13,476
 
24,582 posts
Join Date:Joined: Aug 2010
More
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 test.txt /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
test.txt
tts
usr
vendor
xbin
root@android:/system #
The Following 2 Users Say Thank You to rootSU For This Useful Post: [ View ]
12th March 2014, 10:43 AM   |  #9  
TheArc's Avatar
OP Recognized Themer
Flag Auckland City
Thanks Meter: 1,833
 
2,369 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Quote:
Originally Posted by rootSU

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 test.txt /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
test.txt
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? (;

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes