\----------------------------------\
    \                                  \        __
     \   The best way to build and      \       | \
      >   deploy your iOS apps to:       >------|  \       ______  
     /     www.testflightapp.com        /       --- \_____/**|_|_\____  |
    /                                  /          \_______ --------- __>-}
   /----------------------------------/              /  \_____|_____/   |
                                                   *         |
                                                            {O}

   /*\       /*\              /*\       /*\       /*\            /*\        /*\
  |***|     |***|            |***|     |***|     |***|          |***|      |***|
   \*/       \*/    ____      \*/       \*/       \*/            \*/        \*/
    |         |     |  |       |         |         |              |          |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^															 
art by Denis Rabusseau, [email protected]

Introduction

If you ever developed an iOS app, you most likely had to deal with the tedious tasks of manually building, packaging, checking in, tagging, and distributing your iOS application to your testers through testflightapp.com.

If you haven’t, i would highly recommend you do this, at least once, manually! Then you would truly be able to appreciate this gem.

This gem is going to make your life much easier, hopefully. Here is what it does:

  1. Reads your Xcode project file to determine your app version and build number

  2. Optionally, commits all your changes to the git repository (by, first, asking you about what has changed)

  3. Builds your project (or workspace)

  4. Packages your application into an IPA file

  5. Uploads the IPA file to testflightapp.com

  6. Optinally, tags your project with the version and the build

  7. Optionally, increments your app build number and commits it to the repo

  8. Keeps a log of all your deployments to testflightapp.com in a FLIGHTLOG file

All that with a simple command:

$ testflight takeoff

Installation

gem install testflight

if you are using rbenv, you might need to run:

$ rbenv rehash

Configuration

              _______                                                                 
              \=====/                                                                
                |||                                                                   
                 #                                                                    
                 |                                                                    
    ---------------------------                                                       
    |  www.testflightapp.com  |                                                       
    ---------------------------
    \        |       |        /                                                      
     \       |       |       /                                                       
      \      |       |      /                                                        
       \     |       |     /                                                         
        ###################                                                           
        ||               ||                                                           
        ||               ||                                                           
        ||               ||                                                           
        ||               ||                                                           
        ||               ||                                                           
        ||               ||          ___                                              
        ||               ||           | \______________                              
        ||  ####         ||          ====( oooooooooo  O\__                          
        ||  #  #         ||           (________/=====>______)--                       
        ||  #  #         ||                     OO        O                           
--------------------------------------------------------------------------------

To setup your project with the deployment script, run the following command from within your Xcode project folder:

$ testflight checkin

This command will ask you a few questions about your project, which will result in creation of .tesflight file in your project folder.

If you don’t like being asked questions and prefer to configure your project manually, just create a .tesflight file yourself and provide the following information:

build:
  developer_name:     "My Company Inc"     # Must match your company name as it appears in your .cer from Apple
  increment_bundle:   true                 # Increments your build number
  architecture:       armv7
  configuration:      Release              # In Xcode 5, it must be set to Release
  sdk:                iphoneos
git:
  commit_changes:     true                 # If you want to commit changes before each build 
  tag_build:          true                 # Will tag each build in git
testflight: 
  api_token:          "abcdefghijklmnop"   # Get it from https://testflightapp.com/account/#api
  team_token:         "abcdefghijklmnop"   # Get it from https://testflightapp.com/dashboard/team/edit/
  distribution_lists: ["Developers", "Testers", "Everyone"]  # Configure your lists at https://testflightapp.com

Execution

Once you have checked in (which is done only once per project), you are ready for takeoff.

Go to your project folder and simply type:

$ testflight takeoff

Have a safe flight!

                                                            ___.----.____         
                                                     __,--(_,-'       ,-'         
                                                 _,-'               ,-'           
                                             _,-'   ()           ,-'              
                                          ,-'    ()           ,-'                 
                                       ,-'    ()           ,-'                    
                                    ,-'  __..--''       ,-'                       
                                 ,-'.--''   ,-'      ,-'                          
              |\         __..--''        ,-'      ,-':                           
              | \__..--''     ______  ,-'     _,-'   :                           
         __..--''         ,-'\_____/-'    _,-'       :                           
__..--''               ,-' ,-'  ,-'   _,-'____/      :                            
`---...___          ,-' ,-'  ,-'  _,-'    _,-'       :                            
          ``````-,-' ,-'  ,-' _,-'    _,-'           :                            
                 \,-'___,-'--''___,-'-...___         :                           
                                             ```---..:

Bonus

If you like browsing Github, finding, downloading and copying iOS libraries into your own project folder, then manually linking them, etc.., keep doing that and skip this section.

If the above task drives you crazy, then you got to try CocoaPods! cocoapods.org

It is a pretty awesome framework for “managing library dependencies in Objective-C projects”.

Here is how you can try it out:

Visit cocoapods.org and follow the instructions on how to install it. Basically, just:

$ gem install cocoapods
$ pod setup

Most of the COOL libraries are already available on CocoaPods. So search and find whatever you need.

Create a new iOS project in Xcode.

cd into the project folder and create a file name “Podfile”. Enter the following:

platform :ios, '7.0'
pod 'Reachability', '~> 3.1.1'
pod "AFNetworking", "~> 2.0"

Install the pods you just mentioned by executing:

$ pod install

Notice that when you created a project earlier, you just had a project file in your folder, but now you have a workspace file. From this point on, always use the workspace file to open your projects. Rest assure, tesflight gem knows that too.

Run the checkin command:

$ testflight checkin

Run the takeoff command:

$ testflight takeoff

Now you are all set to build the best app on the App Store.

You are now using a pretty amazing managing dependencies framweork for embedding third party libraries into your app. And you are also using an amazing service, tesflightapp.com, for distributing your app to your testers. (Don’t forget to check out the FlightPath product).

And, well, you are using this cool gem to glue it all together.

Enjoy!

Authors

Michael Berkovich

Contribution

Clone the repository, make any changes you like and send me a pull request.