SlideShare a Scribd company logo
1 of 30
Download to read offline
Automate your iOS deployment a bit
Michał Łukasiewicz
michal.lukasiewicz@brightinventions.pl
1 / 30
Agenda
1. Generate iOS project
2. Build your app from the command line
3. Upload to TestFlight, HockeyApp, etc.
4. Run it all on TeamCity
2 / 30
Disclaimer
What I show is based strictly on our own experience.
It's all in early phase.
Hopefully we got at least something right.
3 / 30
We don't love XCode project files
We might not be alone in this dislike
Hours wasted on merge problems
Hours wasted on code-signing issues
And we didn't learn nothing
4 / 30
XCode project hell
5 / 30
XCode project hell
6 / 30
XCode project hell - tip 1
http://stackoverflow.com/questions/12907605/xcode-project-file-git-merge-conflict
7 / 30
XCode project hell - tip 2
Use xUnique.
https://github.com/truebit/xUnique
8 / 30
XCode project hell - tip 3
Don't work in a team!
9 / 30
XCode project hell - tip 4
The way Google deals with merge conflicts in .pbxproj files:
They don’t.
.pbxproj files are created using GYP from a specification designed
to be human-readable and mergable.
Neat! That’s the kind of thing I find useful for working around Xcode.
Posted by Jason Felice Jan 5th, 2013
http://objvimmer.com/blog/2013/01/05/pbxproj-merge-hell/
10 / 30
GYP - Generate Your Projects
GYP (Generate Your Projects) is a build automation tool.
GYP is created by Google to generate native IDE project files (such as Visual
Studio and Xcode) for building the Chromium web browser and is licensed as
open source software using the BSD software license.
http://en.wikipedia.org/wiki/GYP_software
11 / 30
"targets": [
{
"target_name": "Foobar",
"sources": [
"<!@(sh scripts/list-source-files.sh)"
],
"mac_bundle_resources": [
"<!@(sh scripts/list-resource-files.sh)"
],
"xcode_settings": {
"INFOPLIST_FILE": "src/Info.plist",
"SDKROOT": "iphoneos",
"TARGETED_DEVICE_FAMILY": "1,2",
}
}
]
12 / 30
GYP in practise
A single .gyp file that describes where your sources are and what targets
to create
gyp Foo.gyp # generates Foo.xcodeproj
.gitignore all project files
*.xcodeproj/
*.xcworkspace/
don't worry if you mess anything up
install GYP
brew tap mgamer/homebrew-taps
brew install gyp
13 / 30
Creating a new project
We have a few special needs:
configure GYP
setup sensible .gitignore
disable storyboards
integrate Podfile
there are a few Pods that we use most of the time
Not that easy to do it all manually, especially if you want to do something
quickly.
14 / 30
generate-ios
generate-ios is a small Yeoman generator that lets you create a fresh project
structure from the command line
15 / 30
16 / 30
generate-ios comes with Fastlane
17 / 30
18 / 30
19 / 30
Fastfile
To run lane appstore execute from command line:
fastlane appstore
20 / 30
Bright model
Store nothing more than necessary source code and resources in the
repository
Generate project using GYP
Install Pods after project generation
Use Fastlane to build and distribute the app
21 / 30
Bright Fastlane details
Store certificate and private key in the repository
In build script we create a temporary keychain, import certificate and
private key into that keychain and we tell xctool to use that keychain
ipa and dSYM files are stored in out/ directory
Special Fastlane lane called once that downloads certificate and private
key and puts it in the repository
22 / 30
xctool
-workspace ../Foobar.xcworkspace
-scheme Foobar
-sdk iphoneos
-configuration Release
OBJROOT=out/
SYMROOT=out/
ONLY_ACTIVE_ARCH=NO
CODE_SIGN_IDENTITY="$CODE_SIGN_IDENTITY"
PROVISIONING_PROFILE="$PROVISIONING_PROFILE_UUID"
OTHER_CODE_SIGN_FLAGS="--keychain ios-build-Foobar.keychain"
23 / 30
Fastlane "once"
We define a special :once lane that:
creates an app in Apple Developer Account and iTunesConnect (using
Produce)
creates certificate (using Cert)
downloads certificate, find matching private key and stores it all in the
scripts/certs directory (using key4cert)
Thanks to this everybody can build the project without any code-signing
mess!
24 / 30
Fastlane "build"
Build lane builds the project :)
creates a temporary keychain
imports stored certificate and private key into temporary keychain
downloads and installs provisioning profile (using Sigh)
build the app using build.sh script
25 / 30
Fastlane "deploy"
Deploy pushes ipa file to HockeyApp or TestFlight or ...
26 / 30
Fastlane can also handle:
Screenshots generation for AppStore
Upload metadata and screenshot to AppStore
27 / 30
What we have so far:
Wizard to generate project structure
"Build" script
"Deploy" scripts
Project in git repository pushed to BitBucket
28 / 30
What we want to have:
Run "Build" and "Deploy" scripts for any commit automatically
29 / 30
TeamCity
30 / 30

