Can Anyone Help Me Figure Out What I Am Doing Wrong With ADB Commands

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
I am new to using ADB and need a little help. Im trying to figure out the pushing and pulling of files. I connect my device and and turn on usb debugging and then reboot to recovery. I do the adb devices command and it shows my phones serial number connected. So just to practice I attempted to pull and then push my framework-res.apk file from my phone and back to my phone. Thought I was doing everything right but doesnt seem that way. After I pushed the file back I rebooted the phone and when the phone comes back up I get a crazy amount of errors/force closes for a ton of things. I restored my back up and was hoping maybe someone can let me know where I went wrong. I appreciate any help. Thank you.

First off I rebooted to recovery

C:\androidsdk\tools>adb reboot recovery <--- This command worked
Then once in recovery I tried the remount command

C:\androidsdk\tools>adb remount <--- This did not work I got the below error
remount failed: Unknown error: 0

I then found another way to mount the phone and ran it it seemed to work ok.

C:\androidsdk\tools>adb shell mount /system

C:\androidsdk\tools>adb shell ls /system
app build.prop fonts lib media usr
bin etc framework lost+found tts xbin

C:\androidsdk\tools>adb shell ls /system/framework
am.jar framework.jar
android.policy.jar ime.jar
android.test.runner.jar input.jar
bmgr.jar javax.obex.jar
com.google.android.maps.jar monkey.jar
core.jar pm.jar
ext.jar services.jar
framework-res.apk svc.jar
framework-tests.jar

C:\androidsdk\tools>adb pull /system/framework/framework-res.apk
567 KB/s (0 bytes in 5224198.008s)

C:\androidsdk\tools>adb push framework-res.apk /system/framework/framework-res.apk
354 KB/s (0 bytes in 5224198.014s)

Im seeing 0 bytes in how ever many seconds so im sure im doing something wrong. But when I did the pull I saw the framework-res.apk file show up in my tools folder on my pc. I was able to open it and everything. I didnt make any changes to it though cause I was just trying this to see how it worked. So after i opened it I just closed it out and then proceeded to do the push. Then since I was in recovery I just selected reboot phone now. Phone came back up with a ton of errors and force closes. If anyone has had this problem or sees anything Im doing wrong. I would really appreciate you pointing me in the right direction as I really like the idea of adb and being able to pull edit and push files. Thank you in advance for all your help.
 

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
What did you open the file with? What rom are you running?

Sent from my Droid using Tapatalk
 

frozty

Member
Joined
Nov 27, 2009
Messages
115
Reaction score
0
I'm having a similar problem using the zipalign it keeps telling me that the file cant be found.
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
What did you open the file with? What rom are you running?

Sent from my Droid using Tapatalk

Hello Shocka,

I am running ShadowRom v.0.0.1. I use 7zip to open the file. But that was mostly in the beginning. Now im just pulling the file seeing it pop up on my PC in my tools directory and then pushing it back to the phone without even opening it.
 

forkup

Member
Joined
Oct 31, 2009
Messages
317
Reaction score
0
You must give it a path to save the file TO. Use adb pull /system/framework/framework-res.apk c:\ or wherever you want to save it to. Use the same thing to push it back.
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
You must give it a path to save the file TO. Use adb pull /system/framework/framework-res.apk c:\ or wherever you want to save it to. Use the same thing to push it back.

I have to give it a path even if within cmd I navigate to the directory where adb is and then do the pull command and see the framework file pop up in that directory?
 

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
Mine looks like this cd c:/android/tools adb pull /system/app/whatever.apk whatever.apk. adb push whatever.apk /system/app/whatever.apk

Sent from my Droid using Tapatalk
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
Mine looks like this cd c:/android/tools adb pull /system/app/whatever.apk whatever.apk. adb push whatever.apk /system/app/whatever.apk

Sent from my Droid using Tapatalk

I appreciate you trying to help but thats what I have been doing and I still get the same errors/force closes when I boot back up after pushing the file to the phone. The file pulls fine and ends up on my compooter and I can open it and change it and do whatever to it. But after I push it back it doesnt boot up correctly. I could see if I was actually making changes to the framework-res.apk and then pushing it back and having the problems. Cause maybe I screwed the file up while changing it. But Im not even editing or opening the file. Im just pulling it and then pushing it straight back. Im at a complete dead end. Not sure where I am going wrong.
 
Last edited:

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
Are you mounting system while in recovery? On 2.2 I've always had to mount when I pushed or I got force closes.

Sent from my Droid using Tapatalk
 

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
Try my fix there, it should work, I can bout gurantee it. If your paths are set correctly.

Sent from my Droid using Tapatalk
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
Yup thats what I am doing. I have the phone on and connected to my compooter. I have USB debuggin on and run the adb devices command in cmd.
My phone serial number shows up with device.

I then cd c:\androidsdk\tools

then i have the below

C:\androidsdk\tools>

then I pull the file from the phone.

C:\androidsdk\tools> adb pull /system/framework/framework-res.apk framework-res.apk
1813 KB/s (0 bytes in 5224198.002s)

I then reboot to recovery

c:\androidsdk\tools> adb reboot recovery

Once my phone is in recovery I then try to mount from my compooter and I get the below

c:\androidsdk\tools>adb remount
remount failed: Unknown error: 0

Since that remount fails I then mount /system from clockwork recovery on my phone.

Once mounted I then try to push the file back to the phone.

C:\androidsdk\tools> adb push framework-res.apk /system/framework/framework-res.apk
354 kb/s (0 bytes in 5224198.014s)

I then reboot my phone and once it comes up I get tons of errors/force closes for everything running on my phone.

Im still not sure if when pulling and pushing I should be seeing 0 bytes count in xxxxxx seconds which i am. And also the KB count is different when I push and pull.
 

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
After you mount system in clockwork also do adb remount and see if that works

Sent from my Droid using Tapatalk
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
After you mount system in clockwork also do adb remount and see if that works

Sent from my Droid using Tapatalk

Ok I was in recovery and mounted /system via clockwork. I then ran the adb remount command and it succeeded so I pushed the file again. But I still received the errors/force closes after reboot. I see your commands you are typing are for /system/app/whatever.apk. I am trying to pull the framework.apk from /system/framework/framework.apk. Is there a difference between pulling a regular app from /system/app and pulling the framework.apk from /system/framework? Maybe there is a step I am missing.
 

shocka2430

Member
Joined
Mar 20, 2010
Messages
530
Reaction score
0
Not really much different just adb push framework-res.apk /system/framework/framework-res.apk. The framework is just more finiky then the apks. You could put that framework in a zip if you wanted and do it that way.

Sent from my Droid using Tapatalk
 
OP
S

skylordusa1

Member
Joined
Aug 19, 2010
Messages
204
Reaction score
0
Not really much different just adb push framework-res.apk /system/framework/framework-res.apk. The framework is just more finiky then the apks. You could put that framework in a zip if you wanted and do it that way.

Sent from my Droid using Tapatalk

Ok thank you for all your help. Normally I just take the ROM or Theme zip file and edit the framework.apk and then re package it and flash it on to my phone. I wanted to try ADB cause it seemed a little bit easier/faster. Thanks for the help though I really appreciate it been getting so frustrated over this whole thing.
 
Top