1. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

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

Discussion in 'Android Hacks and Help' started by skylordusa1, Oct 7, 2010.

  1. skylordusa1
    Offline

    skylordusa1 New Member

    Joined:
    Aug 19, 2010
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    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.
  2. teddyearp
    Offline

    teddyearp New Member

    Joined:
    Jan 13, 2010
    Messages:
    1,800
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Randle, WA
    I'd be glad to help with what I have. For pulling files, usually you don't have to 'mount' /system but you do for pushing as you have to make /system read/write (something only we darksiders rooted people can do). And usually this pulling and pushing and mounting via adb is done while the phone is booted up regularly and not into recovery.

    However, since you are working with your framework-res.apk file it is HIGHLY recommended that you do the pushing while booted into recovery, otherwise you could have a ton of problems. The difference is that while you're booted into recovery, you use the recovery menu sytem on your phone to mount and unmount /system on your phone and usually only use the 'adb push' command.

    As far as fixing your problem, I hope you were able to restore a backup. If not, when you opened your framework-res.apk file, what did you use to do so?
  3. skylordusa1
    Offline

    skylordusa1 New Member

    Joined:
    Aug 19, 2010
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    0
    Hey Teddy,

    Thanks for the reply. Yeah I had to do a restore to backup to get things normal again. So maybe my issue is that I mounted when pulling the file but I did not do the mount again before I pushed the file back?
  4. skylordusa1
    Offline

    skylordusa1 New Member

    Joined:
    Aug 19, 2010
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    0
    I guess thats not it. I just connected my device saw it with the adb devices command. I then pulled the framework-res.apk file from the phone without mounting and that worked fine. I then mounted the phone and tried to push the framework file back to the phone. After rebooting the phone I got the same errors/force closes. I then restored backup. I connected the phone again while phone was on I pulled the framework file without mounting. I then rebooted to recovery and mounted /system within the recovery menu (clockwork). I then pushed the framework file back to he phone and rebooted. Once the phone came back up had the same errors/force closes. I have no clue what i am doing wrong as all the videos and threads I read are what i am following.

    Also I noticed that everytime I pull and push i have 0 bytes in how ever many seconds. Should there be a byte size/amount there? Or is it always 0? And the KB/s are always different sizes when pushing and pulling. I am not making any changes to the framework file between the push and pull as I am just trying to figure out how to do it correctly. Does it have anything to do with signing the apk or something like that I think i read.

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

    C:\androidsdk\tools>adb reboot recovery

    C:\androidsdk\tools>adb push framework-res.apk /system/framework/framework-res.a
    pk
    358 KB/s (0 bytes in 5224198.014s)
  5. teddyearp
    Offline

    teddyearp New Member

    Joined:
    Jan 13, 2010
    Messages:
    1,800
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Randle, WA
    Hmmm, I am totally stumped. I started to ask if you've modified it, but re-read your post and see that is not the case. So, just out of curiosity I did the same thing you're doing and had the exact same results! I got the '0 bytes in xxxx seconds' messages and a different byte count on pulling than pushing as well. Hmmmm . . .

    The only times I've had the trouble you describe in relation to my framework-res.apk file is when I've tried to push it while NOT booted into recovery, OR if the framework-res.apk file just isn't going to work with my current rom.

    Hmmm . . .
  6. skylordusa1
    Offline

    skylordusa1 New Member

    Joined:
    Aug 19, 2010
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    0
    Yeah sucks I was all excited to get ADB finally working on my compooter cause it seems like such a great tool. But im stumped and getting ready to give up cause im not having any luck finding the answers hahahhahaah. I appreciate you taking the time to try and help though. Very cool of you bro. Im wondering if it has anything to do with signing the apk first before pushing it back cause I heard something about that but will have to read up on that more. Or maybe i dont have the right drivers on my pc. But your able to pull and push other files to your phone without issues right? I have only tried the framework apk so far I guess I can try an app to see if that works.
  7. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    I would never push a framework-res.apk to the system. Put it in an update.zip and flash that way. You would have to reboot anyway when pushing a framework-res.apk.

    As for signing the .apk you still need to sign it as a /system/app or it will boot loop. So if you are using apk manager. You would do 9 to decompile, edit and then 11 to compile. Then 12 to sign as a system app.
  8. skylordusa1
    Offline

    skylordusa1 New Member

    Joined:
    Aug 19, 2010
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    0
    Awesome Bowers I was hoping I was doing it right atleast. Again thanks alot for taking a look at the thread for me and writing up all the "How To's" and all the other help hahahhaha.. I have the apk manager now so Im gonna try and mess around with that. Sorry for bothering you again.
  9. teddyearp
    Offline

    teddyearp New Member

    Joined:
    Jan 13, 2010
    Messages:
    1,800
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Randle, WA
    Yes, thanks thebowers, but I find it very interesting that when we (skylord and I) both pulled our framework-res.apk file and then pushed it while booted in recovery it failed with the obvious discrepancies mentioned.

    And BTW, by 'pushing' a framework-res.apk file via a modified update.zip file, you do realize that it is using almost the same situation/method, right? I.E. pushing while the phone is booted into recovery, with the system partition mounted.

    On another note, I have had no problems whatsoever pulling a framework-res.apk file, modifying some of the .png's and then pushing it back via the above methods, without the use of apk manager, but using the 'store' mode of 7-zip.
Search tags for this page

adb failed to find framework.jar