More Related Content

Similar to Automate your iOS deployment a bit

Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with androidfirenze-gtug
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 
Lesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupLesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupUniversity of Catania
 
2014 10-14: GitHub plus FOSS == 1 million SPDX
2014 10-14: GitHub plus FOSS == 1 million SPDX2014 10-14: GitHub plus FOSS == 1 million SPDX
2014 10-14: GitHub plus FOSS == 1 million SPDXNuno Brito
 
Programming IoT with Docker: How to Start?
Programming IoT with Docker: How to Start?Programming IoT with Docker: How to Start?
Programming IoT with Docker: How to Start?msyukor
 
Xcode: Hidden Potential
Xcode: Hidden PotentialXcode: Hidden Potential
Xcode: Hidden Potentialdasdom
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Lezione 02 React and React Native installation and Configuration
Lezione 02   React and  React Native installation and ConfigurationLezione 02   React and  React Native installation and Configuration
Lezione 02 React and React Native installation and ConfigurationUniversity of Catania
 
Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0André Moreira
 
A "Box" Full of Tools and Distros
A "Box" Full of Tools and DistrosA "Box" Full of Tools and Distros
A "Box" Full of Tools and DistrosDario Faggioli
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devicesMender.io
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...BeMyApp
 
Tools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac DeploymentTools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac DeploymentTimothy Sutton
 
iOS Auto Build
iOS Auto BuildiOS Auto Build
iOS Auto BuildRyan Wu
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungKAI CHU CHUNG
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020OW2
 
OpenDayLight (ODL) Project
OpenDayLight (ODL) ProjectOpenDayLight (ODL) Project
OpenDayLight (ODL) ProjectVahid Sadri
 

Similar to Automate your iOS deployment a bit (20)

Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with android
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
Appium on mac platform
Appium on mac platformAppium on mac platform
Appium on mac platform
 
Lesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment SetupLesson 02 - React Native Development Environment Setup
Lesson 02 - React Native Development Environment Setup
 
2014 10-14: GitHub plus FOSS == 1 million SPDX
2014 10-14: GitHub plus FOSS == 1 million SPDX2014 10-14: GitHub plus FOSS == 1 million SPDX
2014 10-14: GitHub plus FOSS == 1 million SPDX
 
Programming IoT with Docker: How to Start?
Programming IoT with Docker: How to Start?Programming IoT with Docker: How to Start?
Programming IoT with Docker: How to Start?
 
Xcode: Hidden Potential
Xcode: Hidden PotentialXcode: Hidden Potential
Xcode: Hidden Potential
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Lezione 02 React and React Native installation and Configuration
Lezione 02   React and  React Native installation and ConfigurationLezione 02   React and  React Native installation and Configuration
Lezione 02 React and React Native installation and Configuration
 
Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0
 
A "Box" Full of Tools and Distros
A "Box" Full of Tools and DistrosA "Box" Full of Tools and Distros
A "Box" Full of Tools and Distros
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...
 
Tools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac DeploymentTools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac Deployment
 
iOS Auto Build
iOS Auto BuildiOS Auto Build
iOS Auto Build
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020
Nextcloud Open Source Collaborative Cloud Platform, OW2online, June2020
 
OpenDayLight (ODL) Project
OpenDayLight (ODL) ProjectOpenDayLight (ODL) Project
OpenDayLight (ODL) Project
 

