<?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 Yehia Beram on Medium]]></title>
        <description><![CDATA[Stories by Yehia Beram on Medium]]></description>
        <link>https://medium.com/@yehiaberam?source=rss-77308e257460------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-nmnokUL8J19dSx9RwAhWw.jpeg</url>
            <title>Stories by Yehia Beram on Medium</title>
            <link>https://medium.com/@yehiaberam?source=rss-77308e257460------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 10:12:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yehiaberam/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[Fastlane and the secret recipe for automated iOS deployment]]></title>
            <link>https://yehiaberam.medium.com/fastlane-and-the-secret-recipe-for-automated-ios-deployment-837ee37125ff?source=rss-77308e257460------2</link>
            <guid isPermaLink="false">https://medium.com/p/837ee37125ff</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[fastlane]]></category>
            <dc:creator><![CDATA[Yehia Beram]]></dc:creator>
            <pubDate>Tue, 08 Jun 2021 10:30:16 GMT</pubDate>
            <atom:updated>2021-06-08T10:30:16.872Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever considered using an automated process to build, archive, or even test your iOS application, like you want to get rid of the pain of releasing a new version from your exciting project?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lQwfxZgdIwxBpAnj" /><figcaption>Photo by <a href="https://unsplash.com/@zanilic?utm_source=medium&amp;utm_medium=referral">Zan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Then you should consider using the amazing <a href="https://fastlane.tools/">Fastlane</a>, the tool that created to save your day and automate your amazing deployment process.</p><h3>What is Fastlane?</h3><blockquote>Fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. 🚀 It handles all tedious tasks, like generating screenshots, dealing with code signing, and releasing your application.</blockquote><p>You can start by creating a Fastfile file in your repository, here’s one that defines your beta or App Store release process:</p><pre>lane :beta do<br>  increment_build_number<br>  build_app<br>  upload_to_testflight<br>end</pre><pre>lane :release do<br>  capture_screenshots<br>  build_app<br>  upload_to_app_store       <em># Upload the screenshots and the binary to iTunes</em><br>  slack                     <em># Let your team-mates know the new version is live</em><br>end</pre><p>You just defined 2 different lanes, one for beta deployment, one for App Store. To release your app in the App Store, all you have to do is</p><pre>fastlane release</pre><h3><strong>How to install Fastlane to your machine?</strong></h3><p>You can install Fastlane in multiple ways. In this article, we will use Homebrew to install Fastlane, so first of all, you need to install Homebrew on your machine. In your terminal, add this command:</p><pre>/bin/bash -c &quot;$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh">https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh</a>)&quot;</pre><p>By then, you already have brew installed on your local machine. Now, It’s time to install Fastlane using this command:</p><pre>brew install fastlane</pre><h3>How to setup Fastlane on your project</h3><p>First of all, you need to run this command inside the root directory of your project; then, run this command:</p><pre>fastlane init</pre><p>Since Fastlane works with Android and iOS, you will find that it’s smart enough to detect if you run this command in an Android project or iOS project, as shown in Figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_tC_UdJoIf7F253AeKYnA.png" /><figcaption>Figure 1.</figcaption></figure><p>Type 4 and press enter as we want to install it manually to customize it as we wish you will find the output as shown in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*LL2HQ9tlp0hlYYRgrkkmtQ.png" /><figcaption>Figure 2.</figcaption></figure><p>You will find a new directory inside your main project directory called Fastlane. Open it, and you will find two files, as shown in Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*tt9lPCigumBCNvNt-EB5VQ.png" /><figcaption>Figure 3.</figcaption></figure><p>Firstly, let’s open Appfile with any text editor and update the correct values of your application, as shown in Figure 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FsW2dzxa1EZ8qcmyoG-ZuQ.png" /><figcaption>Figure 4.</figcaption></figure><p>Then let’s go back to Fastfile as it will be our main playground, as shown in Figure 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rm8lmhUqj00GJ4NehCI_Wg.png" /><figcaption>Figure 5.</figcaption></figure><p>We need to give our lane a new name like upload_to_testflight_lane then let’s start cooking the recipes.</p><p>First of all, let’s add the build app command to prepare our app for the uploading process.</p><pre>build_app(scheme: &quot;your_scheme_name&quot;)</pre><p>then add upload to test flight command</p><pre>upload_to_testflight</pre><p>By then, you have to be excited to run this game-changing command :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31XqcR3LP_l_xlNo4jIrKA.png" /><figcaption>Figure 6.</figcaption></figure><p>Now after you added this command all you have to do run this command</p><pre>$ fastlane upload_to_testflight</pre><p>FastLane will only ask you to authenticate your Apple account from the terminal, and then it will upload your app automatically on behalf of you. 🎉 🎉</p><p>Now, we have successfully automated the app uploading process locally on our machine. The next step is to get the help of a CD/CI server to automate the deployment on the cloud. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=837ee37125ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to manage different environments using XCode schemes]]></title>
            <link>https://yehiaberam.medium.com/how-to-manage-different-environments-using-xcode-schemes-6081ae3db55d?source=rss-77308e257460------2</link>
            <guid isPermaLink="false">https://medium.com/p/6081ae3db55d</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[target]]></category>
            <category><![CDATA[scheme]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Yehia Beram]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 15:42:55 GMT</pubDate>
            <atom:updated>2021-04-13T15:42:55.019Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever felt lost when you were asked to release a new version from your iOS application? You have to double-check that you used all the production URLs and API keys. Right then, you feel the fear that you missed updating one or more of those values. If you have that pain? Then, I believe that now is the right moment for you to know about the XCode scheme to save your life and your time managing your project environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8MW-9lChUVF-5AV4" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, we will go through these points:</p><ul><li>How to add new multiple Schemes to your project?</li><li>How to have corresponding configuration files with each different Schema?</li><li>How to set up a Firebase project for your schemes?</li></ul><h3>What is the diff between Xcode Target and Scheme?</h3><blockquote>A <a href="https://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Targets.html#:~:text=A%20target%20specifies%20a%20product,in%20a%20project%20or%20workspace.&amp;text=There%20can%20be%20only%20one,be%20related%20to%20another%20target."><strong>target</strong></a> specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. A target defines a single product; it organizes the inputs into the build system — the source files and instructions for processing those source files — required to build that product. Projects can contain one or more targets, each of which produces one product.</blockquote><p>In other words, each target defines one scope of the app. Imagine that you are implementing an app with pro features and free features. Xcode Targets will save the situation by implementing two targets. A target for the default/free mode and another one for the pro version.</p><blockquote>An <a href="https://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Schemes.html#:~:text=An%20Xcode%20scheme%20defines%20a,be%20active%20at%20a%20time."><strong>Xcode scheme</strong></a> defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. You can have as many <strong>schemes</strong> as you want, but only one can be active at a time.</blockquote><p>This article focuses on the Xcode Schemas. It shows how to handle multiple configurations with multiple schemes. It is worth mentioning that if you are using more than one target, each one of them must include at least one Scheme.</p><h3>How to add new multiple Schemes to your project?</h3><p>First of all, you need to open the manage scheme dialog from the top left of Xcode, as shown in Figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHWRhjh52mv_VGCvG3yb4A.png" /><figcaption>Figure 1.</figcaption></figure><p>You have to click the + button in the bottom left corner to create a new scheme, as shown in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Va-REiQYEJi-YijGp5Xl3A.png" /><figcaption>Figure 2.</figcaption></figure><p>Then create two new schemes as shown in Figure 3 [Staging and Production].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFZ0Elv3zskZDnHOLeRUeA.png" /><figcaption>Figure 3.</figcaption></figure><p>By creating we have 3 Schemes:</p><ol><li>The Default Scheme is used as a development scheme.</li><li>The Staging Scheme for QA and testing purposes.</li><li>The Production Scheme for the App store.</li></ol><p>Now, the time has come to adjust the corresponding configuration modes. Currently, we already have two configuration modes in our project: Debug and Release. We need to add a new configuration mode for the Staging. To achieve that, you have to click on the + button, as shown in Figure 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OyYAqcSkl_wg8pYuW39YQ.png" /><figcaption>Figure 4.</figcaption></figure><p>Figure 5. shows the three configuration modes we have: Debug, Staging, and Release. The next step is to add three configuration files. Those Configuration Settings files will be considered the default values for each corresponding mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GX5FSIVCKop5LhoT-qY1Pg.png" /><figcaption>Figure 5.</figcaption></figure><h3><strong>How to have corresponding configuration files with each different Schema?</strong></h3><p>Figure 6. shows how to add a new Configuration Settings file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fX2R_T5R-rMRhpjxOwOFwQ.png" /><figcaption>Figure 6.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*TxDAYpuiUV5TByapTviooQ.png" /><figcaption>Figure 7.</figcaption></figure><p>After creating the three Configuration Settings files, we need to connect them to the correct Schema. Figure 8. shows how we can accomplish that by visiting the Project Info section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uj00SMhB-pwlk1IcbdbbPA.png" /><figcaption>Figure 8.</figcaption></figure><p>So far, so good? Yeah, exciting! We have three schemas with three configuration settings files. Let’s leverage!</p><p>In Figure 9. we added one Configuration variable with three different values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJapDjVOhxDNM7qfDneIrA.png" /><figcaption>Figure 9.</figcaption></figure><p>Wroth mentioning that we need to have three different Provisional Profiles. To have three instances of your app, you have to update the Build Configuration via clicking Manage Scheme Button. Please check Figure 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aeKslvMldkgXpP2391MR1Q.png" /><figcaption>Figure 10.</figcaption></figure><p>You have to highlight different and unique Bundle Identifiers for each Schema — figure 11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjObcOP89COo_xWSnMzVeg.png" /><figcaption>Figure 11.</figcaption></figure><p>To confirm that everything went well, please check the Signing &amp; Capabilities section. You should be able to see the app’s three different instances, as shown in Figure 12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FLYNP2JG3aNtieEw9S4LVA.png" /><figcaption>Figure 12.</figcaption></figure><p>Last but not least, we can use the added Configuration Variable BASE_URL. You can do add it to the info.plist. Afterward, you can use it wherever you want in your code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eKsIyMk0tAwokS7MWG4jQ.png" /><figcaption>Figure 13.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kidcaswZTMhYtDbcXujng.png" /><figcaption>Figure 14.</figcaption></figure><p>Now, you have just seen how we fetched the correct BASE_URL value according to the selected Schema Yaay! 🎉</p><h4>Next step? How to set up a Firebase project for your schemes?</h4><p>After you create your new Firebase Project, add three iOS apps inside this project. Add the Bundle Identifier for each one of them. By then, you will have three GoogleService-Info files, then rename each of them as shown in Figure 15.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*rhOaMe3bD4fmDq3W8919hQ.png" /><figcaption>Figure 15.</figcaption></figure><p>Subsequently, add value for it inside the xcconfig file as shown in Figure 16.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2472DfMomzqz24Zz9-GcTw.png" /><figcaption>Figure 16.</figcaption></figure><p>Then add value for it inside info.plist file to readable inside your swift code as shown in Figure 17.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yO-OLvJofF_jAZqajUmAEw.png" /><figcaption>Figure 17.</figcaption></figure><p>Figure 18. shows how to use this value inside AppDelegate.swift</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blmjxPd1HIkleM5BWuLSHQ.png" /><figcaption>Figure 18.</figcaption></figure><p>Finally, you can hit the run button and …… Tada! 🎉 Congratulations, now you have an application with three customizable schemes and three corresponding Firebase apps. Moreover, you can receive push notifications for them or track the crashes for each of them individually.</p><p>I recommend watching this handy video.</p><p><a href="https://developer.apple.com/videos/play/wwdc2018/415/">Behind the Scenes of the Xcode Build Process - WWDC 2018 - Videos - Apple Developer</a></p><p>This article was part 1 of my future-to-be series of methodologies to facilitate my daily working life. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6081ae3db55d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>