Jenkins打包Android apk记录

构建

Freestyle project -> 构建 -> Execute shell

1
2
3
cd app
chmod +x ../gradlew
../gradlew clean assembleDefaultDebug assembleDefaultRelease assembleDevelopDebug assembleDevelopRelease --stacktrace
1
2
3
cd app
chmod +x ../gradlew
../gradlew clean assembleGooglePlayDebug assembleGooglePlayRelease assembleHomeRelease assembleUpdateRelease assembleTencentRelease assembleWandoujiaRelease assembleHuaweiRelease assembleXiaomiRelease assembleVivoRelease assembleOppoRelease

gradlew配置代理

在gradlew的同一目录,编辑gradle.properties

1
2
3
4
systemProp.http.proxyHost=192.168.16.28
systemProp.http.proxyPort=8118
systemProp.https.proxyHost=192.168.16.28
systemProp.https.proxyPort=8118

参考:http://stackoverflow.com/questions/8938994/gradlew-behind-a-proxy

Task not found

1
Task 'assembleXXXDebug' not found in project ':app'.

参考:https://stackoverflow.com/questions/49187670/assembledebug-task-not-found-while-running-from-jenkins

1
I fixed the "task 'assembleDebug' not found in root project" error by adding an ANDROID_HOME environment variable

Manage Jenkins -> Configure System -> Environment variables -> 新增键值对

  • ANDROID_HOME (/data/Android/Android-Sdk/)

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :