通常android開發打包,都經過android studio本身打包,這種流程不適合批量打包和流程規範。爲了解決android生產編譯打包,本文主要闡述jenkins結合android sdk進行打包node
unzip gradle-3.3-all.zip mv gradle-3.3 /opt
vi /etc/profile export GRADLE_HOME=/opt/gradle-3.3 export PATH=$GRADLE_HOME/bin:$PATH source /etc/profile
tar -zxvf android-sdk_r24.4.1-linux.tgz mv android-sdk-linux /opt
vi /etc/profile export ANDROID_HOME=/opt/android-sdk-linux export ANDROID_NDK_HOME=/opt/android-sdk-linux/ndk-bundle source /etc/profile
cd /opt/android-sdk-linux/tools ./android list sdk
./android update sdk -u -t $no
cd app gradle clean gradle assembleRelease
node { stage('git更新') { git branch: 'master', url: 'git@gitee.com:teadev/android.git' } stage('gradle編譯') { sh '''cd app gradle clean gradle assembleRelease''' } stage('存檔') { archiveArtifacts 'app/build/outputs/apk/*.apk' } }
做者:無法定義
連接:https://www.jianshu.com/p/d23a3f8f4872
來源:簡書
簡書著做權歸做者全部,任何形式的轉載都請聯繫做者得到受權並註明出處。linux