Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,778,176 Members 51,300 Now Online
XDA Developers Android and Mobile Development Forum

Help on pushing files to device (ADB)

Tip us?
 
TheArc
Old
(Last edited by TheArc; 12th March 2014 at 12:37 PM.)
#1  
TheArc's Avatar
Recognized Themer - OP
Thanks Meter 1726
Posts: 2,169
Join Date: Jan 2012
Location: Auckland City
Default Help on pushing files to device (ADB)

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.
iOS7 Kik Messenger | Svelte UI CM11 Theme | Active Launcher
 
varuntis1993
Old
(Last edited by varuntis1993; 12th March 2014 at 09:24 AM.)
#2  
Senior Member
Thanks Meter 51
Posts: 306
Join Date: Apr 2013
Location: New Delhi
The easiest way I know to push files to /system through adb is using a custom recovery . Try with it.
Devices
Nexus 5- 32Gb D821
Nexus 7 2013-16Gb flo
 
gee2012
Old
#3  
gee2012's Avatar
Recognized Contributor
Thanks Meter 2959
Posts: 8,095
Join Date: Jul 2010
Location: Heerlen
Why not use usb or AirDroid to transfer files?
USE Search: /this thread /all threads/Google before posting your question, you`re most likely not the first one having this issue
Unofficial elelinux CM 11.0 (4.4.4) stock kernel
 
TheArc
Old
#4  
TheArc's Avatar
Recognized Themer - OP
Thanks Meter 1726
Posts: 2,169
Join Date: Jan 2012
Location: Auckland City
Quote:
Originally Posted by gee2012 View Post
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 View Post
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? (;
iOS7 Kik Messenger | Svelte UI CM11 Theme | Active Launcher
 
rootSU
Old
#5  
rootSU's Avatar
Senior Member
Thanks Meter 10730
Posts: 21,875
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Quote:
Originally Posted by krishneelg3 View Post
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.
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following User Says Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
varuntis1993
Old
#6  
Senior Member
Thanks Meter 51
Posts: 306
Join Date: Apr 2013
Location: New Delhi
Quote:
Originally Posted by krishneelg3 View Post

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
Devices
Nexus 5- 32Gb D821
Nexus 7 2013-16Gb flo
The Following User Says Thank You to varuntis1993 For This Useful Post: [ Click to Expand ]
 
TheArc
Old
#7  
TheArc's Avatar
Recognized Themer - OP
Thanks Meter 1726
Posts: 2,169
Join Date: Jan 2012
Location: Auckland City
Quote:
Originally Posted by rootSU View Post
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? (;
iOS7 Kik Messenger | Svelte UI CM11 Theme | Active Launcher
 
rootSU
Old
#8  
rootSU's Avatar
Senior Member
Thanks Meter 10730
Posts: 21,875
Join Date: Aug 2010
Location: 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 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 #
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following 2 Users Say Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
TheArc
Old
#9  
TheArc's Avatar
Recognized Themer - OP
Thanks Meter 1726
Posts: 2,169
Join Date: Jan 2012
Location: Auckland City
Quote:
Originally Posted by rootSU View Post
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? (;
iOS7 Kik Messenger | Svelte UI CM11 Theme | Active Launcher

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes