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
810
Other Decks in Technology
See All in Technology
【新卒研修資料】数理最適化 / Mathematical Optimization
brainpadpr
26
13k
形式手法特論:位相空間としての並行プログラミング #kernelvm / Kernel VM Study Tokyo 18th
ytaka23
3
1.3k
ユーザー課題を愛し抜く――AI時代のPdM価値
kakehashi
PRO
1
110
データモデリング通り #2オンライン勉強会 ~方法論の話をしよう~
datayokocho
0
150
猫でもわかるQ_CLI(CDK開発編)+ちょっとだけKiro
kentapapa
0
3.4k
マルチプロダクト×マルチテナントを支えるモジュラモノリスを中心としたアソビューのアーキテクチャ
disc99
1
480
20250807_Kiroと私の反省会
riz3f7
0
210
JAWS AI/ML #30 AI コーディング IDE "Kiro" を触ってみよう
inariku
3
360
Amazon Q と『音楽』-ゲーム音楽もAmazonQで作成してみた感想-
senseofunity129
0
140
LLM 機能を支える Langfuse / ClickHouse のサーバレス化
yuu26
9
1.6k
[OCI Technical Deep Dive] OracleのAI戦略(2025年8月5日開催)
oracle4engineer
PRO
1
150
バクラクによるコーポレート業務の自動運転 #BetAIDay
layerx
PRO
1
940
Featured
See All Featured
Bash Introduction
62gerente
614
210k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
KATA
mclloyd
32
14k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Six Lessons from altMBA
skipperchong
28
3.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Site-Speed That Sticks
csswizardry
10
760
The Cult of Friendly URLs
andyhume
79
6.5k
Designing for humans not robots
tammielis
253
25k
It's Worth the Effort
3n
185
28k
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