Continuos integration for iOS projects


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Building an iOS app has never been an easy task for iOS developers. Creating an Ad-hoc and AppStore build requires a sequence of steps to be performed and many assets to be considered: certificates, provisioning profiles, entitlement file, various settings. This is prone to human error for sure. Also, in a multi-developer environment, with many frequent commits/contributions to the source code, it is a true challenge keeping the build stable at any moment.
  • Introduce CI
  • The most important thing for me was to restrict the usage to tied jobs only because I didn´t want our Java projects to be built on the slave too. Remote FS root folder on the slave to store temporary files and workspaces Launch Method method used to start the slave instance. After configuring the master it was time to start the Jenkins slave. The cool thing about this is that you don´t need to install a full Jenkins on the slave. All you need is a simple jar file called slave.jar, that you can download directly from your Jenkins instance. Once we had a running Jenkins it was time to get the build tools on it. This basically means Xcode which can be installed via the Appstore (at the time of writing Xcode 4.3.2 is the latest).
  • Explain what does rake ci means? Restrict where this project can be run -> mac_slave
  • Continuos integration for iOS projects

    1. 1. Continuous integrationforiOS projectsAleksandra GavrilovskaNetcetera355
    2. 2. AGENDA> iOS App Distribution Process> Practices of Continuous Integration> Jenkins – How to configure slave – How to configure job> Build system at Netcetera – Overview of rake tasks – Benefits – Improvements 2
    3. 3. iOS App Distribution Process 3
    4. 4. Practices of Continuous Integration> Maintain a code repository> Automate the build> Make the build self-testing> Everyone commits to the baseline every day> Every commit (to baseline) should be built> Keep the build fast> Test in a clone of the production environment> Make it easy to get the latest deliverables> Everyone can see the results of the latest build> Automate deployment 4
    5. 5. overview> Open source continuous integration service provider> Runs in servlet container such as Apache Tomcat> iOS Projects MUST be build on Mac> Jenkins instances as slaves 5
    6. 6. Configuring Jenkins Mac Slave 6
    7. 7. Create New Job> Properties that must be set 7
    8. 8. Custom build system> Implemented in Ruby> Rake wrapper around xcodebuild – Rakefile – Several Ruby scripts – Included in our xCode project templates 8
    9. 9. Rakefilexcode_project :"___PROJECTNAME___" do # The artifact_id is a alias for the main Xcode target artifact_id "___ARTIFACT_ID___” project_id "___PROJECT_ID___" group_id "___GROUP_ID___" svn "___SVN___" release_destination"" snapshot_destination"" itunes_artwork "src/main/resources/iTunesArtwork” adhoc_package "NetceteraAdhoc" do identity "iPhone Distribution: Netcetera AG" # by default the provisioning profile used will besrc/packaging/ADHOC_PACKAGE_NAME.mobileprovision # you can override by using # provisioning_profile "path to provisioning profile" endend 9
    10. 10. Rake tasks gavrilo-2:agavrilo$ rake –tasks ake build # Invokes xcode build to compile the project ake ci # Invoked by the CI system ake clean # Cleans the project ake package # Creates the packages ake release # Performs a release ake release:rollback # [TBD] ake report # Reports to techISR. ake symbolicate # Symbolicates the crash report provided under the REPORT variable. ake test # Invokes The tests 10 ake uitest # Run Cucumber features
    11. 11. Test execution> rake test> GHUnit as testing framework> Jenkins can run GHUnit tests –> UnitTest target should Run Script> Tests are executed on Simulator> JUnit test result report is created (XML file)> Reports to internal reporting tool 11
    12. 12. Packaging> rake package> ‘Release’ configuration must exist in project scheme> Creates app store package> .dSYM file is stored> Creates adhoc packages by resigning the app store packages – Decreases the build time – App store and adhoc application are both identical! 12
    13. 13. Deployment> rake delivery> Deploys all artifacts to snapshot_destination – All provisioning profiles – App store build – .dSYM package – *.ipa packages> Ready to be fetched for testing or submission in iTunes Connect 13
    14. 14. Debugging: Symbolicate crash > rake symbolicate REPORT=path_to_report – REPORT can be a path to directory > Extract the uuid from the crash reportlines = File.readlines(report).map {|line|"rn", )}line = lines[lines.index("Binary Images:") + 1]line.match(/armv[67] +<[0-9a-z]+>/)[0].split( ).map {|entry|"<>", )} > find the appropriate (matching) build on the DAV server "No snapshot can be found that matches uuid: #{uuid}, for architecture: #{arch}” > download it > unpack it > symbolicate it 14
    15. 15. Conclusion> Benefits – Not dependent on xCode version – Control of the build process – Control of the project state – Applications are always ready to be tested – Debugging – Scalable and configurable build system •build of workspace •Installation of pods> Improvements – Installation of certificates in keychain – Check for code duplicates – Check style 15
    16. 16. Questions 16
    17. 17. Aleksandra