Apktool is a command-line tool used for decoding and rebuilding Android APK files. It can decode an APK to view its resources and configuration files, and it can rebuild the files back into an APK. You can use it for Android development, app testing, and learning how Android applications are structured in a simple and practical way.
Here’s what you can do with Apktool in Termux:
- Decode APK files.
- View APK resources and configuration files.
- Extract the AndroidManifest.xml file.
- Rebuild decoded APK files.
- Install framework files.
- Use custom output directories.
- Control decoding options.
Install Apktool in Termux
Run the commands below one by one to install Java and Apktool on your device.
First, update the Termux packages:
pkg update && pkg upgrade -yInstall Java:
pkg install openjdk-17 -yNow install Apktool:
pkg install apktool -yCheck the installed version:
apktool --versionIf the version is displayed, Apktool has been installed successfully.
Use Apktool in Termux
Before using Apktool, move to the directory where your APK file is stored. For example, if the APK is inside the Download folder:
cd /sdcard/DownloadDecode an APK
Use the d or decode command to decode an APK:
apktool d app.apkBy default, Apktool creates a decoded app folder for the APK.
You can also specify your own output directory:
apktool d app.apk -o decoded-appForce Apktool to delete an existing destination directory before decoding:
apktool d app.apk -fDecode all source files, including unknown DEX files:
apktool d app.apk -aSkip decoding Android resources:
apktool d app.apk -rSkip decoding source files:
apktool d app.apk -sSet the number of parallel jobs:
apktool d app.apk -j 4Use a custom framework directory:
apktool d app.apk -p ~/frameworkUse a specific framework tag:
apktool d app.apk -t customRebuild an APK
After making changes to a decoded APK directory, use the b or build command to rebuild it:
apktool b decoded-appThe rebuilt APK is normally placed inside the dist directory.
You can choose a custom output file:
apktool b decoded-app -o rebuilt.apkForce Apktool to rebuild all files:
apktool b decoded-app -fSet the number of parallel jobs:
apktool b decoded-app -j 4Use a custom framework directory while rebuilding:
apktool b decoded-app -p ~/frameworkInstall an Android Framework
Some APKs require framework files to decode correctly. You can install a framework APK using:
apktool if framework.apkYou can also use a custom framework directory:
apktool if framework.apk -p ~/frameworkAdd a custom framework tag:
apktool if framework.apk -t customOther Useful Commands
Display the Apktool help menu:
apktool hYou can also use:
apktool --helpCheck the Apktool version:
apktool --versionUse quiet mode to reduce normal output:
apktool d app.apk -qUse verbose mode for more detailed output:
apktool d app.apk -vBasic APK Workflow
A simple workflow is to first decode an APK:
apktool d app.apk -o decoded-appAfter making changes to the decoded files, rebuild the APK:
apktool b decoded-app -o rebuilt.apkThe rebuilt APK may need to be signed before it can be installed on an Android device. Signing is a separate process from decoding and rebuilding.
Note: Use Apktool only with APK files that you own or have permission to analyze or modify.
End Note
Apktool is a simple command-line tool that you can use to decode and rebuild APK files in the terminal. It is useful for quickly viewing Android application structures, testing APK files, and learning about Android app development in a simple way.

