<?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 Faiz Mokhtar on Medium]]></title>
        <description><![CDATA[Stories by Faiz Mokhtar on Medium]]></description>
        <link>https://medium.com/@faizmokh?source=rss-5b1843b71b47------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ryk5iW_pUJtYm1QxqZfiyg.png</url>
            <title>Stories by Faiz Mokhtar on Medium</title>
            <link>https://medium.com/@faizmokh?source=rss-5b1843b71b47------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 14:00:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@faizmokh/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[Using Erlang’s Observer Tool in Elixir]]></title>
            <link>https://medium.com/@faizmokh/using-erlangs-observer-tool-in-elixir-c5e62321cefb?source=rss-5b1843b71b47------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5e62321cefb</guid>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Faiz Mokhtar]]></dc:creator>
            <pubDate>Mon, 22 Jan 2018 07:54:50 GMT</pubDate>
            <atom:updated>2018-01-25T00:32:58.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Erlang ships with a fantastic tool called Observer that allows you too inspect all running processes of your application.</p><p>To use it, start a new iex -S mix session inside your application directory. Then, run this command:</p><pre>iex(1)&gt; observer.start()</pre><p>and the Observer tool will appear on your window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*MB6liPn2huog25GU.png" /></figure><p>It provides you an easy access to understand all the running processes of your application, visualizing the application supervision tree, checking out memory allocations and as well as inspecting the message queues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*7ycl_jlGn8i1dDaA.png" /></figure><p>To stop it, simply close the window. That’s it.</p><p><em>Originally published at </em><a href="https://faizmokhtar.com/2018/01/22/using-erlang-observer-tool-in-elixir/"><em>faizmokhtar.com</em></a><em> on January 22, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e62321cefb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Improve Your Beta Deployment Flow with Fastlane Badge Plugin]]></title>
            <link>https://medium.com/@faizmokh/how-to-improve-your-beta-deployment-flow-with-fastlane-badge-plugin-289e2ea5d2bb?source=rss-5b1843b71b47------2</link>
            <guid isPermaLink="false">https://medium.com/p/289e2ea5d2bb</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[fastlane]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <dc:creator><![CDATA[Faiz Mokhtar]]></dc:creator>
            <pubDate>Mon, 08 Jan 2018 08:20:30 GMT</pubDate>
            <atom:updated>2018-01-08T08:36:23.155Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Fastlane Plugin to add a version badge on your app icon</h4><p>Our goals for this tutorial are to overlay the app version number, build number and release type on your app icons. Hopefully, it will make it easier for your project managers and testers to easily identify the app version without going to the app setting (or wherever you put it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*XETMsbtjLQ7uNBrZ4gJjEw.png" /><figcaption>Our goals 😱</figcaption></figure><h3>Installing Fastlane</h3><p>If this is the first time you heard of <a href="https://docs.fastlane.tools/">Fastlane</a>, it is basically a tool that allow you to automate beta deployment and releases for your iOS and Android apps.</p><p>There are multiple ways to install <a href="https://fastlane.tools/">Fastlane</a>. You can install it with <a href="https://brew.sh/">Homebrew</a>, <a href="https://rubygems.org/">Rubygems</a> or an installer script. Either one would be fine.</p><pre>$~ gem install fastlane</pre><h3>Configuring Xcode Configurations and Schemes for Development, Staging and App Store Builds</h3><blockquote>Skip to the <a href="#0634"><strong>next section</strong></a> if you are already familiar with creating your own schemes and configurations.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*zIvR06QGL_P6c2lz-f4mkQ.png" /><figcaption>Schemes and configurations for development, staging &amp; app store builds.</figcaption></figure><p>After installing Fastlane, we will then create a new schemes and configurations for our build environments based on the table above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*QYhKHs_WrR3Pgn7nTI6S4w.png" /><figcaption>Click on the `+` button to create a new configurations</figcaption></figure><p>To create a new configurations for staging build, simply duplicate the Debug configuration and rename it to Debug Staging . Then duplicate the Release configuration and rename it to Release Staging .</p><p>For app store configurations, you only have to duplicate the Release configuration and rename it to App Store . That’s it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*5Zft-jkdf1Rc_DbByNvcdw.png" /><figcaption>The final configurations that will be used for each schemes.</figcaption></figure><p>Then, edit your schemes to use the newly created configurations. Staging scheme will use the Debug Staging and Release Staging configurations and App Store scheme will use the App Store configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*BPjHIUWC8MLqsdgo-gKdig.png" /><figcaption>Update your scheme’s build configurations</figcaption></figure><p>Repeat the steps above for each schemes you have specified. Remember to set your scheme as a shared scheme by ticking the shared checkbox. Otherwise your schemes cannot be use outside of Xcode and can’t be track in git as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*rM3tBZJmmjqR7KAYu_Qjdg.png" /><figcaption>The final shared schemes</figcaption></figure><h3>Setting Up Fastlane on Your Project</h3><blockquote>Skip to the<a href="#5c1b"> <strong>next section</strong></a> if you are already familiar with Fastlane.</blockquote><p>To initialize Fastlane on your project, run the following command inside your terminal.</p><pre>$~ cd /your-project  # Make sure you&#39;re in the project root path<br>$~ fastlane init</pre><p>Fastlane will then prompts you several questions to help you quickly setup your project Fastfile and Appfile . Don’t worry if you messed it up since you probably will change it later on.</p><h4>Creating Fastlane lanes</h4><p>Fastlane use lane to define the deployment workflow. For this tutorial, we will create three different lanes; An alpha lane for development build, a beta lane for staging build and a store lane for production(app store) build.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59190fdc66478ffb485f08a7c15480b8/href">https://medium.com/media/59190fdc66478ffb485f08a7c15480b8/href</a></iframe><p>Now, when you run fastlane inside your project directory, you will have the following lanes available to be choose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*v74aPtH-E50GwIL6_bx-wQ.png" /><figcaption>Available lanes to run</figcaption></figure><p>With this set up, you can simply run the following command to use Fastlane.</p><pre>$~ fastlane alpha  # to run the alpha lane<br>$~ fastlane beta   # to run the beta lane<br>$~ fastlane store  # to run the store lane</pre><h3>Auto-incrementing Build Number Based on the Number of Commits</h3><p>To auto-increment your build and version number, we have to make sure that your project is using Apple Generic versioning system. You can read the <a href="https://developer.apple.com/library/content/qa/qa1827/_index.html">Apple’s official docs</a> for more details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*Ar7pQUlBuwhOMwkrLlDPEQ.png" /><figcaption>Set the current project version and versioning system</figcaption></figure><p>Our plan is to set the project’s build number based on the number of git commits. So add the following to your Fastfile inside the before_all block. A before_all block will be executed before any lane is called.</p><pre>before_all do<br>    # get the number of git commits<br>    build_number = number_of_commits(all: true)<br>    # increment the project build number based on git commits   <br>    increment_build_number(build_number: build_number)    <br>end</pre><p>To get the project version number in Fastlane, use the following <a href="https://docs.fastlane.tools/actions/#fastlane-actions">action</a> inside the before_all block.</p><pre>before_all do<br>    version_number = get_version_number(<br>                        xcodeproj: &quot;ToyFastlaneAppIcon.xcodeproj&quot;)<br>    ...<br>end</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e7912585ddc79815f2980e525a87827/href">https://medium.com/media/3e7912585ddc79815f2980e525a87827/href</a></iframe><p>Now, you can use the build_number and version_number to add it on your app icon’s badge.</p><h3>Installing Fastlane Plugin</h3><p>We will be using one of the <a href="https://docs.fastlane.tools/plugins/available-plugins/#available-plugins">many Fastlane plugins available</a> called <a href="https://github.com/HazAT/fastlane-plugin-badge">badge</a> to overlay version badge on top of your app icon. To get started, run the following command on your terminal.</p><pre>$~ fastlane add_plugin badge</pre><p>By default, this will create a new Pluginfile inside your fastlane/ folder and a Gemfile and Gemfile.lock at the root project.</p><blockquote><strong>IMPORTANT:</strong> Make sure you have <a href="https://www.imagemagick.org/">ImageMagick</a> installed on your computer since the plugin use ImageMagick to generate the images. If not, there will be a lot of errors. You can install it with <a href="https://brew.sh/">Homebrew</a>.</blockquote><h3>Adding the Badge on Your App Icons</h3><p>To use the badge plugin with Fastlane, we can use the following add_badge action. Check out the documentation for <a href="https://github.com/HazAT/badge">more badge options</a>.</p><pre>add_badge(<br>    # Add a shield on top of with version and build number<br>    shield: &quot;#{version_number}-#{build_number}-orange&quot;,<br>    # Add alpha or beta ribbon on the side<br>    no_badge: false,<br>    alpha: true,<br>)</pre><p>First, create a <a href="https://docs.fastlane.tools/advanced/#private-lanes">private lane</a> called add_badge_to_icon so that you can simply call it from both the alpha and beta lanes. We will then use <a href="https://github.com/fastlane/docs/blob/master/docs/advanced.md#lane-context">Fastlane’s lane context</a> to get the version_number and build_number that you have define earlier inside the before_all block.</p><pre>private_lane :add_badge_to_icon do |options|    <br>    version_number = lane_context[SharedValues::VERSION_NUMBER]<br>    build_number = lane_context[SharedValues::BUILD_NUMBER]    <br>    if options[:release] == &quot;alpha&quot;      <br>        add_badge(<br>            shield: &quot;#{version_number}-#{build_number}-orange&quot;,<br>            no_badge: false,<br>            alpha: true,<br>        )      <br>    elsif options[:release] == &quot;beta&quot;<br>        add_badge(<br>            shield: &quot;#{version_number}-#{build_number}-orange&quot;,<br>            no_badge: false,<br>        )      <br>    end  <br>end</pre><p>Now, you can call the add_badge_to_icon lane inside the alpha or beta lanes. For example:</p><pre>lane :alpha do</pre><pre>...<br>    add_badge_to_icon(release: &quot;alpha&quot;)</pre><pre>end</pre><p>Try running one of your lanes, and you will notice that a new sets of images are generated inside the xcassets folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*VejLLcq8RCcVF-EOPBtROw.png" /><figcaption>App icon with badge overlayed on top</figcaption></figure><p>It is important to remember that every time the badge plugin is run, it will generate a new images for app icons based on the current one. You definitely don’t want to commit it to git or push a new production build to the app store with the build number displayed on your app icon. That would be funny.</p><p>To avoid this situation from happening. Add the following to your before_all and after_all blocks.</p><pre>before_all do<br>    # To make sure you don&#39;t discard any uncommitted changes<br>    ensure_git_status_clean<br>    ...<br>end</pre><pre>...</pre><pre>after_all do |lane|<br>    # Discard all uncommitted changes(the new app icon images)<br>    reset_git_repo<br>    ...<br>end</pre><p>And if nothing else fails, You will finally have a customized app icons for development and staging .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*iQZkgBZDZQ53kuUvv43oOA.png" /><figcaption>Final results! 👏</figcaption></figure><h3>Conclusion</h3><p>Fastlane is a really great tool to automate the deployment process for iOS and Android apps and I bet most iOS developers are already familiar or heard it.</p><p>I hope with this neat little trick, it will encourage you to start using it and maybe help your team members to save their time as well.</p><p>You can check out the complete AppFile , Fastfile and Pluginfile below. I have also created a sample project for this tutorial, complete with code signing, deploying the app to TestFlight, etc. Do check it out. 🚀</p><h4>The Complete AppFile, FastFile and PluginFile</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87c2f11e879d75ce1d6c2e1401bafd91/href">https://medium.com/media/87c2f11e879d75ce1d6c2e1401bafd91/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fb1170b1d1668f64c520059c6df7c58/href">https://medium.com/media/7fb1170b1d1668f64c520059c6df7c58/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e0e0873951702bd57be5909b48bf242/href">https://medium.com/media/9e0e0873951702bd57be5909b48bf242/href</a></iframe><h4>Example Project Repo</h4><p><a href="https://github.com/faizmokhtar/ToyFastlaneAppIcon">faizmokhtar/ToyFastlaneAppIcon</a></p><h4>References</h4><ol><li><a href="https://github.com/HazAT/fastlane-plugin-badge">https://github.com/HazAT/fastlane-plugin-badge</a></li><li><a href="https://docs.fastlane.tools/actions/badge/">https://docs.fastlane.tools/actions/badge/</a></li><li><a href="https://fastlane.tools/">https://fastlane.tools/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=289e2ea5d2bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>