Exactly what the title says. I've got a 1.5 gb zip file on my sdcard that I would like to extract via adb (not pulling to pc and pushing back). Is there a simple command to unzip a file?

Thanks!

up vote 10 down vote accepted

Yes and no. As far as I'm aware, a typical Android install will not contain unzip. You can, however, install busybox for Android, which provides the unzip utility. Then a simple:

adb shell unzip /sdcard/archive.zip

Would do the trick. If you're rooted you can use a busybox installer from the Market like Stericson's. If you're not rooted then you should be able to manually push a busybox binary (one here on Github, for example; click "raw" to download it) to somewhere like /data/local and then invoke it. It should be something like:

adb push /path/to/busybox-android /data/local/busybox
adb shell chmod 0755 /data/local/busybox #Make it executable
adb shell /data/local/busybox unzip /sdcard/archive.zip

Alternatively, many file managers will unzip files for you. I personally use File Expert but there are a lot of others. Usually you just need to long press on the archive and it will present an "extract" option or similar.

  • Awesome answer. busybox is a powerful tool. – Rotemmiz Jan 25 '12 at 10:42
  • 1
    I had to change directory first: adb shell; cd /sdcard; /data/local/busybox unzip archive.zip – TomTasche Apr 21 '13 at 8:14
  • The shell user doesn't have permissions for /data/local on my phone — a Galaxy S4 running Android 5. I had to push busybox to /data/local/tmp. Not sure yet if that directory's contents persist across reboots. – intuited Mar 1 '16 at 6:46

I was able to use /data/local/tmp as well and able to chmod also. I was not able to do was unzip the zip file I created in windows.

To overcome this, i created the tar file using 7zip and used busybox tar -xvf myzip.tar destination to successfully unzip the file.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.