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
62
我想学 Ruby 系列课程之开篇
icyleaf
0
120
使用 Kohana 轻便快速开发
icyleaf
0
120
贡嘎转山之驴行的意义
icyleaf
0
150
Install Snow Leopard on PC (Hashintosh)
icyleaf
0
160
Git 入门实战
icyleaf
8
820
Other Decks in Technology
See All in Technology
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
780
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.6k
SchooでVue.js/Nuxtを技術選定している理由
yamanoku
3
210
Context Engineeringの取り組み
nutslove
0
380
22nd ACRi Webinar - ChipTip Technology Eric-san's slide
nao_sumikawa
0
100
Why Organizations Fail: ノーベル経済学賞「国家はなぜ衰退するのか」から考えるアジャイル組織論
kawaguti
PRO
1
210
OpenShiftでllm-dを動かそう!
jpishikawa
0
140
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
2.1k
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
130
22nd ACRi Webinar - 1Finity Tamura-san's slide
nao_sumikawa
0
110
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
110
Cloud Runでコロプラが挑む 生成AI×ゲーム『神魔狩りのツクヨミ』の裏側
colopl
0
140
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
Code Reviewing Like a Champion
maltzj
527
40k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
68
How GitHub (no longer) Works
holman
316
140k
The Cult of Friendly URLs
andyhume
79
6.8k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
57
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
120
Prompt Engineering for Job Search
mfonobong
0
160
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
430
Navigating Team Friction
lara
192
16k
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