Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
论 Mobile App (iOS/Android)自动化构建是如何炼成的
Search
icyleaf
December 15, 2014
Technology
0
200
论 Mobile App (iOS/Android)自动化构建是如何炼成的
如果更加自由的打包 Android/iOS App,今天咱就说说看。
更新:支持国内代理安装 android sdk
icyleaf
December 15, 2014
Tweet
Share
More Decks by icyleaf
See All by icyleaf
Android 组件实践
icyleaf
0
59
我想学 Ruby 系列课程之开篇
icyleaf
0
120
使用 Kohana 轻便快速开发
icyleaf
0
110
贡嘎转山之驴行的意义
icyleaf
0
140
Install Snow Leopard on PC (Hashintosh)
icyleaf
0
150
Git 入门实战
icyleaf
8
800
Other Decks in Technology
See All in Technology
AWS CDK 実践的アプローチ N選 / aws-cdk-practical-approaches
gotok365
6
740
AWS Summit Japan 2025 Community Stage - App workflow automation by AWS Step Functions
matsuihidetoshi
1
260
「Chatwork」の認証基盤の移行とログ活用によるプロダクト改善
kubell_hr
1
150
VISITS_AIIoTビジネス共創ラボ登壇資料.pdf
iotcomjpadmin
0
160
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
160
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
0
130
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
250
製造業からパッケージ製品まで、あらゆる領域をカバー!生成AIを利用したテストシナリオ生成 / 20250627 Suguru Ishii
shift_evolve
PRO
1
140
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
120
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
130
エンジニア向け技術スタック情報
kauche
1
250
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
110
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
How to Ace a Technical Interview
jacobian
277
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Raft: Consensus for Rubyists
vanstee
140
7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
KATA
mclloyd
29
14k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Why You Should Never Use an ORM
jnunemaker
PRO
57
9.4k
RailsConf 2023
tenderlove
30
1.1k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Transcript
论 Mobile App ⾃自动化构建是如何炼成的
icyleaf 三⽕火 Google @icyleaf 穷游⺴⽹网
开始之前的问题 • 什么是持续集成(CI) • 什么是⾃自动化构建 • 持续集成的流程是什么
持续集成的流程 编译 打包 测试(模块/UI) 发布 反 复
⼤大纲 • Jenkins 介绍 • 安装 Jenkins • Android App
⾃自动化构建 • iOS App ⾃自动化构建
Jenkins • 开源项⺫⽬目 • 市⾯面上使⽤用最⼲⼴广泛的 CI 系统 • ⽀支持所有平台(基于 Java
发布) • 极其丰富的插件库(300+) • 背后有众多商业公司的⽀支持
通知 pull & push fir & pgyer fir & pgyer
push pull 编译&打包 测试&发布
Jenkins 项⺫⽬目流程 • 项⺫⽬目配置 • 构建触发器 • 构建(环境) • 构建之后(⽆无关构建结果)
安装 Jenkins • CentOS: yum install jenkins • Ubuntu: apt-get
install jenkins • OS X: brew install jenkins • 更多的安装教程
安装依赖
全局依赖 • JRE • JDK • Git
None
安装通⽤用插件 • Git • Email Extension Plugin • build-environment
Android App
安装依赖 • Android SDK • build-tools • android sdk •
Gradle
安装 android sdk • 安装必要 sdk android update sdk -u
--all --filter \ tools,\ platform-tools,\ build-tools-20.0.0,\ android-21 • 安装⾃自定义依赖 android update sdk -u --all --filter \ extra-android-m2repository,\ extra-android-support,\ extra-google-google_play_services_froyo,\ extra-google-google_play_services,\ extra-google-m2repository
android sdk 失败了! • 改 hosts 203.208.46.146 www.google.com 203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com • 执⾏行命令强⾏行不⾛走 https android update sdk -u -s --filter platform-tools,android-21
更好的⽅方案代理 • 图形化界⾯面有个代理的选项命令⾏行同样⽀支持 android update sdk -u -s —proxy-host mirrors.neusoft.edu.cn
— proxy-port 80 —filter platform-tools,android-21 更多国内镜像
gradle 项⺫⽬目根⺫⽬目录
gradle 主项⺫⽬目
gradle 模块项⺫⽬目
gradle 解答 • gradle 是扩展 maven/ant 的增强构建⽅方案 • gralde android
插件版本依赖 gradle 命令版本 • gradle 可以集成多个模块(本地/⺴⽹网络) • gradle ⽀支持 Java/Groovy 的内容扩展 • gradle 中⽂文指南(⺩王伟提供) • 使⽤用 wrapper ⽀支持各种版本
配置 Jenkins • 安装插件 • gradle • android Lint •
javadoc • ruby-runtime • 配置全局环境
全局属性
Gradle
创建项⺫⽬目
配置仓库
构建触发器
构建(编码/打包) 1 2 3
构建结束之后 1 2
Email 通知
iOS App
安装依赖 (Mac OSX ONLY) • Xcode • Command Line Tools
• Ruby(Gems)
配置 Jenkins • Jenkins Slave(可选) • 安装插件 • xcode integration
• cocoapods jenkins • iOS device connector • 配置全局环境
Jenkins slave
创建项⺫⽬目
配置仓库
构建触发器
构建(编码/打包) • Xcode integration • xcodebuild/xcrun • xctool • shenzhen(ipa)
项⺫⽬目设定
Xcode integration 签名证书
Xcode integration 项⺫⽬目配置
xcodebuild by apple // unlock keychain security unlock-keychain -p {password}
~/Library/Keychains/login.keychain // clean and build .app for project xcodebuild clean build -project QYER.xcodeproj -configuration Release // build .app for workspace xcodebuild clean build -workspace QYER.xcworkspace -scheme QYER -configuration AdHoc // code sign and archive ipa file xcrun -sdk iphoneos PackageApplication -v ~/Desktop/QYER.app -o ~/Desktop/QYER.ipa --sign "iPhone Distribution: <QYER Inc>" --embed ~/Downloads/QYER_Ad_Hoc.mobileprovision
构建输出 xcodebuild
xctool by facebook // unlock keychain security unlock-keychain -p {password}
~/Library/Keychains/login.keychain // clean and build .app for project xctool clean build -project QYER.xcodeproj -configuration Release // build .app for workspace xctool clean build -workspace QYER.xcworkspace -scheme QYER -configuration AdHoc // code sign and archive ipa file xcrun -sdk iphoneos PackageApplication -v ~/Desktop/QYER.app -o ~/Desktop/QYER.ipa --sign "iPhone Distribution: <QYER Inc>" --embed ~/Downloads/QYER_Ad_Hoc.mobileprovision
可读性更强 xctool
Xcode Archive
Shenzhen by nomad // unlock keychain security unlock-keychain -p {password}
~/Library/Keychains/login.keychain // clean and build code sign .ipa for project ipa build -p QYER.xcodeproj -c Release —clean // just build code sign .ipa for workspace ipa build -w QYER.xcworkspace -s QYER -c AdHoc —no-clean // distribute .ipa to somewhere (10 channels) ipa distribute:fir ipa distribute:itunesconnect
构建结束之后 1 2
Email 通知
继续智能化! • ⾃自动下载安装证书和 profile • cupertino • 智能替换 xcode 项⺫⽬目的
code sign 配置 • plist • xcodeproject
参考资料 • Android • Building Gradle Projects with Jenkins CI
• How To Build Android Apps with Jenkins • iOS • How to configure Jenkins CI on Mac OS X to build Android- and iOS • Applying Continuous Deployment to iOS • IOS AND JENKINS: HOW WE USE IT
Q&A
Thanks