Slide 1

Slide 1 text

Continuous Integration iOS on Travis

Slide 2

Slide 2 text

The idea • Atomic commits • Automated, test, build and delivery • One version, aka. no branching

Slide 3

Slide 3 text

Actual steps • Write Test • Write Code • Push - Github • Automated Test - Travis-CI • Automated distribution - TestFlight

Slide 4

Slide 4 text

Test in general • Input <—> Output Checking • Function <—> State Checking • Actions <—> Behaviour Checking

Slide 5

Slide 5 text

Test in Xcode • XCTest automatically include since Xcode5 • Press ⌘+U • xcodebuild • xctool - facebook xcodebuild with pretty print

Slide 6

Slide 6 text

Travis.yml language: objective-c script: - xctool test -workspace asosnewin.xcworkspace -scheme asosnewin -sdk iphonesimulator7.0 ONLY_ACTIVE_ARCH=NO

Slide 7

Slide 7 text

Build,Sign and distribute • xctool -workspace asosnewin.xcworkspace -scheme asosnewin -sdk iphoneos7.1 -configuration Release OBJROOT=$PWD/build SYMROOT=$PWD/build ONLY_ACTIVE_ARCH=NO • xcrun -log -sdk iphoneos PackageApplication "$APP_NAME.app" -o "$APP_NAME.ipa" -sign "$DEVELOPER_NAME" -embed "$PROVISIONING_PROFILE" • curl http://testflightapp.com/api/builds.json -F file="@$APP_NAME.ipa"

Slide 8

Slide 8 text

Setup Env on Travis • travis encrypt "APP_NAME=GIFCAM" —add • Keys • Encrypt with openssl aes-256-cbc and checkin into github • decrypt the key and do security import on travis

Slide 9

Slide 9 text

Reference • http://www.objc.io/issue-6/travis-ci.html • http://martinfowler.com/articles/ mocksArentStubs.html • https://developer.apple.com/library/ios/ documentation/ToolsLanguages/Conceptual/ Xcode_Overview/UnitTestYourApp/ UnitTestYourApp.html