Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zipalign - Command not found - MAC terminal

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.

like image 499
Bill Avatar asked Mar 16 '11 15:03

Bill


People also ask

Where is Zipalign located?

The zipalign file is located in build-tools in the path where Android SDK is installed.

Is Zipalign required?

Caution: You must use zipalign at one of two specific points in the app-building process, depending on which app-signing tool you use: If you use apksigner, zipalign must only be performed before the APK file has been signed.

What is Zipalign?

zipalign is a zip archive alignment tool. It ensures that all uncompressed files in the archive are aligned relative to the start of the file. This allows those files to be accessed directly via mmap(2) , removing the need to copy this data in RAM and reducing your app's memory usage.


1 Answers

Perhaps the current directory is not in your path?

Try adding "./" before your command so

./zipalign -v 4 Project1.apk Project1-aligned.apk 
like image 127
pjulien Avatar answered Oct 13 '22 07:10

pjulien