I'm attempting to sift through a folder of .apks, and zipalign them

I have the latest ADT

My command lies in a bash script, that loops through the folder

and my zipalign command is: zipalign -f 4 my.apk my.apk

It keeps popping Input and output can't be the same file

My understanding is (from the ADT docs), is that this is supposed to be possible.

Now, when I try zipalign -f 4 my.apk instead of zipaligning them, it simply gives me the help info for zipalign.

What gives?

1 Answer 1


You should use

zipalign -f -v 4 my.apk output.apk

Do remember that if you zipalign before you sign, the signing will undo the alignment.

  • right but shouldnt the -f flag overwrite the original?
    – Kevin
    Commented May 20, 2014 at 2:08
  • 1
    @o7thWebDesign no, it says in the online documentation that -f overwrites any existing output.apk
    – dantis
    Commented May 20, 2014 at 2:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .