A powerful and configurable command-line tool to automatically rename and organize your Flutter build artifacts (APKs and AABs) after the build process is complete.
The flutter build command produces predictably named files (e.g., app-release.apk, app-release.aab). This tool runs after the build to:
- Rename artifacts using your own naming convention
- Append version information automatically
- Organize outputs into a clean directory
All without touching Gradle or writing custom scripts.
-
Rename APKs & AABs
- APKs and App Bundles are automatically renamed using your package name and build metadata.
-
Versioned Output
-
Automatically appends version from
pubspec.yamlmy_app_1.2.2_a64.apk
-
-
Architecture-Aware Naming
armeabi-v7a→v7aarm64-v8a→a64x86_64→x86- universal APK →
uni - app bundle →
bundle
-
Selective Artifact Filtering
- Skip specific APK variants using
discardrules.
- Skip specific APK variants using
-
Organized Output Directory
- Move or copy artifacts into a clean folder like
./release.
- Move or copy artifacts into a clean folder like
-
Copy or Move
- Preserve original build artifacts if needed.
-
Automatic Cleanup
- Optionally delete the
build/folder after processing.
- Optionally delete the
-
Safe File Handling
- Cross-device safe operations (fallback copy + delete)
- Prevents overwriting existing files
-
Simple Configuration
- Everything configured via
pubspec.yaml
- Everything configured via
You can install the tool globally (recommended) or as a development dependency.
dart pub global activate flutter_post_buildflutter pub add --dev flutter_post_buildAdd this block to your project's pubspec.yaml:
flutter_post_builder:
# (Required) Base name for generated artifacts
package_name: "my_app"
# (Optional) Append version from pubspec.yaml (default: true)
append_version: true
# (Optional) Output directory
final_directory: "./release"
# (Optional) Move or copy files (default: true)
move_files: true
# (Optional) Skip specific APK variants
discard:
v7a: false
a64: false
x86: false
uni: false
# (Optional) Delete build folder after processing
clean_build_folder: trueflutter build apk --split-per-abiflutter build apkflutter build appbundleflutter_post_builddart run flutter_post_buildapp-armeabi-v7a-release.apk
app-arm64-v8a-release.apk
app-x86_64-release.apk
app-release.apk
app-release.aab
my_app_1.2.2_v7a.apk
my_app_1.2.2_a64.apk
my_app_1.2.2_x86.apk
my_app_1.2.2_uni.apk
my_app_1.2.2_bun.aab
- APK and AAB builds are handled independently (as per Flutter build commands).
discardapplies only to APK variants, not App Bundles.- If a file already exists in the target directory, it will be skipped.
This project is licensed under the MIT License — see the LICENSE file for details.