ThoughtWorks
  • Contact
  • Español
  • Português
  • Deutsch
  • 中文
Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

    Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

    Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

    Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
Go to overview

Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
  • Español
  • Português
  • Deutsch
  • 中文
ThoughtWorksMenu
  • Close   ✕
  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact
  • Back
  • Close   ✕
  • Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

  • Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

  • Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Back
  • Close   ✕
  • Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
  • Back
  • Close   ✕
  • Go to overview
  • Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

  • Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

  • All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

  • Back
  • Close   ✕
  • Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

  • Back
  • Close   ✕
  • Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
Blogs
Select a topic
View all topicsClose
Technology 
Agile Project Management Cloud Continuous Delivery  Data Science & Engineering Defending the Free Internet Evolutionary Architecture Experience Design IoT Languages, Tools & Frameworks Legacy Modernization Machine Learning & Artificial Intelligence Microservices Platforms Security Software Testing Technology Strategy 
Business 
Financial Services Global Health Innovation Retail  Transformation 
Careers 
Career Hacks Diversity & Inclusion Social Change 
Blogs

Topics

Choose a topic
  • Technology
    Technology
  • Technology Overview
  • Agile Project Management
  • Cloud
  • Continuous Delivery
  • Data Science & Engineering
  • Defending the Free Internet
  • Evolutionary Architecture
  • Experience Design
  • IoT
  • Languages, Tools & Frameworks
  • Legacy Modernization
  • Machine Learning & Artificial Intelligence
  • Microservices
  • Platforms
  • Security
  • Software Testing
  • Technology Strategy
  • Business
    Business
  • Business Overview
  • Financial Services
  • Global Health
  • Innovation
  • Retail
  • Transformation
  • Careers
    Careers
  • Careers Overview
  • Career Hacks
  • Diversity & Inclusion
  • Social Change
Software TestingTechnology

Applying Continuous Deployment to iOS

Rafael Garcia Rafael Garcia

Published: Feb 18, 2014

The pace with which the development of mobile applications grows is impressive. An interesting challenge is to maintain agile practices in such an environment where resources are always limited. We must rely on the help of simulators, Mac servers, a lot of Apple configurations, and so on. ThoughtWorks is a pioneer in using agile methodologies such as process automation and continuous delivery for web projects, and this should not be different for mobile. On our mobile projects, we continuously deploy to the client device. This puts him closer to the development process, leads to early feedback, and allows us to test the application in a real environment. Thus the client can easily decide when to launch his wonderful app to the world. Cool huh? So let's do it!

Assumptions for this post:

  • You have an Apple iOS Developer Enterprise Account - required to have an Ad Hoc Apple certificate, enabling deployment in Testflight.
  • You have Jenkins, Go or any other CI of your preference installed.

Step #1 Configuration on Apple's website

1. Login to your Apple account and click on "Certificates, Identifiers & Profiles".

2. Create a Distribution Certificate

Under "Certificates", add a new Distribution Certificate.

Download the .p12 file and install it.

3. Create an App ID

Under Identifiers, add a new App ID.

Enter the required fields. The BundleID can be found in XCode in its target General tab.

For example, we can create a Wildcard AppID, with the Bundle ID as "com.thoughtworks. *".

4. Add devices to your Apple account

Under "Devices", add a new one. Enter the name and UDID.

If you have trouble finding the UDID of your phone, see the link http://whatsmyudid.com/

5. Create an Ad Hoc Provisioning Profile.

Under "Provisioning Profiles", add a new one.

Select "Ad Hoc". In the steps that follow, choose your AppID, distribution certificate, the devices to which you want to be able to install your app, generate the profile and download it. Double-click on it and Add to your Library.

Step #2 Configuration on the TestFlight website

1. Create an account on Testflight and then create a team by clicking the "Create a new team" button.

2. Click the “People” link and create a new distribution list using the "Add distribution list" button. Give a name to the list and select the users to whom you want to provide a version of the app for every build in Jenkins.

3. Click on your avatar and visit the Account Settings link. Then click on the Devices link and follow the instructions. After logging into your phone via your account, it should appear on the page:

Step #3 Configuring your project

If you want to test an actual device, you must set your Apple Developer Certificate to your project:

1. Check the settings of your target in your project in XCode.

2. On the General tab, select your team:

3. Add your Ad Hoc Provisioning Profile and Distribution Certificate. In the Build Settings tab, under Code Signing, enter the Code Signing Identity > Release and the Provisioning Profile:

Step #4 Configuring your CI

We will be using Jenkins in this post.

1. Create a new "Build a free-style software project" project.

2. Configure the clone of your repository:

3. Install xctool - a replacement for Apple's xcodebuild that makes it easier to build and test your iOS projects:

$ brew install xctool

4. Add the following commands in the build phase:

Give access permission to your keychain: This is optional. You can also click "Allow" when the build process prompts.

security unlock-keychain -p <MAC_USER_PASSWORD> $HOME/Library/Keychains/login.keychain

Test

xctool -project Example.xcodeproj -scheme Example test -test-sdk iphonesimulator

Build

xctool -project Example.xcodeproj -sdk iphoneos -scheme Example build CONFIGURATION_BUILD_DIR=~/Desktop

Sign the app

xcrun -sdk iphoneos PackageApplication -v ~/Desktop/Example.app -o ~/Desktop/Example.ipa --sign "iPhone Distribution: <CERTIFICATE_NAME>" --embed ~/Desktop/Example_Ad_Hoc.mobileprovision

Upload to TestFlight using it's API

curl http://testflightapp.com/api/builds.json \

   -F file=@"$HOME/Desktop/Example.ipa" \ # path to your .ipa file

   -F api_token='<YOUR_UPLOAD_API_TOKEN>' \ # you can find it at https://www.testflightapp.com/account/#api

   -F team_token='<YOUR_TEAM_TOKEN>' \ # you can find it at https://www.testflightapp.com/dashboard/team/edit/

   -F notes="`git log -1 --pretty=%B`" \ # gets the last commit message

   -F distribution_lists='devs' # the name of your distribution list in Testflight

5. Run "Build now" and it should work as expected.

Tip

If you face problems installing the app on your phone, try using the iPhone Configuration Utility to view your phone logs.

That's it for now. I'm curious, what is your opinion about the process? Do you have a different approach to achieving the same goal?

Share your thoughts with us below…

.

  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact

WeChat

×
QR code to ThoughtWorks China WeChat subscription account

Media and analyst relations | Privacy policy | Modern Slavery statement ThoughtWorks| Accessibility | © 2021 ThoughtWorks, Inc.