• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root CWM ADB install zip command

Yoinx

Android Expert
Sep 6, 2011
1,032
370
Virginia, USA
I know there must be a command to load a zip from sdcard as things like rommanger/cmupdate and such can reboot and auto-install a zip. Being that I hate having to scroll through all my folders to get to the file I'm going to flash.

I'd kinda like to just issue the command from adb if I'm sitting at the computer.

Any have any idea what the command would be from adb to install a zip from sdcard in CWM?
 
I don't know as that exists as a function yet, but that would be a kick ass idea for Koush to implement. About the closest thing I could thing of would be doing ADB push for the files that would normally be in the .zip , but then you would still need to set up a script for any permission changes needed.

Yeah I was digging through the recovery image trying to find any binary or script that would be able to be called... couldn't manage to. I mean the was the binary for gunzip I think. I guess it could be scripted to make a temp directory on /cache extract everything there then call the updater binary.

Any idea how cmupdater and the like do it though where they auto install a zip when recovery boots?

Sent from my VS920 4G using Tapatalk 2
 
Upvote 0
You can do an automatic install. But only one zip file per recovery session (eg. you cannot flash a rom then gapps). Here's how:

The file "/cache/recovery/command" contains command-line arguments for recovery. So you might want it to look like this:

Code:
--update_package=/sdcard/cm-10.1-latest.zip

Now run "reboot recovery". The recovery should do the install and reboot into the new system.
 
Upvote 0
You can do an automatic install. But only one zip file per recovery session (eg. you cannot flash a rom then gapps). Here's how:

The file "/cache/recovery/command" contains command-line arguments for recovery. So you might want it to look like this:

Code:
--update_package=/sdcard/cm-10.1-latest.zip

Now run "reboot recovery". The recovery should do the install and reboot into the new system.

Cool thanks.

Sent from my VS920 4G using Tapatalk 2
 
Upvote 0
You can do an automatic install. But only one zip file per recovery session (eg. you cannot flash a rom then gapps). Here's how:

The file "/cache/recovery/command" contains command-line arguments for recovery. So you might want it to look like this:

Code:
--update_package=/sdcard/cm-10.1-latest.zip

Now run "reboot recovery". The recovery should do the install and reboot into the new system.

You're the man tdm. No really.

This command works fine from recovery.

adb shell
cd /sbin
recovery --update_package=/sdcard/whatever.zip

it will kill the currently running recovery interface and jump into the installing screen with no prompt. Though, it does still automatically reboot at the end. I can't help but wonder if maybe there's a toggle to prevent the reboot :s

Unless maybe this was done as some form of security feature in order to prevent apps from installing multiple zips with you thinking they only installed one. Though... really... the app would mostly already have root access anyway.
 
  • Like
Reactions: tdm
Upvote 0
Source code contains the command line options:

https://android.googlesource.com/platform/bootable/recovery/+/jb-mr1.1-release/recovery.cpp

No option to disable reboot, it seems. Unless the install fails, in which case rebooting would probably fail.

Yeah. I see now. When it's called like that, it looks like it sets a flag to reboot to recovery and try again. Once the install finishes in which case it's calling finish_recovery() which unsets that flag and reboots.

Oh well. Was just looking for an easier way to flash zips. For instance one zip that could flash everything in a specific folder like "to_flash" then reboot.

*shrug* thanks anyway.
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones