Speed Up Android Channel Packaging with Walle: A Quick Guide
This article introduces Walle, a fast Android channel‑packaging tool for the APK Signature V2 Scheme, explains how to configure it in Gradle, shows key properties and variables, and provides Gradle commands to generate single or multiple channel APKs efficiently.
Introduction
Walle is a next‑generation channel‑packaging tool for Android under the APK Signature V2 Scheme. It adds custom channel information to the APK Signature Block, allowing fast generation of channel‑specific APKs, usable as a standalone tool or deployed on an HTTP server for real‑time processing.
Usage
Walle dramatically speeds up multi‑channel builds; a project that previously took over ten minutes for seven channels can be built in about two minutes.
Add the plugin and dependencies in build.gradle:
buildscript {
dependencies {
classpath 'com.meituan.android.walle:plugin:1.1.3'
}
}
apply plugin: 'walle'
dependencies {
compile 'com.meituan.android.walle:library:1.1.3'
}
walle {
// output directory for channel APKs
apkOutputFolder = new File("${project.buildDir}/outputs/channels")
// custom APK file name format
apkFileNameFormat = '${appName}-${packageName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk'
// channel configuration file
channelFile = new File("${project.getProjectDir()}/channel")
}Key properties: apkOutputFolder: output path, default
new File("${project.buildDir}/outputs/apk") apkFileNameFormat: default 'appName-appName-{buildType}-${channel}.apk' Available variables for the format include projectName, appName, packageName, buildType, channel, versionName, versionCode, buildTime, fileSHA1, flavorName, and channelFile.
Create a channel text file in the app directory with entries such as:
Qh360 #360
Yyb #应用宝
Wdj #豌豆荚
Lenovo #联想
Xiaomi #小米
Huawei #华为
Meizhu #魅族Read the channel at runtime:
String channel = WalleChannelReader.getChannel(this.getApplicationContext());Build the channel APKs with Gradle commands, e.g.:
./gradlew clean assembleReleaseChannelsThe generated APKs are placed in build/outputs/apk/ (or the directory set by apkOutputFolder). You can also build specific channels:
./gradlew clean assembleReleaseChannels -PchannelList=huawei
./gradlew clean assembleReleaseChannels -PchannelList=huawei,xiaomiSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
