<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pavel Procházka on Medium]]></title>
        <description><![CDATA[Stories by Pavel Procházka on Medium]]></description>
        <link>https://medium.com/@hello_paja?source=rss-8a2f497eb655------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ESeaYOJh_8_-j-z79v0j_g.jpeg</url>
            <title>Stories by Pavel Procházka on Medium</title>
            <link>https://medium.com/@hello_paja?source=rss-8a2f497eb655------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:16:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hello_paja/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Xcode Server 8 tips and tricks]]></title>
            <link>https://medium.com/@hello_paja/xcode-server-8-tips-and-tricks-c33fc50942d2?source=rss-8a2f497eb655------2</link>
            <guid isPermaLink="false">https://medium.com/p/c33fc50942d2</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <dc:creator><![CDATA[Pavel Procházka]]></dc:creator>
            <pubDate>Sat, 03 Dec 2016 18:13:11 GMT</pubDate>
            <atom:updated>2016-12-03T18:20:46.651Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="http://www.apple.com/macos/server/features/#xcode-server">Xcode Server</a> — Apple’s continuous integration system for automating static analysis of software, unit testing, and build archiving has been around for a while, but it never got as much as attention as it deserves. Historically, setting up Xcode Server has been a rather <a href="https://theswiftdev.com/2016/08/29/macos-xcode-build-server-tutorial/">cumbersome</a> and <a href="https://developer.beer/how-to-configuring-an-os-x-server-machine-for-more-useful-xcode-bots-57faeed2f759#.6zmueeqny">time consuming</a> process. This made some to give up all the great power of seamless integration with Xcode IDE and reach for alternative CI servers out there. This year at WWDC during <a href="https://developer.apple.com/videos/play/wwdc2016/409/">Advanced Testing and Continuous Integration</a> session, Apple has announced exciting features and improvements to Xcode Server 8. These new enhancements make Xcode Server 8 a valuable tool you should consider setting up in your team.</p><p>In this blog post, I want to share a few tips and tricks I have learnt while setting up Xcode Server in our team. I hope, that these tips and tricks will help you make Xcode Server a robust CI server your development team can rely on and benefit from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*KHzl6OT-ZfDspDnpE2usUQ.png" /><figcaption>Xcode Server bots</figcaption></figure><h4>Disclaimer</h4><p>This blog post is not a step-by-step tutorial, but rather a comprehensive summary of best practices I have learnt while setting up Xcode Server. If you are looking for a detailed step-by-step tutorial, check out great series of <a href="https://honzadvorsky.com/pages/xcode_server_tutorials/">Xcode Server Tutorials</a> by <a href="https://twitter.com/czechboy0">Honza Dvorsky</a>.</p><p>Also, if you are still unsure about self-hosting your own build server and why to use Xcode Server rather than other CI servers (cloud or self-hosted) out there, check out my previous post <a href="https://medium.com/@hello_paja/self-hosted-ci-for-ios-mac-development-f273606ca767#.im0th2bnu">Self-hosted CI for iOS/Mac development</a>.</p><h4>TL;DR</h4><ol><li>Dedicate separated machine for Xcode Server</li><li>Create dedicated user account for Integration User</li><li>Create dedicated GitHub/Bitbucket account for Integration User</li><li>Use <a href="http://bundler.io/">Bundler</a> in your <em>project</em> to install the exact Ruby gems and versions</li><li>Use <a href="https://www.ruby-toolbox.com/categories/ruby_version_management">Ruby version manager</a> on your <em>Xcode Server</em> to manage Ruby gems</li><li>Always install and update Ruby gems and CocoaPods in pre-integration trigger</li><li>Use <a href="https://github.com/buildasaurs/Buildasaur">Buildasaur</a> macOS app for pull request testing</li><li>Use <a href="https://docs.fastlane.tools/">Fastlane</a> for deploying an app, executed in pre-integration trigger</li></ol><h4>Getting started</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*JBERqZrXp6lhLU2oQgDdWg.png" /><figcaption>macOS Server app</figcaption></figure><p><a href="https://help.apple.com/serverapp/mac/5.2/#/apdEC37D10C-B277-4C06-9E1F-8DCB0A5970EB">Xcode Server</a> is a service running — among other useful services like FTP, Wiki, Caching — within the <a href="https://help.apple.com/serverapp/mac/5.2/#/apdAC95F5C4-27AA-4378-8BB9-95A79A64AB5D">macOS Server</a> app. It can be downloaded from the <a href="https://itunes.apple.com/app/id883878097">Mac App Store</a> for $19.99. However, if you’re registered in the Apple Developer Program, you can get a redeem code and download it for free.</p><p><strong>TIP #1</strong>: I highly recommend you to dedicate Mac Mini or Mac Pro with a fresh installation of macOS Sierra for your CI server. This piece of hardware should be stationary placed on your company premises to ensure privacy, full control and availability to your development team 24/7.</p><h4>Integration User</h4><p>Once you have downloaded macOS Server app, make sure to follow the <a href="https://developer.apple.com/library/content/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/adopt_continuous_integration.html#//apple_ref/doc/uid/TP40013292-CH3-SW1">Set Up Xcode Server</a> installation guide. In step 4. (<em>Select a user account Xcode Server can use for performing integrations</em>) you will be asked to select a Testing User. Testing User (Integration User, CI User whatever you choose to call it) is a regular user account under which all Xcode Server integrations will be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*S4yUsvJPozMcrHDGahRkMA.png" /></figure><p><strong>TIP #2</strong>: Create a new non-administrator user account. <em>Do not</em> use your existing (administrator) account as you want to isolate the environment your integrations will be executed in, in order to eliminate potential security breaches.</p><p><strong>TIP #3</strong>: Create a separate GitHub/Bitbucket profile and generate new SSH keys for your Integration User. Again, you want to isolate your CI environment as much as possible.</p><h4>Ruby installation</h4><p>Chances are that your project has a dependency on one or more Ruby gem — be it <a href="https://cocoapods.org/">CocoaPods</a>, <a href="https://github.com/Carthage/Carthage">Carthage</a> or any other. Once you start to have several projects on your Xcode Server (each using a different version of e.g.: CocoaPods) it will become extremely cumbersome to manage their different gem versions.</p><p><strong>TIP #4</strong>: Install and use <a href="http://bundler.io/">Bundler</a> in your <em>project</em> to install the exact Ruby gems and versions that it needs. It only takes a few minutes to setup a <a href="http://bundler.io/gemfile.html">Gemfile</a> for your project.</p><p><strong>TIP #5</strong>: Install and use any <a href="https://www.ruby-toolbox.com/categories/ruby_version_management">Ruby version manager</a> on your <em>Xcode Server</em> to manage several versions of Ruby gems. I personally use and would recommend <a href="https://github.com/rbenv/rbenv">rbenv</a>, which is a lightweight, easy-to-use Ruby version manager that serves well to the needs of our development team.</p><h4>Bots configuration</h4><p>The way you choose to configure your bots depends on your project needs and will likely vary from one project to another. Out of the box, Xcode Server bots can perform static analysis, run tests and archive your app. This is nice, but quite often not enough. You will probably also want to execute e.g.: pod install every time your bot integrates in order to install your 3rd party libraries. Luckily, bots can be <a href="https://developer.apple.com/library/content/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/ConfigureBots.html#//apple_ref/doc/uid/TP40013292-CH9-SW1">configured to perform certain trigger</a> such as running a custom script <em>before</em> and <em>after</em> your integration.</p><p><strong>TIP #6</strong>: Always install your Ruby gems (<strong>TIP #4</strong>), update and install CocoaPods (<strong>TIP #5</strong>) dependencies in pre-integration trigger to ensure your project is in a clean and up-to-date state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*_p9J3Dg0YEmPi6XoEJnlRQ.png" /><figcaption>Bot pre-integration trigger</figcaption></figure><p>Wondering whysource ~/.bash_profile is part of the pre-integration trigger? Our ~/.bash_profile includes eval “$(rbenv init -)” command, which starts <a href="https://github.com/rbenv/rbenv">rbenv</a> (<strong>TIP #5</strong>). Bots do not load ~/.bash_profile by default and therefore it needs to be explicitly loaded through pre-integration trigger.</p><p><strong>TIP #7</strong>: Is your team using <a href="https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow">feature branch workflow</a>? Check out the <a href="https://github.com/buildasaurs/Buildasaur">Buildasaur</a> macOS app, which runs on your server and observes your GitHub/Bitbucket repo. It then creates a new bot and starts integration every time new PR is published.</p><h4>Fastlane</h4><p>As mentioned in the previous section, Xcode Server can perform static analysis, run tests and archive your app. It is a very basic set of actions you can use in your integration pipeline. This is where the rich collection of Fastlane <a href="https://docs.fastlane.tools/actions/">actions</a> and <a href="https://docs.fastlane.tools/actions/#plugins">plugins</a> comes to rescue. Use Fastlane lanes to <a href="https://docs.fastlane.tools/getting-started/ios/beta-deployment/">compose a sequence of actions</a>, executed as part of your integration.</p><p><strong>TIP #8</strong>: For deploying an app to iTunesConnect, I found it useful <em>not</em> to use any of the build-in Xcode Server actions and let Fastlane do the heavy lifting instead. Executing fastlane beta (custom lane for beta deployment) will <a href="https://docs.fastlane.tools/actions/#gym">compile the app</a>, <a href="https://docs.fastlane.tools/actions/#increment_build_number">increment the version number</a>, <a href="https://docs.fastlane.tools/actions/#pilot">upload to TestFlight</a> and <a href="https://docs.fastlane.tools/actions/#slack">notify team</a>. In this case, our bot is quite dull, because its job is to only execute Fastlane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*VWvV1i1zTHR7S8bstx-8dg.png" /><figcaption>Bot build configuration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*UC4pK8vcEztj04ELumTHaw.png" /><figcaption>Bot pre-integration trigger with Fastlane execution</figcaption></figure><h4>Conclusion</h4><p>Xcode Server has become the invisible member of our iOS team which runs our unit tests on each and every pull request, deploys new beta builds to testers and submits new App Store versions to iTunes Connect — all that automatically or with <em>just</em> 1 click on a button in Xcode. It may take some time to get Xcode Server 8 in place, but it’s totally worth the time and effort.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c33fc50942d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-hosted CI for iOS/Mac development]]></title>
            <link>https://medium.com/@hello_paja/self-hosted-ci-for-ios-mac-development-f273606ca767?source=rss-8a2f497eb655------2</link>
            <guid isPermaLink="false">https://medium.com/p/f273606ca767</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Pavel Procházka]]></dc:creator>
            <pubDate>Sat, 13 Feb 2016 16:38:37 GMT</pubDate>
            <atom:updated>2016-02-13T16:58:28.336Z</atom:updated>
            <content:encoded><![CDATA[<p>If your team is serious about agile software development practices, <a href="https://en.wikipedia.org/wiki/Continuous_integration">continuous integration</a> (CI) should be a good friend of yours. Integrating code frequently helps you discover bugs and conflicts early in the development process so you can rather spend your time building the next kick-ass feature.</p><blockquote><em>“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and remove.” </em><a href="https://www.thoughtworks.com/continuous-integration"><em>Martin Fowler</em></a></blockquote><p>In this blog post, I’ll explain <em>why</em> you should self-host your CI server on premise for your iOS/Mac development. Then I’ll give a <em>comparison</em> of <a href="http://jenkins-ci.org/">Jenkins</a> vs. <a href="https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/index.html#//apple_ref/doc/uid/TP40013292-CH1-SW1">Xcode Server</a>.</p><h3>Why should we self-host CI server?</h3><p><em>“Why should we self-host CI server for our iOS/Mac projects when there are plenty of other SaaS services?”</em> That’s a valid question your manager or colleague may ask you. While there are plenty of cloud-based CI services like <a href="https://docs.travis-ci.com/user/languages/objective-c">Travis CI</a>, <a href="https://circleci.com/mobile/ios/">Circle CI</a>, <a href="https://www.atlassian.com/software/bamboo">Bamboo</a>, <a href="https://www.buddybuild.com/">BuddyBuild</a> etc. you should consider the following:</p><h4>Privacy</h4><p>It may be a business requirement that your source code cannot leave the walls of your office. In this case, cloud-based CI is an absolute no-go!</p><h4>Full control</h4><p>Self-hosting CI gives the freedom (and obligations) to manage all hardware, software, possible plugins and extensions. This is not to say that cloud-based CIs don’t also provide you with that to a certain degree, but <strong>you</strong> won’t have full access to the physical machine.</p><h4>Staying on top of the game</h4><p>Every year, I get really excited (and bet you do too) for WWDC 2016 — <a href="http://wheniskeynote.com/">rumor says</a> it will be on the 6th of June. Apple regularly announces a new iOS/Mac version plus a handful of <a href="https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-SW1">new APIs</a> at the conference. So it’s likely you’ll spend your summer preparing your apps for these new OS versions, as well as building new features with the new cutting edge APIs. While Apple releases new beta versions of Xcode (bundled with iOS/Mac beta SDK) throughout the summer, you’ll need your CI server to use these beta versions too. Here’s where cloud-based CIs fall short. <a href="https://twitter.com/czechboy0">Honza Dvorsky</a> in his great talk <a href="https://honzadvorsky.com/articles/2015-05-28-nslondon-continuous-integration-on-the-edge/">“Continuous Integration on the Edge”</a> explained how “late” cloud-based CIs can be on offering the latest versions of Xcode. Theoretically speaking, based on the <a href="https://developer.apple.com/support/pre-release-software/">Pre-release Software document</a>, anyone with an Apple ID can download and start using pre-release versions of Xcode (thumbs up for Travis CI who already offers <a href="https://docs.travis-ci.com/user/languages/objective-c#Supported-OS-X-iOS-SDK-versions">beta version of Xcode 7.3</a> as of today). It may take hours/days/weeks for your cloud-based CI to provide you with the latest version of Xcode, which could be a blocker for your fast-paced team. Again, it’s not <strong>you</strong> who determines when you can build using the latest beta SDK, and are instead left waiting to find out when you can start.</p><p>If any of the above 3 facts sound like something your organisation does and needs, read on. Otherwise, just use cloud-based CIs for your iOS/Mac development, and use the money and space you saved from avoiding on-premise CI on a nice plant 🌻.</p><p>Cloud-based CIs are generally very easy to setup. Simply tell them where your code lives. They may run your jobs faster since they can split execution between multiple servers. BUT they may send you a bill with a hefty price tag, even though some folks, like <a href="https://travis-ci.com/plans">Travis CI</a> don’t charge anything for open-source projects. You’ll also lose the chance to connect your own physical devices and the full access to the actual machine that’s building your code. Moreover, you’ll be dependent on your CI server provider, which may or may not be to your advantage.</p><h3>Jenkins vs. Xcode Server</h3><p>In my previous blog post, I explained<a href="https://medium.com/podio-engineering-blog/how-we-use-podio-fastlane-and-jenkins-for-continuous-ios-app-delivery-d7360eb976bb#.ctyjrlesy"> How we use Podio, Fastlane, and Jenkins for continuous iOS app delivery</a>. However, there is a very appealing alternative to Jenkins called <a href="https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/index.html#//apple_ref/doc/uid/TP40013292-CH1-SW1">Xcode Server</a>.</p><p><a href="https://twitter.com/czechboy0">Honza Dvorsky</a> also wrote an awesome <a href="https://honzadvorsky.com/pages/xcode_server_tutorials/">series of tutorials</a> on how to get started and become advanced with Xcode Server. I’ll explain why you should consider using Xcode Server as self-hosted CI for your next iOS/Mac project, and why it really caught my attention.</p><h4>Cost &amp; Setup</h4><p>Jenkins is an open source, so you can get for free <a href="http://jenkins-ci.org/">here</a>. Xcode Server can be downloaded from the <a href="https://itunes.apple.com/en/app/os-x-server/id883878097?mt=12">Mac App Store</a> for $19.99. However if you’re registered in the Apple Developer Program, you can get a <a href="https://developer.apple.com/osx/download/">redeem code</a> and download it free.</p><p>In the <a href="https://developer.apple.com/videos/play/wwdc2015-410/">Continuous Integration and Code Coverage in Xcode</a> session, <a href="https://twitter.com/mjmoriarity">Matt Moriarity</a> suggests we use Xcode Server, because it’s easy to setup. And damn, he is right! Setting up Xcode Server takes only a few clicks, while setting up Jenkins is likely to give you a few hiccups in the process.</p><h4>Interaction with CI</h4><p>It probably won’t come as a surprise that Xcode Server is deeply and very well <a href="https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/view_integration_results.html#//apple_ref/doc/uid/TP40013292-CH4-SW1">integrated with Xcode</a>. Jenkins doesn’t have such a capability, and you have to interact with it via web UI or <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">command line interface</a>.</p><h4>Code coverage</h4><p><a href="https://en.wikipedia.org/wiki/Code_coverage">Code coverage</a> is a metric, that indicates the percent of your code paths that have been exercised by test suites. This metric gives confidence that your codebase is less unlikely to contain bugs. Prior to Xcode 7 it was not possible to generate coverage for Swift code. In Xcode 7, Apple introduced a new coverage format called <a href="http://llvm.org/docs/CommandGuide/llvm-profdata.html"><em>profdata</em></a> (making <em>gcov</em> legacy), which now supports Swift code — yeah 🎉.</p><p>Showing the code coverage results in Xcode Server is as easy as opening the desired Integration and choosing the <a href="https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/CheckingCodeCoverage.html#//apple_ref/doc/uid/TP40010215-CH74-SW1">Coverage tab</a>.</p><p>Jenkins doesn’t offer this luxury, leaving you with additional work. Jenkins offers the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin">Cobertura plugin</a>, which you have to point to <em>xml</em> file with your coverage data. The challenge is to convert data from <em>profdata</em> to Cobertura <em>xml</em> format. Luckily, there’s a Ruby gem called <a href="https://github.com/venmo/slather">Slather</a>, which has recently merged in a <a href="https://github.com/venmo/slather/pull/92">branch</a> providing you with functionality to convert <em>profdata</em> to Cobertura <em>xml</em> format.</p><h4>Triggers</h4><p>It’s likely you’ll want to perform certain actions before and after your CI job runs. An example of such an action could be execution of <a href="https://github.com/fastlane/fastlane">Fastlane</a> lane composed of a rich set of available <a href="https://github.com/fastlane/fastlane/blob/master/docs/Actions.md">actions</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*XZv8jrJ_3XEufWbpXoldQw.gif" /><figcaption><a href="http://giphy.com/gifs/big-push-button-GwRBmXyEOvFtK">Source</a></figcaption></figure><p>Jenkins offers a wide range of <a href="https://wiki.jenkins-ci.org/display/JENKINS/Plugins#Plugins-Buildtriggers">trigger plugins</a>. In Xcode 6, Apple has introduced triggers as an addition to Xcode Server. Triggers in Xcode Server allow you to execute an arbitrary shell script. This opens up the door to endless opportunities — like for example setting up a physical release button to start your integration 🚀 (see <a href="https://developer.apple.com/videos/play/wwdc2015-410/">demo at 31:15</a>).</p><p>For more hands-on experience with Xcode Server triggers, see <a href="https://honzadvorsky.com/articles/2015-08-17-17-30-xcode_server_tutorials_3_prebuild__postbuild_scripts/">this tutorial</a>.</p><h4>Result visualisation</h4><p>Both CIs in question provide you with useful stats and charts for an overview of how your CI job did.</p><p>Jenkins dashboard can be configured to look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7zWjNNbgAUbqSRPHUpFPQ.png" /><figcaption><a href="http://blog.octo.com/wp-content/uploads/2012/08/screenshot-dashboard-jenkins1.png">Source</a></figcaption></figure><p>While Xcode Server dashboard looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9A5anvABKb1m0IsyKsXEQ.png" /><figcaption><a href="https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/view_integration_results.html#//apple_ref/doc/uid/TP40013292-CH4-SW1">Source</a></figcaption></figure><p>Apart from showing the results of your tests and code coverage, Xcode Server integration overview provides both error and warning count. You can also see static analysis issues.</p><p>Personally, I also really like that Xcode Server has a feature to share your stats on <a href="http://help.apple.com/serverapp/mac/4.0/#/apdEEA6D6B0-FA0E-48CC-A802-84BBF074EF22">Big Screen</a>, with an appealing and clear UI. This gives everyone in your team a real time snapshot for feedback on the health status of your code base while waiting for ☕️.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*oEv-Ze3mwMgvx0Gk5Ce91A.jpeg" /></figure><p>I love the<a href="https://gist.github.com/marick/3ec112bc38b2af267e15?utm_source=hackernewsletter&amp;utm_medium=email&amp;utm_term=fav"> idea</a> of hooking up a lava lamp with a build server as a way to improve (and speed up) developers reactions to a broken build.</p><p>Luckily, both CIs provide you with REST API, enabling you to do so. See <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">Jenkins REST API</a>, <a href="https://developer.apple.com/library/tvos/documentation/Xcode/Conceptual/XcodeServerAPIReference/index.html">Xcode Server API</a> and <a href="https://github.com/czechboy0/XcodeServerSDK">Xcode Server SDK</a>.</p><h3>Conclusion</h3><p>Putting Jenkins along side Xcode Server for a comparison, I see more advantages in using Xcode Server for iOS/Mac development. Apple invested heavily into this product in recent years and I hope we’ll see more cool stuff being released at WWDC 2016. Unless there’s a business requirement to use Jenkins, I have yet to find any reasons that make a case against using Xcode Server — so in closing, I urge you to give it a try.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f273606ca767" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we use Podio, Fastlane, and Jenkins for continuous iOS app delivery]]></title>
            <link>https://medium.com/podio-engineering-blog/how-we-use-podio-fastlane-and-jenkins-for-continuous-ios-app-delivery-d7360eb976bb?source=rss-8a2f497eb655------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7360eb976bb</guid>
            <category><![CDATA[testflight]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[fastlane]]></category>
            <dc:creator><![CDATA[Pavel Procházka]]></dc:creator>
            <pubDate>Mon, 16 Nov 2015 12:03:26 GMT</pubDate>
            <atom:updated>2015-12-06T06:38:37.410Z</atom:updated>
            <content:encoded><![CDATA[<p>Here at Podio we follow <a href="https://en.wikipedia.org/wiki/Agile_software_development">agile software development practices</a> - we write user stories, timebox tasks, do pair programming, and we iterate and refactor code. However, one practise our mobile iOS team was challenged by was continuous delivery.</p><p>If you are an iOS developer, you know the thorny path your code has to go through - from a commit to your repository, all the way until a build with the latest feature reaches your users. It is a very error-prone, time consuming, and manual process no developer ever wants to go through!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*z0ebspsApN8HHIiYk-AhVQ.gif" /><figcaption><a href="http://giphy.com/gifs/the-office-no-michael-scott-ToMjGpx9F5ktZw8qPUQ">Source</a></figcaption></figure><p>Wouldn’t it be awesome to come to work every morning and have a new build with the latest code uploaded to <a href="https://developer.apple.com/testflight/">TestFlight</a>? Wouldn’t it be great to always have a build ready to send out to your beta testers or submit to the App Store? Wouldn’t it improve your team’s transparency and communication if everyone could see a build status at any time?</p><p>In this blog post, I want to show you how we use Podio, Fastlane, and Jenkins to achieve all that and smooth out the iOS release process. Before we begin, I want to give you a brief overview of tools we are using:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*AZitSoY4ajaBdsoUsYXrsQ.png" /><figcaption><a href="https://www.podio.com/">Source</a></figcaption></figure><p><a href="https://podio.com/site/en">Podio</a> is a cloud-based workflow management tool. It allows you to better organize your work processes, so your team, and entire company, can stay in-sync and collaborate more efficiently. Podio can be used for a variety of purposes: as a project management tool, a CRM, task management, or communications platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*r77T8HUrG2O3JJvLo45KeQ.png" /><figcaption><a href="https://github.com/fastlane/fastlane/blob/master/assets/fastlane_medium.png">Source</a></figcaption></figure><p><a href="https://fastlane.tools/">Fastlane</a> is an open source collection of tools for automating iOS (soon also Android) app release process. It enables developers to set up deployment infrastructure and focus on actual development rather than fixing homemade automation scripts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*s8mwAOWdb2choX4pj9ozvw.png" /><figcaption><a href="https://wiki.jenkins-ci.org/display/JENKINS/Logo">Source</a></figcaption></figure><p><a href="https://jenkins-ci.org/">Jenkins</a> is a continuous integration and continuous delivery application. You’ve likely heard of Jenkins before, as it is a commonly known tool enabling teams to ease their deployment processes.</p><p>Let’s get started with a brief explanation how we manage our beta testers and builds.</p><h3>How we manage our beta testers</h3><p>Beta testers - we treat them as gold. They give us precious feedback on our latest work. They inspire us with new ideas and feature requests, and help us discover potentials bugs before we submit a new build to the App Store.</p><p>We use <a href="https://developer.apple.com/testflight/">TestFlight</a> as our app distribution channel for beta builds. We have 2 groups of testers: internal Podio employees and external early adopters of the Podio iOS app. We have Podio workspaces for both internal and external testers (read more about <a href="https://help.podio.com/hc/en-us/articles/201018978-Creating-workspaces">creating workspaces</a>). This allows us to effectively communicate with our beta testers, gather their feedback, feature requests, and bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdTpFRVB7nrw2RVImLQs8g.png" /><figcaption>Podio iOS Beta Testing workspace</figcaption></figure><h3>How we manage builds</h3><p>We need to know several pieces of information about a build in order to effectively collaborate and communicate across the team:</p><ol><li>What is the build number?</li><li>What is the build status? (In development/TestFlight/AppStore)</li><li>Did all our tests pass?</li><li>Were there any bugs found in the build?</li></ol><p>This is where Podio apps (read more about <a href="https://help.podio.com/hc/en-us/articles/201019278-Creating-apps-">creating apps</a>) become very handy. We have a “Builds” app where we regularly create an item for every new build and update relevant information as we go (we do not do any of this manually of course).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*biv0ewWZTBEoKzbNdQVl_g.png" /><figcaption>Podio “Builds” app</figcaption></figure><p>Our “Builds” app is composed of several fields, namely:</p><ul><li>Text field for <em>name</em> — unique build name</li><li>Category field for <em>platform</em> — iOS/Android</li><li>Category field for <em>status</em> — In development/TestFlight/AppStore</li><li>Category field for <em>unit test status</em><strong><em> </em></strong>— Passed/Failed</li><li>Category field for <em>UI test status</em> — Passed/Failed</li></ul><p>Alright, now that we know how we use Podio to interact with our beta testers and bookkeep our builds, let’s dive into Fastlane.</p><h3>How we use Fastlane</h3><p>Fastlane allows us to define lanes composed of several dedicated actions. An action could be anything from making your computer say a given string (<a href="https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md#say">say</a>) to archiving your app (<a href="https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md#gym">gym</a>) and submitting it to your TestFlight testers (<a href="https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md#pilot">pilot</a>). Learn more about Fastlane installation and usage on <a href="https://github.com/KrauseFx/fastlane">Github page</a>.</p><h4>Lanes</h4><p>We currently use 3 lanes:</p><ol><li><strong>unit_test</strong>: the goal of this lane is to run a unit test against the latest commit and provide rapid feedback to developers.</li><li><strong>ui_test</strong>: the goal of this lane is to run UI tests and provide feedback to developers.</li><li><strong>make_build</strong>: the goal of this lane is to build and archive (.ipa) the app, and finally, upload it to TestFlight.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*KzAErhap-UxcTKjz_bw3zA.png" /><figcaption>Our Fastlane lanes</figcaption></figure><p>Green actions are predefined <a href="https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md">Fastlane actions</a>, while the blue actions are custom <a href="https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptX/AppleScriptX.html">AppleScripts</a>.</p><p>As you can see, each lane has a <a href="https://github.com/fastlane/fastlane/blob/master/docs/Actions.md#podio">podio_item</a> action. A podio_item action will create an item within our “Builds” app or update an item in case another item with the same unique identifier already exists. This action enables us to communicate with the Podio API from Fastlane lanes.</p><p>Snippet of podio_item action usage (see <a href="https://github.com/fastlane/fastlane/blob/master/docs/Actions.md#podio">documentation</a>):</p><pre>podio_item(<br>  identifying_value: &quot;Podio for iOS #{version} (#{build})&quot;,<br>  other_fields: {<br>    “platform” =&gt; “iOS”,<br>    “status” =&gt; “TestFlight”,<br>    “unit-test-status” =&gt; unit_status,<br>    “ui-test-status” =&gt; ui_status<br>  }<br>)</pre><p>Firstly, we pass the identifying value: the unique identifier of an item within the “Builds” app. In the snippet above, we interpolate a string with the build number (always a unique number) for this purpose. Secondly, we pass in other field values. In our case, we have fields called “platform” and “status” (to find a field name in a Podio app go to Modify app -&gt; Advanced -&gt; Developer -&gt; External ID), and give them the following string values: “iOS” and “TestFlight”. Other fields called “unit-test-status” and “ui-test-status” are given values from the variables unit_status and ui_status.</p><p>Now we know how Fastlane enables us to automate processes, and how the results are then reflected in Podio, but we are missing one part to this setup: execution. We need to execute these lanes on a regular basis, and that’s exactly what Jenkins will do for us.</p><h3>How we use Jenkins</h3><p>We use Jenkins CI to execute Fastlane lanes. We have the following jobs:</p><ol><li><strong>ios-continues</strong> job executes <strong>unit_test</strong> lane. This job is triggered with every commit to our repository.</li><li><strong>ios-ui-tests</strong> job executes <strong>ui_test</strong> lane. This job is scheduled to trigger every midnight Mon-Fri. We intentionally did not set this job to run with every commit, because it usually takes several minutes to complete. We think this could be a little overkill and potentially block other Jenkins jobs from execution.</li><li><strong>ios-nightly</strong> job executes <strong>make_build</strong> lane. This job is scheduled to be triggered every night Mon-Fri at 4 AM.</li></ol><h3>Putting it all together</h3><p>So how does it all play together?</p><p>Every workday at 4 AM Jenkins triggers the <strong>make_build</strong> lane. At the end of this lane we have a newly created build with the latest code uploaded to TestFlight. podio_item updates the status of this build within the “Builds” app to “TestFlight”. This way we stamp the build as shipped/completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*tTMwjLX-fWF87rNP37Z-zw.gif" /><figcaption><a href="http://giphy.com/gifs/happy-smile-yes-14yzBgpfJSr5nO">Source</a></figcaption></figure><p>As part of this lane, we also <a href="https://github.com/fastlane/fastlane/blob/master/docs/Actions.md#increment_build_number">increment the build number</a>. Finally, podio_item creates a new item within our “Builds” app with this new incremented build number as its “identifying_value”. Think of this newly created item as a placeholder for the next day.</p><p>As we walk in the office the next morning, we have a new build ready and processed on TestFlight (without us doing anything). We gain the freedom of moving this build to our external testers or even submit it for App Store review at any time without delays. As we work throughout the day, the <strong>unit_test</strong> lane gets executed (triggered with every commit to repository). This changes the unit test status (Passed/Failed) on our placeholder item within Podio.</p><p>At midnight the <strong>ui_test</strong> lane gets executed. This changes the UI test status (Passed/Failed) on our placeholder item within Podio. And the workflow starts again.</p><h3>Conclusion</h3><p>We find the combination of Podio, Fastlane, and Jenkins to be a great mix of tools for automating our workflows. It enables us to have a new build on a daily basis. This build gets labeled during the day, reflecting the “health” of the build.</p><p>Moving forward, we plan to include <a href="http://giphy.com/gifs/happy-smile-yes-14yzBgpfJSr5nO">sigh</a>, <a href="https://github.com/fastlane/snapshot">snapshot</a><strong>,</strong> and <a href="https://github.com/fastlane/frameit">frameit</a> into our workflow. Moreover, we also plan to use <a href="https://github.com/fastlane/boarding">boarding</a> to ease the process of becoming Podio iOS beta tester.</p><p>We are very excited about the recent announcement of <a href="https://github.com/KrauseFx/fastlane/blob/master/docs/Android.md">Fastlane support for Android</a>. The iOS team greatly benefits from the current infrastructure and we see this as an opportunity also for the Android team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7360eb976bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/podio-engineering-blog/how-we-use-podio-fastlane-and-jenkins-for-continuous-ios-app-delivery-d7360eb976bb">How we use Podio, Fastlane, and Jenkins for continuous iOS app delivery</a> was originally published in <a href="https://medium.com/podio-engineering-blog">Podio Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>