Recently uploaded

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Automate your iOS deployment a bit

  • 1. Automate your iOS deployment a bit Michał Łukasiewicz michal.lukasiewicz@brightinventions.pl 1 / 30
  • 2. Agenda 1. Generate iOS project 2. Build your app from the command line 3. Upload to TestFlight, HockeyApp, etc. 4. Run it all on TeamCity 2 / 30
  • 3. Disclaimer What I show is based strictly on our own experience. It's all in early phase. Hopefully we got at least something right. 3 / 30
  • 4. We don't love XCode project files We might not be alone in this dislike Hours wasted on merge problems Hours wasted on code-signing issues And we didn't learn nothing 4 / 30
  • 7. XCode project hell - tip 1 http://stackoverflow.com/questions/12907605/xcode-project-file-git-merge-conflict 7 / 30
  • 8. XCode project hell - tip 2 Use xUnique. https://github.com/truebit/xUnique 8 / 30
  • 9. XCode project hell - tip 3 Don't work in a team! 9 / 30
  • 10. XCode project hell - tip 4 The way Google deals with merge conflicts in .pbxproj files: They don’t. .pbxproj files are created using GYP from a specification designed to be human-readable and mergable. Neat! That’s the kind of thing I find useful for working around Xcode. Posted by Jason Felice Jan 5th, 2013 http://objvimmer.com/blog/2013/01/05/pbxproj-merge-hell/ 10 / 30
  • 11. GYP - Generate Your Projects GYP (Generate Your Projects) is a build automation tool. GYP is created by Google to generate native IDE project files (such as Visual Studio and Xcode) for building the Chromium web browser and is licensed as open source software using the BSD software license. http://en.wikipedia.org/wiki/GYP_software 11 / 30
  • 12. "targets": [ { "target_name": "Foobar", "sources": [ "<!@(sh scripts/list-source-files.sh)" ], "mac_bundle_resources": [ "<!@(sh scripts/list-resource-files.sh)" ], "xcode_settings": { "INFOPLIST_FILE": "src/Info.plist", "SDKROOT": "iphoneos", "TARGETED_DEVICE_FAMILY": "1,2", } } ] 12 / 30
  • 13. GYP in practise A single .gyp file that describes where your sources are and what targets to create gyp Foo.gyp # generates Foo.xcodeproj .gitignore all project files *.xcodeproj/ *.xcworkspace/ don't worry if you mess anything up install GYP brew tap mgamer/homebrew-taps brew install gyp 13 / 30
  • 14. Creating a new project We have a few special needs: configure GYP setup sensible .gitignore disable storyboards integrate Podfile there are a few Pods that we use most of the time Not that easy to do it all manually, especially if you want to do something quickly. 14 / 30
  • 15. generate-ios generate-ios is a small Yeoman generator that lets you create a fresh project structure from the command line 15 / 30
  • 17. generate-ios comes with Fastlane 17 / 30
  • 20. Fastfile To run lane appstore execute from command line: fastlane appstore 20 / 30
  • 21. Bright model Store nothing more than necessary source code and resources in the repository Generate project using GYP Install Pods after project generation Use Fastlane to build and distribute the app 21 / 30
  • 22. Bright Fastlane details Store certificate and private key in the repository In build script we create a temporary keychain, import certificate and private key into that keychain and we tell xctool to use that keychain ipa and dSYM files are stored in out/ directory Special Fastlane lane called once that downloads certificate and private key and puts it in the repository 22 / 30
  • 23. xctool -workspace ../Foobar.xcworkspace -scheme Foobar -sdk iphoneos -configuration Release OBJROOT=out/ SYMROOT=out/ ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="$CODE_SIGN_IDENTITY" PROVISIONING_PROFILE="$PROVISIONING_PROFILE_UUID" OTHER_CODE_SIGN_FLAGS="--keychain ios-build-Foobar.keychain" 23 / 30
  • 24. Fastlane "once" We define a special :once lane that: creates an app in Apple Developer Account and iTunesConnect (using Produce) creates certificate (using Cert) downloads certificate, find matching private key and stores it all in the scripts/certs directory (using key4cert) Thanks to this everybody can build the project without any code-signing mess! 24 / 30
  • 25. Fastlane "build" Build lane builds the project :) creates a temporary keychain imports stored certificate and private key into temporary keychain downloads and installs provisioning profile (using Sigh) build the app using build.sh script 25 / 30
  • 26. Fastlane "deploy" Deploy pushes ipa file to HockeyApp or TestFlight or ... 26 / 30
  • 27. Fastlane can also handle: Screenshots generation for AppStore Upload metadata and screenshot to AppStore 27 / 30
  • 28. What we have so far: Wizard to generate project structure "Build" script "Deploy" scripts Project in git repository pushed to BitBucket 28 / 30
  • 29. What we want to have: Run "Build" and "Deploy" scripts for any commit automatically 29 / 30