Zipalign - Command not found - MAC terminal
Solution 1
Perhaps the current directory is not in your path?
Try adding "./" before your command so
./zipalign -v 4 Project1.apk Project1-aligned.apk
Solution 2
You can find correct path with this command:
find ~/Library/Android/sdk/build-tools -name "zipalign"
Solution 3
You will find the zipalign tool at /path/to/sdk/build-tools/<build-tools-version>/zipalign
NOT in the tools folder anymore.
Solution 4
~/Library/Android/sdk/build-tools/xxxx/zipalign
Drag this to terminal or save this in your path. xxxx -> Version
Solution 5
Zipalign is a command that located at $ANDROID_HOME/build-tools/{android-version}/
.
Hope it helped.
Bill
Updated on July 05, 2022Comments
-
Bill almost 2 years
When I try to run Zipalign on an apk I get the error
"Command not found"
I am not that familiar with using terminal commands on the MAC but I have navigated to the SDK/Tools folder and run the following command:
zipalign -v 4 Project1.apk Project1-aligned.apk
I get Command not found
I have tried placing the apks in the Tools folder and same result.
Can someone help me to understand where the apks should be located and where I should run zipalign from?
Thanks, I am very frustrated about this as it seems so simple.
-
Bill about 13 yearsI will try, thanks. I will also include the full path to the apk.
-
Prasad De Zoysa about 11 years+1 for the correct answer, @Bill please mark this as correct answer if this solved your problem!! it always encourage people who answer questions.
-
Nikola about 8 yearsANDROID, not ADROD. But, thanks for your answer, it helped me.
-
Ruepen almost 8 yearsWorked as advertised for me.
-
Tolga Can Günel over 7 yearsThis is much more helpful.
-
Serdar D. about 7 yearsdrwxr-xr-x 23.0.1 <--- this line didn't give me the real version number, but after I fix it, it worked. Thank you.
-
William Patton about 7 yearsHi, welcome to Stack Overflow! Consider expanding this answer to explain why you believe the users are unable to make this command work and how executing it like this fixes the issue. Also it may be worth adding some text detailing how a user could add this to their PATH so that they can execute it like OP tried in the question. Those 2 edits would make this answer to a very old question much more useful for people looking for a good answer. Thank you!
-
Gozus19 over 6 yearsYou should receive a honor medal for this comment. You saved my life. Thanks, thanks and thanks again!!!
-
asiammyself over 6 yearsI think this works just wanted to let you know you get this the first time it is run and have to wait a bit: "Please be aware that the database can take some time to generate; once the database has been created, this message will no longer appear."
-
Scott Stensland about 6 yearsthis is the real answer since by adding dir to PATH other tools in that dir like aapt can also be found
-
Nic Scozzaro over 5 yearsYes, thank you that works. On my Mac the command yields: /Users/nicolasscozzaro/Library/Android/sdk/build-tools/28.0.2/zipalign
-
JanP almost 5 yearsThe path you add to /etc/paths should be without
/zipalign
-
Ezequiel Tavares almost 4 yearsMedal of Honor for you!
-
Nick Turner over 2 yearsCan a moderator marks this as the answer?