<?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 Aidos Mukatayev on Medium]]></title>
        <description><![CDATA[Stories by Aidos Mukatayev on Medium]]></description>
        <link>https://medium.com/@mukatayev19?source=rss-296b1183cfa3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X7bFbNcKf0pbo43DdW1rHQ@2x.jpeg</url>
            <title>Stories by Aidos Mukatayev on Medium</title>
            <link>https://medium.com/@mukatayev19?source=rss-296b1183cfa3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:42:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mukatayev19/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[Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 3/3]…]]></title>
            <link>https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-3-3-5fd5de2c7da?source=rss-296b1183cfa3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fd5de2c7da</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[testflight]]></category>
            <category><![CDATA[app-store]]></category>
            <dc:creator><![CDATA[Aidos Mukatayev]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 09:59:45 GMT</pubDate>
            <atom:updated>2023-01-23T10:24:20.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 3/3] (2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*XJKMaGowkzMJVFJ_LhX0ng.png" /></figure><p>Welcome to the final part of our three-part series on creating an app in the App Store Connect and automating provisioning profiles and certificates with Fastlane.</p><p>In the previous part, you learned how to create an app in the App Store Connect and how to automate provisioning profiles and certificates in Fastlane. In this final installment, I will be showing you how to finally setup the whole fastlane pipeline up to TestFlight upload. So, let’s dive in and get started on setting up your final working Fastlane pipeline for your iOS project.</p><h4>What will you learn and understand in part 3:</h4><ul><li>How to setup lanes for app build, test, and TestFlight upload 🚀</li><li>Tips and tricks related to Fastlane 🧠</li><li>Follow up 🏁</li></ul><h4>GitHub link</h4><p>If you want to check the final project, you can access it here: <a href="https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial">https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial</a></p><h3>Lets Continue.</h3><p>Let’s start from the table of contents.</p><p>The following is the table of contents Part 3:</p><p><strong>Part 3 Table of contents:</strong></p><ul><li><strong>Step 4.</strong> <strong>Fastfile Lane 2</strong>: Running tests</li><li><strong>Step 5.</strong> <strong>Fastfile Lane 3</strong>: Project build</li><li><strong>Step 6.</strong> <strong>Fastfile Lane 5</strong>: Testflight upload</li><li><strong>Step 7. </strong>Full pipeline test</li><li>Useful tips and tricks</li><li>Conclusion and follow up.</li></ul><h3>Where did we stop?</h3><ul><li>In the last part of the Part 2, we completed the setup of the initial lane known as “<strong>match_certificates</strong>”. The next phase involves configuring the remaining pipeline stages to enable the capability of uploading the app to TestFlight. Let’s continue</li></ul><h3><strong>Step 4.</strong> <strong>Fastfile Lane 2</strong>: Running tests</h3><p>The second lane that we are going to work on is related to unit tests. Whenever you want to do a build delivered to the testflight, you always want to make sure that your project passes all unit tests successfully. And to enable automatic running of the tests in the fastlane we are going to use a fastlane’s tool called “<strong>Scan</strong>”.</p><h4>Setup Scan</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4pFva7XcqtO-vcODO61Ukw.png" /><figcaption>Fstlane Scan action</figcaption></figure><blockquote>The easiest way to run tests of your iOS and Mac app</blockquote><blockquote><em>scan</em> makes it easy to run tests of your iOS and Mac app on a simulator or connected device.</blockquote><p>This tool is pretty easy to enable, however, it has a very nice set of configurations that you can acecss with this link: <a href="https://docs.fastlane.tools/actions/scan/">link</a>. But for the sake of simplicity we are going to focus on unit tests here.</p><p>Let’s open a Fastfle and create a new lane called ‘<strong>run_unit_tests’.</strong></p><pre>#Tests<br>  desc &quot;Run all the tests&quot;<br>  lane :run_unit_tests do<br>    scan(<br>      scheme: &quot;SomeApp&quot;,<br>      clean: true,<br>      devices: [&quot;iPhone 13 Pro&quot;]<br>      )<br>    end</pre><p>Here is what it does: This lane uses a scan action and we selected a scheme of the main app target “SomeApp” to run the tests, clean the project before tests and the device to run unit tests on needs to be an iPhone 13 Pro.</p><p>Let’s test this action by running the following action in the terminal</p><pre>fastlane run_unit_tests</pre><p>That’s it. That’s how simple it is to run the tests! The following is the result of the test results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZ8rJxPVv_tYGHnVF8N0vQ.png" /><figcaption>Fastlane run_unit_tests lane results</figcaption></figure><h4>Scan + Slack</h4><p>There is one thing that I really liked about scan its ability to communicate the test results to the slack. If you have a slack workspace, you can simply create a slack web hook, get the url of the webhook and insert to the <strong>scan </strong>action as argument. Example:</p><pre>scan(<br>      scheme: &quot;App scheme&quot;,<br>      clean: true,<br>      devices: [&quot;iPhone 14&quot;],<br>      slack_url:  &quot;https://hooks.slack.com/services/web_hook_id&quot;<br>      )</pre><p>This is how your channel slack message may look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FV4GmV6P2XzxKG19mBXT2A.png" /><figcaption>Slack web hook message from Fastlane tests lane</figcaption></figure><h3><strong>Step 5.</strong> <strong>Fastfile Lane 3</strong>: Project build</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBkrVlucsAjAV8uMx4ybbw.png" /><figcaption>Fstlane gym action</figcaption></figure><blockquote><em>gym</em> builds and packages iOS apps for you. It takes care of all the heavy lifting and makes it super easy to generate a signed ipa or appfile 💪</blockquote><p>To be able to upload the app, we need to archive or so to say package the app. Here gym action comes in. Gym allows us to easily package the app with all necessary, check more about customizations here: <a href="https://docs.fastlane.tools/actions/gym/">link</a>.</p><p>Now let’s implement gym to our build. Open Fastfile and paste the following code:</p><pre>#Gym/Build app<br>    desc &quot;Build the app&quot;<br>    lane :gym_app do<br>      match_certificates<br>      increment_build_number<br>      gym(scheme: &quot;SomeApp&quot;)<br>      git_commit(path: &quot;*&quot;, message: &quot;Bump build to #{get_build_number}&quot;)<br>    end</pre><p>This is a Fastlane lane called “gym_app” that does the following:</p><ol><li>It runs the match_certificates lane that we created earlier to ensure that all of your development and distribution certificates are valid and up-to-date before starting the build.</li><li>It runs the increment_build_number command, which increments the build number of the app. This step is crucial as, when we package the app and want to upload it to TestFlight, the build number of the project must always be unique. To avoid any issues with duplicate build numbers, we always run the increment_build_number action before starting the build. This action is already available in Fastlane and you can learn more about it in the official documentation (<a href="https://docs.fastlane.tools/actions/increment_build_number/">link</a>)</li><li>It runs the gym command, which is used to build and archive an iOS app. The scheme option is set to &quot;<strong>SomeApp</strong>&quot;, specifying the build scheme to use. The gym command has many other configuration options that you can learn more about in the official <a href="https://docs.fastlane.tools/actions/gym/">documentation</a>.</li><li>It runs the git_commit command, which commits the changes made to the codebase with the message &quot;<em>Bump build to #{get_build_number}</em>&quot;. get_build_number is the current build number of the app.</li></ol><h4>What about version number increment?</h4><p><strong>Note: </strong>When it comes to incrementing the version number, there is an action available in Fastlane called increment_version_number which can be used to increment the version number across major, minor, or patch numbers. However, I personally prefer to manage version numbers manually as it allows for more control and the ability to review and confirm the version number before making any changes.</p><p>Manually managing version numbers also allows for more flexibility in terms of when and how the version number is incremented. If you prefer to implement version increment automatically, you can insert the increment_version_number action in the provided lane and refer to the <a href="https://docs.fastlane.tools/actions/increment_version_number/">official documentation</a> for guidance on how to configure it.</p><p>Let’s navigate to our project directory and run the lane in the command line.</p><pre>fastlane gym_app</pre><p>After running the lane, you will notice that this lane is slightly more complex than previous ones, as it includes several steps that are executed one after the other. However, upon completion of the process, you will find the new <strong>.ipa</strong> and<strong> .dSYM</strong> files in the specified directory. This indicates that the project has been successfully exported and you can proceed to upload the exported file to TestFlight for beta testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yXJ9T4_NrjHfLsywtzftQg.png" /><figcaption>new package files generated.</figcaption></figure><p>Let’s move on to our last steps of our pipeline!</p><h3><strong>Step 6.</strong> <strong>Fastfile Lane 5</strong>: TestFlight upload</h3><p>The final step in the process is to upload the packaged file to TestFlight. To accomplish this, we will be using an action called pilot. This action is specifically designed for uploading builds to TestFlight, and it can be configured to handle various options that you can access <a href="https://docs.fastlane.tools/actions/pilot/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*FUTe9Xdgb80swqW6Fv3_SQ.png" /><figcaption>Fastlane Pilot action</figcaption></figure><blockquote>Pilot makes it easier to manage your app on Apple’s TestFlight. You can:</blockquote><blockquote>Upload &amp; distribute builds</blockquote><blockquote>Add &amp; remove testers</blockquote><blockquote>Retrieve information about testers &amp; devices</blockquote><blockquote>Import/export all available testers</blockquote><p>To use the pilot action, you will need to have the App Store Connect API key ID, issuer ID, and .p8 authentication key file. While there are other methods of authentication available like Apple ID, using App Store Connect API is considered to be a best practice as it is secure and efficient. Let’s start executing it.</p><p>First of all, we need to import the following values to the Fastfile from our .env.default file:</p><ul><li>App Store Connect API’s key ID</li></ul><pre>app_store_connect_api_key_id = &quot;#{ENV[&quot;APP_STORE_CONNECT_API_KEY_KEY_ID&quot;]}&quot;</pre><ul><li>App Store Connect API’s issuer ID</li></ul><pre>app_store_connect_api_issuer_id = &quot;#{ENV[&quot;APP_STORE_CONNECT_API_KEY_ISSUER_ID&quot;]}&quot;</pre><ul><li>App Store Connect API’s .p8 authentication key content</li></ul><pre>app_store_connect_api_p8_contents = File.read(&quot;#{ENV[&quot;app_store_connect_api_file_path&quot;]}&quot;)</pre><p>So totally in the top of the Fastfile you need to have something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETy59X2ViU2_t-fHccU0Dw.png" /><figcaption>Fastfile variables</figcaption></figure><p>Next, we will create a lane that utilizes the App Store Connect API key, along with the variables we previously defined, to initiate the upload to TestFlight.</p><pre>    #TestFlight upload<br>    desc &quot;Upload to TestFlight&quot;<br>    lane :pilot_to_testflight do<br>      api_key = app_store_connect_api_key(<br>        key_id: app_store_connect_api_key_id,<br>        issuer_id: app_store_connect_api_issuer_id,<br>        key_content: app_store_connect_api_p8_contents<br>      )<br><br>      pilot(api_key: api_key)<br>    end</pre><p>This lane is called “<strong>upload_to_testflight</strong>” and it uses the App Store Connect API key and values that were created earlier to initiate the pilot action. The lane creates the API key and then passes it as an argument to the pilot action, thus automating the process of uploading builds to TestFlight.</p><p>Let’s test this lane and see the results! Type the following command to terminal</p><pre>fastlane pilot_to_testflight</pre><p>The result is success!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1zuMnBq8jVfrDU0-GMkxg.png" /></figure><p>And if we go to App Store Connect TestFlight section, we can see that our build was successfully uploaded!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NUot2OxQfL833CdbxgdB7w.png" /><figcaption>App Store Connect TestFlight!</figcaption></figure><p>Great job! You have successfully uploaded your app to TestFlight. The final step of the pipeline is complete and you can now invite testers to test your app. You can do this either by using fastlane, as outlined in the documentation, or by manually setting up testers on the App Store Connect portal.</p><h3><strong>Step 7. </strong>Full pipeline test</h3><p>Since we completed the last step of the pipeline, now we can put everything together into one lane that will be called “<strong>beta_upload</strong>”.</p><p>Just copy and paste the code below:</p><pre>desc &quot;Upload beta to TestFlight&quot;<br>    lane :beta_upload do <br>      run_unit_tests<br>      gym_app<br>      pilot_to_testflight<br>    end</pre><p>This lane is designed for uploading new versions of the app to TestFlight. To use it, simply enter “<strong>fastlane beta_upload</strong>” in the terminal and the entire pipeline will automatically execute. It’s that easy! Make sure you have configure the pipeline properly before using the command.</p><p>Congratulations on finishing the fastlane setup and configuration! You can now use this pipeline as a template for your project and customize it to fit the needs of your own app. Keep in mind that the provided pipeline is tailored specifically for the needs of this app, and you will need to ensure that your pipeline meets the distribution requirements of your own app.</p><h3>Useful tips and tricks</h3><h4>Slack Integration</h4><p>Integrating Slack with fastlane creates a powerful combination that allows for easy viewing of fastlane logs, errors, results, and upload notifications. To learn more about using Slack with fastlane, refer to the following link: <a href="https://docs.fastlane.tools/actions/slack/">link</a></p><h4>GitHub Fastfile References</h4><p>For additional inspiration, check out this useful but slightly dated GitHub repository that contains a variety of Fastfile example setups for you to explore and analyze. Check out the link: <a href="https://github.com/fastlane/examples">link</a></p><h3>Conclusion and follow up</h3><p>Thank you for reading my article on implementing Fastlane for iOS project. I hope you found it informative and helpful. If you have any further questions or would like to share your thoughts on the topic, please leave a comment below. Thanks for your support and you can contact me everywhere:</p><p>You can check the <a href="https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-1-3-3bde8646411e">Part 1</a> and <a href="https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-2-3-7ea535be5f1a">Part 2</a> too!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/aidosmukatayev/">https://www.linkedin.com/in/aidosmukatayev/</a></p><p>GitHub: <a href="https://github.com/mukatayev1">https://github.com/mukatayev1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fd5de2c7da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 2/3]…]]></title>
            <link>https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-2-3-7ea535be5f1a?source=rss-296b1183cfa3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ea535be5f1a</guid>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[testflight]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[fastlane]]></category>
            <dc:creator><![CDATA[Aidos Mukatayev]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 09:31:23 GMT</pubDate>
            <atom:updated>2023-01-23T10:26:33.765Z</atom:updated>
            <content:encoded><![CDATA[<h3>Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 2/3] (2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*XJKMaGowkzMJVFJ_LhX0ng.png" /></figure><p>Welcome to part 2 of our Fastlane tutorial for iOS. In the first part of this tutorial, we provided some useful resource links for getting started with Fastlane and learnt the essential information about the Fastlane. We also covered an introduction to what Fastlane is, how it works, and the steps for installing Fastlane and adding it to your project.</p><p>In this second part of the tutorial, we will dive deeper into the capabilities of Fastlane and show you how to use it to automate various tasks in your iOS development workflow. We will cover topics such as how to register the app on the App Store Connect and handle provisioning profiles with Fastlane.</p><h4>What will you learn and understand in part 2:</h4><ul><li>How to create an app in the App Store Connect 📱</li><li>How to automate provisioning profiles and certificates in Fastlane 📄</li></ul><h4>GitHub link</h4><p>If you want to check the final project, you can access it here: <a href="https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial">https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial</a></p><h3>Lets Continue.</h3><p>Let’s start from the table of contents.</p><p>The following is the table of contents Part 2 and Part 3:</p><p><strong>Part 2 Table of contents:</strong></p><ul><li><strong>Step 2.</strong> Create an app in App Store Connect</li><li><strong>Step 3.</strong> <strong>Fastfile Lane 1</strong>: Fastlane Match and provisioning profiles/certificates</li></ul><p><strong>Part 3 Table of contents:</strong></p><ul><li><strong>Step 4.</strong> <strong>Fastfile Lane 2</strong>: Running tests</li><li><strong>Step 5.</strong> <strong>Fastfile Lane 3</strong>: Project build</li><li><strong>Step 6.</strong> <strong>Fastfile Lane 5</strong>: Testflight upload</li><li><strong>Step 7. </strong>Full pipeline test</li><li>Useful tips and tricks</li><li>Conclusion and follow up.</li></ul><h3>Where did we stop?</h3><ul><li>In the last part of the Part 1, we simply broke down the initial <strong>Fastfile’s</strong> boilerplate code. The next step for us is to create an app in the App Store Connect portal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Cknz_24Jnj8ALPGpdA48w.png" /></figure><h3>Step 2. Create app in App Store Connect</h3><p>Fastlane has an action called “produce” that can be used to create an app on the App Store Connect. But this method requires developer’s credentials and only needs to be done once. So, I recommend manually creating the app on the App Store Connect portal instead of using this Fastlane action. This way, you don’t have to worry about managing developer credentials and you don’t need to create the app every time you run your pipeline.</p><h4>Let’s start creating the App in the App Store Connect</h4><ul><li>Firstly, Go to the Xcode project and copy the <strong>Bundle Identifier. </strong>(See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxydnwlwr508V95mhanFTg.png" /><figcaption><strong>XCode — Bundle Identifier</strong></figcaption></figure><ul><li>Open the <strong>Identifiers </strong>in Apple Developer <a href="https://developer.apple.com/account/resources/identifiers/list">link</a>. And press ‘<strong>+’</strong> button. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdrT7Fap1HtahfezxVuawA.png" /><figcaption><strong>Identifiers </strong>in Apple Developer <a href="https://developer.apple.com/account/resources/identifiers/list">link</a></figcaption></figure><ul><li>Choose<strong> App ID</strong> and click continue. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9XlTB4hAOeWCUaLcSzmyAA.png" /><figcaption>Choose<strong> App ID</strong> and click continue.</figcaption></figure><ul><li>Select<strong> App </strong>and continue. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBWz6Y7-yiqgffiwNSSdOA.png" /><figcaption>Select App type</figcaption></figure><ul><li>Paste the <strong>bundle identifier, </strong>add your <strong>description, </strong>and click continue. And finish the registration by clicking “Register”. Now you have a new identifier with which you can register a new app. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4eRu_ahS9EKzLSG84_lQw.png" /><figcaption>Paste Bundle Identifier and register the identifier</figcaption></figure><ul><li>Now Open the <a href="https://appstoreconnect.apple.com/">App Store Connect</a> and login. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yboebH6PQvdN_IWb-Zustg.png" /><figcaption>Select My Apps</figcaption></figure><ul><li>Click plus and select a New App. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGaMA8FD1NuF8w4Xn2v_Kg.png" /></figure><ul><li>Enter the required info about the app and click “Create”. (See image below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxLHYfvsvX6HvUkRUxIPbw.png" /><figcaption>Create the app</figcaption></figure><p>Congrats you just created your app in the App Store Connect! The next step for us is to setup Provisioning profiles with Fastlane.</p><h3><strong>Step 3.</strong> Fastfile Lane 1: Fastlane Match and provisioning profiles/certificates</h3><p>This step was referenced a lot from the tutorial article ‘<em>How to setup Fastlane and Match to release iOS apps automatically on CI/CD server</em>’ by Douglas Iacovelli on Medium: <br>Reference link: <a href="https://medium.com/revelo-tech/setting-up-automatic-ios-release-with-fastlane-and-match-on-ci-cd-server-16c3f1d79bc5">link</a> <br>Thank you Douglas!</p><p>When working on an iOS project in Xcode, you may have come across the “<strong>Automatically manage signing</strong>” checkbox in the Signing &amp; Capabilities section. This feature allows Xcode to handle the creation and maintenance of provisioning profiles, App IDs, and certificates for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDI3tcBGLqemF2R9RY5jAQ.png" /><figcaption>Automatically manage signing in Xcode</figcaption></figure><p>However, when working with Fastlane, you no longer have Xcode to handle this process for you. This is where the <strong>match</strong> action comes in. It allows you to manage your provisioning profiles and certificates, and ensures that everyone on your team is using the correct ones. This ensures that the signing and distribution process is streamlined and consistent, and also helps to keep your provisioning profiles and certificates secure. So let’s get started.</p><h4>Let’s setup match</h4><p>The purpose of the first lane is to setup provisioning profiles and certificates that are needed to sign and distribute an iOS app in the App Store Portal. The fastlane provides us with a great action called “Match” that does a lot of work for us! I will show you how to set it up! Here is the documentation link: <a href="https://docs.fastlane.tools/actions/match/">Match in Fastlane</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_pKEYGA5-tfw1XRCS1drw.png" /></figure><p>According to the official documentation, this is what it states:</p><blockquote>🔄 Automatically sync your iOS and macOS keys and profiles across all your team members using git</blockquote><blockquote>📦 Handle all the heavy lifting of creating and storing your certificates and profiles</blockquote><p>First of all, <strong>Match</strong> needs to have an access to <strong>Git repo</strong>, <strong>Google Cloud</strong> or <strong>Amazon S3 </strong>to be able to store and access the code signing identities. We will continue with Git as it is convenient choice for us.</p><p>First of all, <strong>Match </strong>it needs access to a <strong>Git repository</strong>, <strong>Google Cloud</strong>, or <strong>Amazon S3</strong> to store and access code signing identities. In this tutorial, we will use a Git repository as it is the most convenient option. To set up Match, you need to:</p><ol><li>Create an empty GitHub repository</li><li>Initialize Match</li><li>Create an environment file (.env files) with the necessary information and add it to your .gitignore</li><li>Run Match and verify the setup.</li></ol><h4>Create an empty GitHub repository</h4><p>To set up Match, you need to create a new private repository on GitHub. If you have an organization, it would be a good idea to create the repository within your organization. However, using a personal GitHub account is also an option. To create the repository, go to GitHub and follow the steps to create a new repository, make sure to set it as <strong>private.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWeJ00aVVHEHexYDRVA9Bg.png" /><figcaption>create an new repository</figcaption></figure><p>After creating the repo please copy the SSH (not HTTPS) link and save it for later use. If you do not have SSH Authentication with GitHub on your Mac machine here is the a nice tutorial how to setup one: <a href="https://medium.com/codex/git-authentication-on-macos-setting-up-ssh-to-connect-to-your-github-account-d7f5df029320">Git SSH Authentication</a>. Also remember that you will not need to do anything manually like creating folderes or inserting something with the created repo! So just create the repo and copy its url.</p><p>After creating the repository, please copy the SSH (not HTTPS) link and save it for later use. If you do not have SSH Authentication set up with GitHub on your Mac machine, refer to this tutorial on how to set it up: <a href="https://medium.com/codex/git-authentication-on-macos-setting-up-ssh-to-connect-to-your-github-account-d7f5df029320">Git SSH Authentication</a>” Additionally, note that you will not need to manually create any folders or add any files to the newly created repository. Simply create the repository and copy its URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-VGmEDxHirpjVhgff7A2tw.png" /><figcaption>Copy the SSH Git URL and save somewhere</figcaption></figure><h4>Initialize Match</h4><p>Now navigate to project directory and run the following code in command line to initialize match and paste github private repo’s url and add</p><pre>fastlane match init</pre><p>When you run the command to initialize Match, you may be prompted to select a storage mode. In our case, we will be using the Git storage mode. To select this option, simply type ‘1’ in the prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdUVAhMWINx0tvgnK2UlVw.png" /><figcaption>Choose any of the match storage modes. In our case it’s git.</figcaption></figure><p>After typing that, you will need to paste the github url that we created earlier like in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNphKgmXj_VzlAv8KfxdkQ.png" /></figure><p>After pasting the GitHub URL and pressing Enter/Return, you should receive a message indicating that the Matchfile was successfully created. The message should read “Successfully created ‘./fastlane/Matchfile’. You can open the file using a code editor.” This confirms that the Matchfile has been created and is ready for editing. (See the image below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTb5mWX2aHC2NjTcZpb6ng.png" /></figure><p>Also if you check the fastlane folder, now you need to have new file called <strong>Matchfile. </strong>We don’t need to open and type anything there, since we already all necessary information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klhpvL3X07PoqaoeAZl6OQ.png" /><figcaption>Matchfile file in fastlane folder</figcaption></figure><h4>Create an environment file (.env files) with the necessary information and add it to your .gitignore</h4><p>To setup the environment files, open the Gemfile in your project directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvMoxmRUF7KMBclO4_fOtg.png" /></figure><p>Add the following code to the file</p><pre>gem &quot;dotenv&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VWPsh83ADzOd1BH9Dbouxg.png" /></figure><p>And run the following code in command line:</p><pre>bundle install</pre><p>After successfully installign the gem, let’s create two environment files:</p><ul><li>First file: .<strong>env.default.sample </strong>file that is just a sample file with no information that is going to be used. It’s just a template sample.</li><li>Second file: .<strong>env.default </strong>file is an important file with all important information. Remember that this file needs to be put in .<strong>gitignore</strong> because you don’t want this file to be pushed to your project repo.</li></ul><p>Now, change directory to your fastlane folder in the project directory and run the following two commands to create to files:</p><pre>cd fastlane <br>touch .env.default.sample<br>touch .env.default</pre><p>If you want to see hidden folders, just press “Shift+Command+.” This is how your fastlane folder needs to look like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*drTgjdGViSZBqlzLL0NsOw.png" /></figure><p>Paste the following content to your .env.default.sample file:</p><pre># These keys must be filled in order to fetch the certificates<br><br># Git basic authorization for match encoded in base64<br># This is only needed if the user is not authenticated using ssh on git or if you&#39;re running on CI/CD server.<br># MATCH_GIT_BASIC_AUTHORIZATION=<br><br># Your local Mac machine Password is used to encrypt/decrypt certificates<br># MATCH_PASSWORD=<br><br># (Optional) Your local machine password, such as the one you use to login.<br># MATCH_KEYCHAIN_PASSWORD=<br><br># Fastlane Team ID<br># FASTLANE_TEAM_ID=<br><br># Not needed unless you are generating the certificates<br># Team&#39;s shared apple id, which should be the only creator of the certificates.<br># WARNING: By any chance you should use your own account.<br># MATCH_USERNAME=<br><br># CI only keys for uploading app to store<br># APP_STORE_CONNECT_API_KEY_KEY_ID=<br># APP_STORE_CONNECT_API_KEY_ISSUER_ID=<br># APP_STORE_CONNECT_API_KEY_KEY=</pre><p>Let’s briefly go through the values. These values are used for local development.</p><ul><li><strong>MATCH_GIT_BASIC_AUTHORIZATION — </strong>allows each developer on the team to use their own account. If you are authenticated with SSH on git, you do not need to fill this in.</li><li><strong>MATCH_PASSWORD —</strong> is used to encrypt and decrypt certificates, so it is important not to lose it. This is just a password for you mac machine.</li><li><strong>FASTLANE_TEAM_ID — </strong>is a team id that is being used in Apple Developer.</li><li><strong>MATCH_USERNAME —</strong> This is an email account that is being used in Apple Developer Portal to release and manage your app.</li><li><strong>APP_STORE_CONNECT_API — </strong>values that have this prefix are the values that you will need to make the fastlane automatically communicate with App Store servers for your app release. Make sure that your App Store Connect Key has access level “<strong>App Manager. </strong>What is App Store Connect API and how to set it up, please visit the following useful links: <br>Youtube: <a href="https://www.youtube.com/watch?v=CmhNHNCorIY"><em>How to grant API key access to Apple App Store Connect</em></a><em>?</em><br>Apple documentation:<em> </em><a href="https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api"><em>Creating API Keys for App Store Connect API</em></a></li></ul><p>Once you finish setting up the App Store Connect API Key, let’s continue with filling .env.default. Now you need to have three values App Store Connect API related <strong>key id, issuer id </strong>and <strong>file with .p8 extension </strong>(example name: AuthKey_R932K1MCKG.p8<strong>) </strong>that you downloaded.</p><p>Open the .env.default file and copy the code from the .env.default.sample file, then add the necessary values to the variables and uncomment the content.</p><p>The contents of your .env.default file should resemble the following, with all information filled in with appropriate values</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HfD3mrdacYdJeCBuD4LvxQ.png" /><figcaption>This is how my .env.default file looks like.</figcaption></figure><p>Don’t forget to add the .end.default file to .gitignore file! <br>If you don’t have .gitignore file, create one. Change directory to project directory an type:</p><pre>touch .gitignore</pre><p>Open the file and paste the following content if you want to ignore other fiels that are usually ignored.</p><pre>## User settings<br>xcuserdata/<br><br>## Obj-C/Swift specific<br>*.hmap<br><br>## App packaging<br>*.ipa<br>*.dSYM.zip<br>*.dSYM<br><br>## Playgrounds<br>timeline.xctimeline<br>playground.xcworkspace<br><br><br>.build/<br><br># fastlane<br><br>fastlane/report.xml<br>fastlane/Preview.html<br>fastlane/screenshots/**/*.png<br>fastlane/test_output<br>fastlane/.env.default<br><br>iOSInjectionProject/<br><br>### SwiftPackageManager ###<br>Packages<br>xcuserdata</pre><p>Otherwise, you can just add this line:</p><pre>fastlane/.env.default</pre><p>And you might need to refresh file index for .gitignore file to make the updated .gitignore work. Read more this stackoverflow to solve it: <a href="https://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository"><strong>link</strong></a><strong>.</strong></p><h4>Run Match and verify the setup.</h4><p>Congrats on making this far 😎</p><p>Now you need to run two fastlane commands in the terminal to setup the provisioning profiles and ceritificates:</p><pre>fastlane match development</pre><p>Type your bundle identifier if the following prompt shows up asking you app identifier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AXKly1Vh2wD04XFtR8EviA.png" /><figcaption>Asking bundle identifier prompt</figcaption></figure><p>After setting up the development certificates, run the match action for appstore, and if you use adhoc releases too run the match for adhoc too!</p><pre>fastlane match appstore</pre><p>If you have successfully installed the certificates, you need to have the following message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9X-2pb-gWvpbee5DeEeKMw.png" /></figure><p>If there is any issues, you might need to revoke the certificates with <strong>match nuke</strong> action and create the certificates again. Read more on the official documentation, Nuke section: <a href="https://docs.fastlane.tools/actions/match/"><strong>link</strong></a></p><p>Congratulations, all difficulties are behind and you have left only one small thing to do!</p><h3>Wrap up: Let’s complete the final two tasks</h3><h4>Add the “match” action to our Fastfile as the first lane that will be executed every time the pipeline starts.</h4><p>Open Fastfile and add the following line to create a property for <strong>app_identifier</strong> that accesses Appfile and gets value of app identifier.</p><pre>app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)</pre><p>Then let’s define a lane called <strong>match_certificates. </strong>Add the following code to your Fastfile</p><pre>  desc &quot;match certificates&quot;<br>  lane :match_certificates do<br>    match(type: &quot;development&quot;, <br>    app_identifier: app_identifier<br>    )<br>    match(type: &quot;appstore&quot;,<br>    app_identifier: app_identifier<br>    )<br>  end</pre><p>Here, we create a lane called ‘match_certificates’. Within this lane, we execute the ‘match’ action twice, once for the ‘development’ environment and again for the ‘appstore’ environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-s5KoNlnfogVzdQGn1tTMw.png" /><figcaption>This is how my Fastfile looks like so far.</figcaption></figure><p>If you want to test this lane, you can just open terminal with your project directory and type the following:</p><pre>fastlane match_certificates</pre><p>The success message should say: “fastlane.tools finished successfully 🎉”</p><h4>One last adjustment in Xcode.</h4><p>Open the Xcode and navigate to Signing &amp; Capabilities.</p><p>Uncheck the “Automatically manage signing” and select ‘match Development’ certificate that was generated by match action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alGwLoQeprahVs9SQwJDIA.png" /></figure><p>Great work! You have successfully completed half of the Fastlane pipeline setup.</p><p>In this tutorial, we created an app in the App Store Connect portal and set up the first lane to automatically configure our provisioning profiles. In the final part of this tutorial, we will define the remaining lanes to deploy our app to Testflight.</p><h3>Follow up</h3><p>If you would like to continue, let’s proceed to the final step of uploading it to TestFlight in <a href="https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-3-3-5fd5de2c7da">Part 3</a>.</p><p>If you have any further questions or would like to share your thoughts on the topic, please leave a comment below. Thanks for your support and you can contact me everywhere:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/aidosmukatayev/">https://www.linkedin.com/in/aidosmukatayev/</a></p><p>GitHub: <a href="https://github.com/mukatayev1">https://github.com/mukatayev1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ea535be5f1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 1/3]…]]></title>
            <link>https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-1-3-3bde8646411e?source=rss-296b1183cfa3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bde8646411e</guid>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[testflight]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Aidos Mukatayev]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 09:26:39 GMT</pubDate>
            <atom:updated>2023-01-31T15:34:46.851Z</atom:updated>
            <content:encoded><![CDATA[<h3>Effortlessly Implement CD in your iOS Project: A Complete Guide to Setting up Fastlane [Part 1/3] (2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*XJKMaGowkzMJVFJ_LhX0ng.png" /></figure><h3>Introduction</h3><p>I recently developed and published my first app to the App Store and during my development time I wanted to implement the best practices in my development and distribution process. When it came to distribution phase of my app, I had to learn a number of essential details related to App Store distribution, and realized that automating my builds, tests, and deployment processes would save me a good amount of time in the future updates.<br>I researched different options for automating the distribution pipeline, such as Xcode Cloud, GitHub Actions, Bitrise, Travis CI, and more, and found that Fastlane is an effective tool to start with, as it works well with most existing CI/CD tools (except Xcode Cloud). I decided to implement my continuous delivery (CD) pipeline with Fastlane and was able to do so by creating a solid and efficient pipeline that streamlined my app’s certifications/provisioning profile, build, test, build number increment and Testflight upload processes. <br>In this tutorial, I will share my experience and guide you through the steps of setting up Fastlane and using it for making a pipeline on an example app.</p><p><em>Note: If you want to check out the app here is the link: </em><a href="https://apps.apple.com/us/app/myokr/id1659425586"><strong><em>App Store Link</em></strong></a></p><p>I broke the article down into 3 parts to make it more readable and manageable for the audience because a lengthy article can be overwhelming to read.</p><h4>What will you learn and understand in part 1:</h4><ul><li>Nature of Fastlane 🌏</li><li>Setup Fastlane in your iOS Project. 💻</li></ul><h4>GitHub link</h4><p>If you want to check the final project, you can access it here: <a href="https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial">https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial</a></p><h3>Lets Get Started.</h3><p>Let’s start from the table of contents.</p><p>The following is the table of contents of Part 1, Part 2 and Part 3:</p><p><strong>Part 1 Table of contents:</strong></p><ul><li>Prerequisites and resource links</li><li>What is Fastlane? How it works?</li><li><strong>Step 1. </strong>Install Fastlane and add Fastlane to Project</li></ul><p><strong>Part 2 Table of contents:</strong></p><ul><li><strong>Step 2.</strong> Create an app in App Store Connect</li><li><strong>Step 3.</strong> <strong>Fastfile Lane 1</strong>: Fastlane Match and provisioning profiles/certificates</li></ul><p><strong>Part 3 Table of contents:</strong></p><ul><li><strong>Step 4.</strong> <strong>Fastfile Lane 2</strong>: Running tests</li><li><strong>Step 5.</strong> <strong>Fastfile Lane 3</strong>: Project build</li><li><strong>Step 6.</strong> <strong>Fastfile Lane 5</strong>: Testflight upload</li><li><strong>Step 7. </strong>Full pipeline test</li><li>Useful tips and tricks</li><li>Conclusion and follow up.</li></ul><h3>Prerequisites and links</h3><ul><li>Before diving into Fastlane, it’s important to have a few things in mind. Firstly, it’s assumed that you already have a basic understanding of how to submit an iOS app to the Apple App Store. If you’re new to this process, it may be challenging to fully grasp every step in this tutorial. To gain a better understanding, it’s recommended that you read up on the basics of submitting an iOS app to the App Store before continuing with Fastlane.</li><li>Secondly, in order to distribute your app to Testflight, you must be enrolled in the Apple Developer Program and have access to App Store Connect. Finally, for reference, a finish sample project can be found in the provided repository link.</li><li><strong><em>GitHub link</em></strong>: <a href="https://github.com/mukatayev1/SomeApp-Fastlane-Tutorial.git"><em>GitHub link</em></a></li><li><strong><em>Useful resource</em></strong><em>: How to enroll to Apple Developer Program? </em><a href="https://www.youtube.com/watch?v=ZKmwUip8iew"><em>YouTube link</em></a></li><li><strong><em>Useful resource</em>: </strong><em>How to submit iOS app to the App Store?</em><strong> </strong><a href="https://www.youtube.com/watch?v=ykiD5wqwSe4"><em>YouTube link</em></a></li></ul><h3>What is Fastlane? How it works?</h3><h4>What is Fastlane?</h4><ul><li>Fastlane is a tool that helps iOS developers automate the process of deploying their apps. It allows for the automated uploading of apps to Testflight, either through a trigger or manual command in the terminal.</li><li>Fastlane streamlines the process of building, testing, and releasing iOS apps by providing a set of tools (called “actions”) to automate each step of the deployment process. The screenshot below shows how to easily upload an app to Testflight with just one line of code in the terminal.😎</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BwkGut74h3VEShTwnEkxw.png" /><figcaption>Screenshot 1: This is how I can simply upload my app to the Testflight with one line in terminal.</figcaption></figure><h4>How it works?</h4><ul><li>Fastlane is a collection of tools, known as “<strong>actions</strong>,” that helps automate different tasks in the iOS app development process. These tasks include setting up provisioning profiles, registering the app on App Store Connect, running tests, submitting the app to the App Store, uploading to Testflight and more. You can access a list of all the available actions on the official Fastlane website: <a href="https://docs.fastlane.tools/actions/"><strong>Fastlane Actions</strong></a><strong>.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*789dpGu4SeWgoDjnY_F3TQ.png" /><figcaption>Screenshot 2: Screenshot of a Fastlane website with fastlane actions</figcaption></figure><ul><li>Each step that is configured in the deployment pipeline is called a “<strong>lane</strong>.” To understand Fastlane, it’s important to know that a “lane” is a specific set of tasks that can be executed together in a specific order. For example, you can create a lane called “upload_my_app_to_testflight” and define it by inserting all the necessary actions in the correct sequence. We will discuss how to configure lanes and pipelines in more detail later in the part 2 and part 3. You can also find more information on how Fastlane works on the official website: Fastlane website: <a href="https://fastlane.tools/"><strong>Fastlane website</strong></a><strong>.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiC--SOoL2Iwi66pyQx68Q.png" /><figcaption>Screenshot 3: Screenshot of a Fastlane website with How Fastlane works</figcaption></figure><h3><strong>Step 1.</strong> Install Fastlane and add Fastlane to Project</h3><h4>Fastlane install</h4><p>There are several options available to install fastlane, however, I used Homebrew to install fastlane on my macbook. If you don’t have Homebrew you can install homebrew with this link: <a href="https://brew.sh/">Homebrew</a>.<br>If you do not want to use homebrew, you can check other installation options here: <a href="https://docs.fastlane.tools/getting-started/ios/setup/">website</a>. To install Fastlane with brew, open Terminal and type the following code:</p><pre>brew install fastlane</pre><h4>Add Fastlane to Project</h4><p>Now, let’s add Fastlane to our project. The example app that we’ll be using is called “<strong>SomeApp</strong>,” it’s a basic single view app that allows you to change the color of a container. However, it’s important to note that the functionality of the app is not important for this tutorial, as we will not be making any changes to the project code.</p><p>Currently, our project folder is empty and does not have Fastlane installed. Let’s add it now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHglr1W8zFk8cGJoCNFBCw.png" /><figcaption>Screenshot 5: Project folder without fastlane.</figcaption></figure><p>To add Fastlane to, open your terminal and navigate to your project directory. Then run the command “<strong>fastlane init</strong>.” This command initializes Fastlane in your project.</p><pre>fastlane init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Xygsb1GdbeFQRac4hV9-w.png" /><figcaption>This is how what you need to have in terminal</figcaption></figure><p>After pressing enter, the command line needs to show you this prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqO1a6CmRg4c2e4-vssi7g.png" /></figure><p>Fastlane offers a few default templates for your project. These include:</p><ol><li>Automating the process of taking screenshots for the App Store.</li><li>Automating the distribution of beta versions of the app to TestFlight.</li><li>Automating the distribution of the app to the App Store.</li><li>Manual setup.</li></ol><p>For this tutorial, we will be using the manual setup option, which allows us to configure everything ourselves. To choose this option, type “4” in the terminal and press Enter.</p><p>After running the “fastlane init” command, you should now have a new “<strong>fastlane</strong>” folder and a file called “<strong>Gemfile</strong>” in your project directory. These are the two items that were added to your project as part of the Fastlane setup process.</p><h4>What is <strong>Gemfile</strong>?</h4><p>The “<strong>Gemfile</strong>” is a file used by the Ruby programming language to manage dependencies for a project when using Fastlane. However, for the sake of simplicity, we will not discuss it yet, and will instead focus on the main aspects of working with Fastlane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1YP1bxCGzB7EpokGz7Kufg.png" /></figure><h4>Fastlane folder</h4><p>Open fastlane folder and you will see two files: Appfile and Fastfile.</p><ul><li><strong>What is Appfile?</strong> The Appfile is a file that stores constant app related details like the app’s name, bundle identifier, and the Apple ID used to log in to App Store Connect. However, in this tutorial we will mainly work with .env environment files instead. One thing that is important to set in the Appfile is the <strong>app_identifier</strong> variable, which is the app’s bundle identifier. To do this, open the Appfile and add the following code, replacing ‘your-app-bundle-identifier’ with the actual bundle identifier of your app.</li></ul><pre>app_identifier &quot;your-app-bundle-identifier&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jTj6ANc3qLP8J4uHpZ8XQ.png" /><figcaption>Appfile with only one value</figcaption></figure><ul><li><strong>What is Fastfile? </strong>The “Fastfile” is the key file when working with Fastlane, we will be using it frequently. It has access to the constant variable names defined in the Appfile. This file is where you define the lanes of your Fastlane deployment pipeline, which are groups of actions that can be executed together. For instance, a common lane could be named “deploy” that runs actions such as building the app, taking screenshots and uploading the app to the App Store.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BVmBcM4XsMIhdQWWk-1-A.png" /><figcaption>Fastlane folder with Appfile and Fastfile files.</figcaption></figure><p>Open the “Fastfile” in any text editor of your choice. Some developers prefer using Visual Studio as it provides a user-friendly interface for editing the Fastfile. If you open the Fastfile, you will see a basic setup with some boilerplate code that may seem unfamiliar at first. But don’t worry, I will guide you through each step you need to take.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*skXCBNT9sLRaavpDMVz-uA.png" /><figcaption>This is the default created Fastfile.</figcaption></figure><p>First, let’s remove the commented lines above “<strong>default_platform(:ios)</strong>” line. And now let’s go over this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUOk0GSB5G46HRUMplxPoA.png" /><figcaption>First, let’s remove the commented lines above “<strong>default_platform(:ios)</strong>” line. And now let’s go over this file.</figcaption></figure><p>Let’s break down the code below into pieces.</p><pre>default_platform(:ios)<br><br>platform :ios do<br>  desc &quot;Description of what the lane does&quot;<br>  lane :custom_lane do<br>    # add actions here: https://docs.fastlane.tools/actions<br>  end<br>end</pre><p>This code is written in Ruby and is using the Fastlane tool. It sets the default platform to iOS and creates a custom lane specifically for the iOS platform. The desc method is used to provide a brief description of what the lane does, which is useful for documentation. Inside the lane :custom_lane do block, actions are defined that will be executed when this lane is called, while custom_lane is just the name of the lane. These actions can be found in the Fastlane documentation. Overall, this code is setting up a specific lane for the iOS platform to run certain actions.</p><p>Now we can create an app on the App Store and then start defining out pipeline.</p><h3>Follow up</h3><p>Congratulations!✅ <br>You’ve completed the introduction and setup phases of the tutorial. It’s time to move on to the most exciting part — creating a deployment pipeline! Head over to <a href="https://medium.com/@mukatayev19/effortlessly-implement-cd-in-your-ios-project-a-complete-guide-to-setting-up-fastlane-part-2-3-7ea535be5f1a">Part 2</a> to continue.</p><p>If you have any further questions or would like to share your thoughts on the topic, please leave a comment below. Thanks for your support and you can contact me everywhere:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/aidosmukatayev/">https://www.linkedin.com/in/aidosmukatayev/</a></p><p>GitHub: <a href="https://github.com/mukatayev1">https://github.com/mukatayev1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bde8646411e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>