在 Linux 命令行下面构建 Android 的最终产物 apk
去 Android 官网下载 commandlinetools
https://developer.android.com/studio
配置 Android Home 环境变量
添加到 .bash_rc 或者是 .bash_profile
export ANDROID_HOME=/opt/Android
export ADNROID_SDK=${ANDROID_HOME}
export PATH=$PATH:$ANDROID_HOME/tools/bin
配置的环境变量马上生效
source ~/.bash_profile
同意 Android 协议
yes | sdkmanager --sdk_root=${ANDROID_HOME} --licenses
使用工程提供的 gradlew 进行构建
这一步会自己安装工程对应的 android 的 sdk
Reproduced please indicate the author and the source, and error a link to this page.
text link:
//xiaochun.zrlog.com/linux-cmd-build-android-apk.html