How to build the latest version of apktool?

apktool is an Android apk decompilation program. It is command line based, and requires java to run. It can be run on both Windows and Linux systems.

Officially, apktool was last updated in February 2013. But development on apktool is highly active, and it makes sense to get the latest version with all bug fixes and cutting edge features. If you need the latest development version of apktool, you need to compile apktool from source.

I tried this on a Debian 7 x64 based VPS on an OpenVZ virtualization.

First download and extract the Android SDK (you need aapt from the SDK):
Download the version for Linux 64-bit: Eg:

cd adt-bundle-linux-x86_64-20140321/

Find the location of aapt and add its path to the PATH variable:

find . -iname 'aapt'
export PATH=$PATH:/home/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2

Get the latest development version source:

git clone
cd android-apktool/
./gradlew build fatJar

If all went well, you’ll get a “build successful” message.
The new jar will be saved as ./brut.apktool/apktool-cli/build/libs/apktool-cli.jar