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?


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 May 20 '14 at 2:08
  • 1
    @o7thWebDesign no, it says in the online documentation that -f overwrites any existing output.apk – aureljared May 20 '14 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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