Command Overview

mkapk provides the following main commands:

$ mkapk [command] [options]
Command Description Usage
init Initialize a new project mkapk init
build Build the project mkapk build [options]
clean Remove build artifacts mkapk clean
install Install a language plugin mkapk install
uninstall Remove a language plugin mkapk uninstall
help Show help information mkapk help

Detailed Commands

mkapk init

Initialize a new mkapk project with template structure.

$ mkapk init

What it does:

mkapk build [options]

Build your Android application. This is the main command you'll use during development.

$ mkapk build [options]

Build Options

Flag Description Example
-release Build for production (optimized, obfuscated) mkapk build -release
-all Force complete rebuild (ignore incremental cache) mkapk build -all
-arch <abi> Build for specific architecture mkapk build -arch aarch64
-ndk-all Build universal APK + split per-architecture mkapk build -ndk-all
-no-obs Disable obfuscation (release builds only) mkapk build -release -no-obs

Build Examples

Debug build (default):

$ mkapk build

Creates a debug APK with symbols and no optimization.

Release build:

$ mkapk build -release

Creates an optimized, obfuscated APK ready for distribution.

Full rebuild:

$ mkapk build -all

Ignores cache and recompiles everything.

Multi-architecture:

$ mkapk build -ndk-all

Builds APKs for armv7, arm64, x86, x86_64, plus universal.

Specific architecture:

$ mkapk build -arch armv7a-linux-androideabi

Builds only for 32-bit ARM devices.

Release without obfuscation:

$ mkapk build -release -no-obs

Production build that keeps readable class/method names (debugging).

mkapk clean

Remove build artifacts while preserving keystores.

$ mkapk clean

What it removes:

What it preserves:

mkapk install <plugin.pl>

Install a language plugin (unsigned .pl package).

$ mkapk install my-plugin.pl

The plugin must be:

mkapk uninstall <plugin_name>

Remove an installed language plugin.

$ mkapk uninstall rust

mkapk help

Display help information and available commands.

$ mkapk help

Output Files

After building, you'll find these files in the bin/ directory:

File Purpose
MyApp.debug.apk Debug build for development/testing
MyApp.release.apk Release build for distribution
MyApp-universal.apk Universal APK with all architectures (large file)
MyApp-armv7.apk ARM 32-bit specific APK
MyApp-arm64.apk ARM 64-bit specific APK
MyApp-x86.apk x86 32-bit specific APK
MyApp-x86_64.apk x86 64-bit specific APK

Build Process Workflow

1

Change Detection

mkapk scans and hashes all source files to detect changes since last build.

2

Resource Compilation

AAPT2 compiles Android resources and generates R.java

3

Source Compilation

Javac compiles Java/Kotlin code → .class files

4

Native Compilation (if applicable)

Clang compiles C/C++ code → .so libraries (per-ABI)

5

DEX Conversion

D8/R8 converts .class files → classes.dex

6

APK Packaging

Zip assembles DEX, resources, native libraries → APK

7

Alignment & Signing

Zipalign optimizes layout, apksigner signs with keystore

Installation on Device

Using ADB

$ adb install bin/MyApp.debug.apk

Direct Installation (from Termux)

$ pm install -r bin/MyApp.debug.apk

Upgrade Existing App

$ adb install -r bin/MyApp.debug.apk

Tips & Tricks