Create android apk manually via command line (Makefile)



I want to create an android app

  • via a vim & makefile only
  • no gradle, no ant, no maven, no and all other stuff


It is a high performance C++ code that is wrapped for an android device.

  • Ergo, I do not need 99% of gradles services
  • 15+ seconds built time via gradle for a small program? That is unacceptable.
  • The incorporation of native code in gradle is ridiculous. These gradle guys come up with an experimental ndk plugin that keeps changing syntax.
  • I only target ARMv8-A. I will have partly AARCH64 assembler code. And I use a pre-processor m4 that generates *.cpp before they get compiled. Can’t imagine gradle has something for this.

My Progress

I know that the following steps are REQUIRED:

  1. Create keystore by keytool from $JAVA_HOME/bin.
  2. Compile source files via javac from $JAVA_HOME/bin.
  3. Create Dalvik Executables for the device by dx from $ANDROID_HOME/built-tools.
  4. Create the .apk file by aapt from $ANDROID_HOME/built-tools.
  5. Sign apk package by jarsigner from $JAVA_HOME/bin.
  6. Align apk package by zipalign from $ANDROID_HOME/built-tools.
  7. Install software on phone by adb from $ANDROID_HOME/tools.

The app crashes on startup. Even when I want to create a blank activity.


ok, I figured it out. I placed my sample code on

Hope it helps you guys too.

Answered By – Armen Avetisyan

Leave a Comment