Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
Introduction to Bill One Development Engineer
sansan33
PRO
0
330
生成AI時代の自動E2Eテスト運用とPlaywright実践知_引持力哉
legalontechnologies
PRO
0
110
こがヘンだよ!Snowflake?サービス名称へのこだわり
tarotaro0129
0
110
Data Hubグループ 紹介資料
sansan33
PRO
0
2.3k
eBPFとwaruiBPF
sat
PRO
4
1.7k
なぜフロントエンド技術を追うのか?なぜカンファレンスに参加するのか?
sakito
9
2k
Docker, Infraestructuras seguras y Hardening
josejuansanchez
0
150
pmconf2025 - 他社事例を"自社仕様化"する技術_iRAFT法
daichi_yamashita
0
540
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
570
How native lazy objects will change Doctrine and Symfony forever
beberlei
1
380
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
Product Engineer
resilire
0
140
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
How STYLIGHT went responsive
nonsquared
100
5.9k
We Have a Design System, Now What?
morganepeng
54
7.9k
What's in a price? How to price your products and services
michaelherold
246
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Code Review Best Practice
trishagee
73
19k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
How to Ace a Technical Interview
jacobian
280
24k
KATA
mclloyd
PRO
32
15k
GraphQLとの向き合い方2022年版
quramy
50
14k
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