I am trying to zipalign an "input.apk" file on an Ubuntu 14.04 LTS system using the command line as I do not have access to the source code just yet. If I'm not mistaken I should be able to do this with the following command
zipalign [-f] [-v] 4 intput.apk output.apk
but I am getting the following output
zipalign: command not found
I have made sure that the zipalign file is in my ...sdk/tools directory which I had to copy over from my ...build-tools/android-4.4W folder because it was originally missing. When I input this line as suggested in another question
./zipalign [-f] [-v] 4 intput.apk output.apk
I get the following output
Zip alignment utility
Copyright (C) 2009 The Android Open Source Project
Usage: zipalign [-f] [-v] <align> infile.zip outfile.zip
zipalign -c [-v] <align> infile.zip
<align>: alignment in bytes, e.g. '4' provides 32-bit alignment
-c: check alignment only (does not modify file)
-f: overwrite existing outfile.zip
-v: verbose output
Does this mean that I need a .zip file instead of my .apk to zipalign?
In terminal,
cd /opt/android-sdk/build-tools/21.1.2
sudo ln -sf zipalign /usr/bin/
zipalign -v 4 platforms/android/ant-build/MainActivity-release-unsigned.apk platforms/android/ant-build/YOUR_APP.apk
When a usage message contains an argument in brackets, the brackets mean that that argument is optional and can be left out of the final command; the brackets are not themselves part of the command syntax.
In your case, correct usage might look like:
./zipalign -v 4 intput.apk output.apk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With