jenkins配置android自動打包平臺
目的
採用jenkins,關聯git,自動拉取最新程式碼,自動打包Android apk包,一方面解放開發打包慢的問題,另一方面方便測試打包迴歸,節省人力。
整個搭建過程遇到比較多小問題,後面都一一解決,本文做個記錄。
搭建流程
配置java環境
這個略過
gradle安裝
apt install gradle
下載sdkmanager
https://developer.android.com/studio/#downloads
android sdk安裝
./sdkmanager –list
android sdk安裝
./sdkmanager “platform-tools” “platforms;android-26” “build-tools;27.0.3” “ndk-bundle”
jenkins配置 ANDROID_HOME
其他部落格文章有
licences同意
安裝過程提示licenses沒有同意,找到一個解決方案。
解決方案:https://stackoverflow.com/questions/38096225/automatically-accept-all-sdk-licences
yes | sdkmanager –licenses
root@iZuf68ausnohve9zzvan1lZ:~/.jenkins/workspace/android-autobuild# ./gradlew
> Configure project :MPChartLib
File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Platform 27 in /data/android-sdk/licenses
Warning: License for package Android SDK Platform 27 not accepted.
Checking the license for package Android SDK Platform 27 in /data/android-sdk/licenses
Warning: License for package Android SDK Platform 27 not accepted.
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file '/root/.jenkins/workspace/android-autobuild/MPChartLib/build.gradle' line: 61
* What went wrong:
A problem occurred evaluating project ':MPChartLib'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-27 Android SDK Platform 27
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /data/android-sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
編譯包
./gradlew tasks
./gradlew assembleDebug
編譯測試包
./gradlew assembleDebug –stacktrace
版本號自動遞增
每次自動打包,版本號自動遞增,實現:
http://devdeeds.com/auto-increment-build-number-using-gradle-in-android/
相關文章
- Jenkins搭建持續打包平臺Jenkins
- Android:平臺自動設定Pinctrl的預設配置Android
- jenkins iOS自動化打包分發JenkinsiOS
- 使用Jenkins自動構建Android應用打包並上傳JenkinsAndroid
- Mac 環境下 Android 使用 Jenkins 構建自動化打包MacAndroidJenkins
- 關於jenkins自動化打包探索Jenkins
- Python自動化打包業務和認證平臺Python
- 這應該是最全的Jenkins Android自動打包構建教程JenkinsAndroid
- fastlane實現自動化打包上傳測試平臺AST
- Android程式自動化打包Android
- jenkins+gitlab + 蒲公英實現 android 應用自動化打包分發JenkinsGitlabAndroid
- 前端使用docker+jenkins實現自動打包部署前端DockerJenkins
- jenkins流水線自動構建配置Jenkins
- android使用jenkins進行自動化打包並且上傳到fir或者蒲公英AndroidJenkins
- 關於持續整合打包平臺的Jenkins配置和構建指令碼實現細節Jenkins指令碼
- jenkins+git+maven+tomcat 實現自動打包部署JenkinsGitMavenTomcat
- Jenkins + Git + fastlane + 蒲公英實現自動化打包上傳JenkinsGitAST
- 基於Jenkins實現php專案的自動化測試、自動打包和自動部署JenkinsPHP
- Android Jenkins自動化構建之路AndroidJenkins
- 解放雙手 | Jenkins + gitlab + maven 自動打包部署專案JenkinsGitlabMaven
- 使用Jenkins實現前端自動化打包部署(Linux版本)Jenkins前端Linux
- 阿里雲伺服器配置Jenkins自動打包部署vue專案(新手攻略第二彈)阿里伺服器JenkinsVue
- 如何利用jenkins來做android自動化JenkinsAndroid
- Jenkins+Fastlane+自動化打包釋出+蒲公英二維碼展示JenkinsAST
- JB的測試之旅-利用jenkins達到提tag自動打包Jenkins
- 開普勒雲平臺:如何配置gitlab與JenkinsGitlabJenkins
- 自動化測試平臺
- Carla 自動駕駛模擬平臺的安裝與配置指南自動駕駛
- jenkins 配置為node程序不在時,自動連jenkins master伺服器JenkinsAST伺服器
- 教你在Android自動打包解包簽名方法Android
- 【Android自動化打包】01. aapt的用法AndroidAPT
- 【Android自動化打包】02. javac的用法AndroidJava
- Jenkins + GitLab + Xcode + Fir 實現iOS自動打包和分發JenkinsGitlabXCodeiOS
- jenkins與gradle與sonar整合自動化打包程式碼檢測JenkinsGradle
- Fastlane自動打包工具build號自增處理配置方法ASTUI
- Android 多渠道打包配置Android
- Flutter Jenkins打包FlutterJenkins
- 直播電商平臺開發,Android | 圖片縮放、自動居中Android