Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automate Everything - Continuous Integration for iOS and Mac

Automate Everything - Continuous Integration for iOS and Mac

Presented at 360iDev on 9/10/13

Whether working in the enterprise, as an indie, or something in between, a developer needs to optimize their time. Real benefit can be found by automating recurring tasks. In this talk I'll describe how developers in any size organization can derive a benefit from using continuous integration to automate tasks. You'll learn how to get a basic Jenkins instance setup in minutes that will do the basics of getting your builds every time you check in code. With the basics automated, I'll show you how to expand into other automated tasks:

- Distributing builds to testers.
- Running unit tests.
- Static code analysis.
- Deploying and running an OSX app in a virtual machine.
- Taking screenshots for the app store.

Anything worth doing twice is worth automating, so start automating and get back to your real work.

4e264a4ba35b07be0661565fa5e75b81?s=128

Brian Partridge

September 15, 2013
Tweet

Transcript

  1. Automate Everything Continuous Integration for iOS and Mac by Brian

    Partridge
  2. @brianpartridge http://brianpartridge.name Who?

  3. Agenda • The What & Whys of CI • Introduction

    to Jenkins • More Advanced Techniques
  4. Build ⌘ + B ⌘ + B ⌘ + B

    ⌘ + B ⌘ + B ⌘ + B ⌘ + B ⌘ + B ⌘ + B ⌘ + B
  5. Every. Single. Time. Release Release Notes Archive Products Screenshots Deployment

    Building Provisioning Profiles
  6. Automate Everything • Compilation • Testing • Archiving • Deployment

    Anything worth doing more than once is worth automating.
  7. Continuous Integration “The practice of merging multiple developer working copies

    several times a day.” “The practice of determining characteristics of code and performing actions based on those characteristics.” +
  8. Your Personal Robot

  9. What’s a Jenkins? • Web Service • Open Source •

    Vetted By Enterprise • Small Footprint
  10. Your First Automated Build • Installation • Plugins • Configuration

    • Demo
  11. Installation > brew install jenkins > java -jar /usr/local/opt/ jenkins/libexec/jenkins.war

    > open http://localhost:8080
  12. Plugins • Source Control • git, mercurial, svn, etc •

    Build Systems • Xcode, Maven, Ant, etc
  13. Plugins

  14. Get A Job • Source Control • Build Frequency •

    Build Step
  15. Live Demo What could go wrong?

  16. Finishing Your Job • Subsequent Jobs • Unit Tests •

    Static Analysis • Deployment
  17. Live Demo He’s at it again!

  18. Jenkins Backup

  19. Intermediate Techniques

  20. • Parameterized Builds • Scripts • Multiple Build Hosts *

    Image © 2012-13 xkcd - http://what-if.xkcd.com/13/
  21. Build Parameters

  22. Scripts • xcodebuild • agvtool new-version -all "$BUILD_NUMBER" • Open

    the Keychain • https://github.com/brianpartridge/iOS-Build-Scripts
  23. Multiple Build Hosts

  24. Advanced Techniques

  25. Jenkins API • url + “/api/json” • http://localhost:8080/job/Hello%20iPhone/ lastBuild/api/json

  26. iOS Screenshots • KSScreenshotManager • WaxSim • http://ksuther.com/2013/02/24/automating- ios-app-store-screenshots/

  27. Supporting Legacy OSX • VMware Fusion • vmrun CLI •

    Start and Stop VMs • Manage Snapshots • Run Scripts
  28. Live Demo One more time.

  29. Wrapping Up Let the robots make your life better.

  30. More Info • http://jenkins-ci.org • Jenkins: The Definitive Guide by

    John Ferguson Smart • http://bit.ly/automate-everything
  31. Thank You!