# How to automagically deploy to [Testflight](http://www.testflightapp.com) using [Travis-CI](https://travis-ci.com) 1. Copy the .travis.yml into your repo and edit it 1. Replace [Workspace name] with your workspace name. If you don't have a .workspace file and wish to use your .xcodeproj file replace the -workspace flag with a -project flag followed by your project name. 2. Replace [Scheme to use] with the Scheme you wish to use. 3. Replace [Build configuration name] with the build configuration you want to use. 4. Replace [Comma separated Testflight distributions lists] with the Testflight distributions lists. 5. Replace [Name of .app file] with the name of your App. In most cases it's same name as your project name. 6. Replace [Organization name] with the name of the organization defined in the certificate you will use to sign this App. You'll find this in your keychain. If the certificate has ([User ID]) at the end, don't forget to update [User ID]. If not, delete ([User ID]) and the brackets surrounding it. 7. Replace [Name of provisioning file] with the file name of your provisioning file name without the extension. 2. Create the folders "scripts/travis/profile" 3. Export the following things from the Keychain app 1. "Apple Worldwide Developer Relations Certification Authority" to scripts/travis/apple.cer 2. Your iPhone Distribution certificate to scripts/travis/dist.cer 3. Your iPhone Distribution private key to scripts/travis/dist.p12 (Important to choose a proper password) 4. Execute `travis encrypt "KEY_PASSWORD=[Your .p12 password]" --add` 5. Execute `travis encrypt "TEAM_TOKEN=[Testflight team token]" --add` 1. You'll find your Team token [here](https://www.testflightapp.com/dashboard/team/edit/) 6. Execute `travis encrypt "API_TOKEN=[Testflight API token]" --add` 1. You'll find your API token [here](https://www.testflightapp.com/account/#api) 7. Copy add-key.sh, remove-key.sh and testflight.sh to scripts/travis 8. Copy your mobile provisioning profile to scripts/travis/profile/ 9. Stage all the new files, it should be: - .travis.yml - apple.cer - dist.cer - dist.p12 - [Name of provisioning file].mobileprovision - add-key.sh - remove-key.sh - testflight.sh 10. Commit and push! 11. That's a Wrapp! ;) ## Only sending to Testflight if branch is "build_testflight" In testflight.sh on row 6 we check which branch is being built. At the moment it will only send it to Testflight if the current branch is named "build_testflight". Feel free to remove this if it doesn't suit your needs :)