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
160
Git 入门实战
icyleaf
8
810
Other Decks in Technology
See All in Technology
dbtとAIエージェントを組み合わせて見えたデータ調査の新しい形
10xinc
7
1.8k
CloudComposerによる大規模ETL 「制御と実行の分離」の実践
leveragestech
0
180
最近読んで良かった本 / Yokohama North Meetup #10
mktakuya
0
740
LLM APIを2年間本番運用して苦労した話
ivry_presentationmaterials
10
7.9k
今から間に合う re:Invent 準備グッズと現地の地図、その他ラスベガスを周る際の Tips/reinvent-preparation-guide
emiki
1
280
短期間でRAGシステムを実現 お客様と歩んだ生成AI内製化への道のり
taka0709
1
190
datadog-incident-management-intro
tetsuya28
0
120
ゼロコード計装導入後のカスタム計装でさらに可観測性を高めよう
sansantech
PRO
1
710
AI-ready"のための"データ基盤 〜 LLMOpsで事業貢献するための基盤づくり
ismk
0
110
GTC 2025 : 가속되고 있는 미래
inureyes
PRO
0
150
AWS re:Invent 2025事前勉強会資料 / AWS re:Invent 2025 pre study meetup
kinunori
0
1.1k
AIの個性を理解し、指揮する
shoota
3
630
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
36
7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Making Projects Easy
brettharned
120
6.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
GitHub's CSS Performance
jonrohan
1032
470k
It's Worth the Effort
3n
187
28k
Designing Experiences People Love
moore
142
24k
Thoughts on Productivity
jonyablonski
72
4.9k
Fireside Chat
paigeccino
41
3.7k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
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