<?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 Samrez Ikram on Medium]]></title>
        <description><![CDATA[Stories by Samrez Ikram on Medium]]></description>
        <link>https://medium.com/@samrezikram?source=rss-31511e4eccb1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*q8oSpHBidi_fPM_6.</url>
            <title>Stories by Samrez Ikram on Medium</title>
            <link>https://medium.com/@samrezikram?source=rss-31511e4eccb1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:15:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samrezikram/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[Mastering iOS Simulator Management on Apple Silicon]]></title>
            <link>https://medium.com/@samrezikram/mastering-ios-simulator-management-on-apple-silicon-3ba76987ff67?source=rss-31511e4eccb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ba76987ff67</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Samrez Ikram]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 19:59:02 GMT</pubDate>
            <atom:updated>2025-10-08T19:59:02.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buWlC-BZwAgACogQTVjF7w.png" /></figure><p>If you’ve been building iOS apps for a few years, you already know how quickly your Xcode environment can spiral out of control — multiple simulator runtimes, dozens of device profiles, gigabytes of cached data, and random “build failed with exit code 65” moments.</p><p>This article walks through a clean, reproducible approach to managing iOS simulators on Apple Silicon (M-series) Macs. Whether you’re trying to reclaim storage, align your test matrix, or simply keep your mental space uncluttered — these steps will help you take full control.</p><h4>1️⃣ Understanding How Xcode Stores Simulators</h4><p>All simulators, runtimes, and virtual device data live here:</p><pre>~/Library/Developer/CoreSimulator/</pre><p>Inside this directory you’ll find:</p><p><strong>Devices/</strong> — a folder containing every simulated device you’ve ever created</p><p><strong>Profiles/Runtimes/</strong> — the actual iOS runtimes (each can consume 5–10 GB)</p><p><strong>Caches/</strong> — temp data and snapshots</p><p>Each simulator is represented by a UUID folder. Deleting one of these folders manually will remove the device definition.</p><h4>2️⃣ Listing Installed Runtimes and Devices</h4><p>Use xcrun simctl, the Swiss army knife of simulator management.</p><p>List available runtimes</p><pre>xcrun simctl list runtimes</pre><h4>List all devices</h4><pre>xcrun simctl list devices</pre><p>This helps you identify exactly which versions and device types are cluttering your environment.</p><h4>3️⃣ Deleting Unused iOS Runtimes</h4><p>Old runtimes (like iOS 17.x or 18.x) often remain even after Xcode upgrades.</p><p>Each one easily takes several GB of space.</p><p>Remove them safely:</p><pre>sudo rm -rf ~/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 17.2.simruntime<br>sudo rm -rf ~/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 18.2.simruntime<br>sudo rm -rf ~/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 18.5.simruntime</pre><p>Keep only the one that matches your current Xcode SDK (for example, <strong>iOS 26.0</strong>).</p><h4>4️⃣ Creating Specific Devices</h4><p>You can manually recreate only the simulators you truly need.</p><p>For example, to create <strong>iPhone 17</strong>, <strong>iPhone 17 Pro</strong>, and <strong>iPhone 17 Pro Max</strong> on iOS 26.0:</p><pre>xcrun simctl create &quot;iPhone 17&quot; \<br>  &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17&quot; \<br>  &quot;com.apple.CoreSimulator.SimRuntime.iOS-26-0&quot;</pre><pre>xcrun simctl create &quot;iPhone 17 Pro&quot; \<br>  &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro&quot; \<br>  &quot;com.apple.CoreSimulator.SimRuntime.iOS-26-0&quot;</pre><pre>xcrun simctl create &quot;iPhone 17 Pro Max&quot; \<br>  &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro-Max&quot; \<br>  &quot;com.apple.CoreSimulator.SimRuntime.iOS-26-0&quot;</pre><p>You can confirm with:</p><pre>xcrun simctl list devices</pre><h4>5️⃣ Deleting Specific Devices</h4><p>Sometimes you just want to prune a few.</p><p>Use the device name or UUID:</p><pre>xcrun simctl delete &quot;iPhone 15&quot;<br>xcrun simctl delete &quot;iPad Pro (M3)&quot;</pre><p>To nuke all simulators before rebuilding your setup:</p><pre>xcrun simctl delete all</pre><h4>6️⃣ Installing a Specific iOS Runtime</h4><p>When you install Xcode, it bundles the latest runtime.</p><p>If you need an older or specific version (say iOS 18.5), go to:</p><p><strong>Xcode → Settings → Platforms → iOS Simulator → + Add Additional Simulators</strong></p><p>or download from the <a href="https://developer.apple.com/download/all/">Apple Developer portal → More Downloads</a>.</p><p>Once installed, you can create devices targeting that runtime via simctl.</p><h4>7️⃣ Reclaiming Disk Space</h4><p>A typical bloated Xcode setup can easily eat <strong>50–100 GB</strong>.</p><p>You can safely clear the following:</p><pre># Derived Data (build intermediates)<br>rm -rf ~/Library/Developer/Xcode/DerivedData/*</pre><pre># Device data<br>rm -rf ~/Library/Developer/CoreSimulator/Devices/*</pre><pre># Archived builds<br>rm -rf ~/Library/Developer/Xcode/Archives/*</pre><pre># Old runtimes<br>rm -rf ~/Library/Developer/CoreSimulator/Profiles/Runtimes/*</pre><p>Pro tip: run this occasionally when switching between major iOS releases or after uninstalling old Xcode versions.</p><h4>8️⃣ Automating the Setup (Reusable Script)</h4><p>Here’s a reusable shell script to keep your environment consistent:</p><pre>#!/bin/bash<br># setup_simulators.sh — clean &amp; rebuild preferred simulators</pre><pre>RUNTIME=&quot;com.apple.CoreSimulator.SimRuntime.iOS-26-0&quot;</pre><pre>echo &quot;🧹 Cleaning old simulators...&quot;<br>xcrun simctl delete all</pre><pre>echo &quot;✅ Creating standard iPhone 17 lineup...&quot;<br>xcrun simctl create &quot;iPhone 17&quot; &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17&quot; &quot;$RUNTIME&quot;<br>xcrun simctl create &quot;iPhone 17 Pro&quot; &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro&quot; &quot;$RUNTIME&quot;<br>xcrun simctl create &quot;iPhone 17 Pro Max&quot; &quot;com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro-Max&quot; &quot;$RUNTIME&quot;</pre><pre>echo &quot;📱 Current devices:&quot;<br>xcrun simctl list devices | grep iPhone</pre><p>Make it executable:</p><pre>chmod +x setup_simulators.sh</pre><p>Run it anytime your simulator setup gets messy.</p><h4>Apple Silicon Considerations</h4><p>On Apple Silicon (arm64) Macs:</p><ul><li>Simulators run natively, so prefer <strong>arm64 builds</strong> when possible.</li><li>If you’re installing custom Ruby or Python for iOS tooling, ensure Homebrew paths (/opt/homebrew/bin) are in your $PATH for Xcode’s Run Script phases.</li><li>Avoid mixing Intel (Rosetta) versions of gems or pods — it causes linker mismatches during pod install.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ba76987ff67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Closures, Generics and AssociatedType in Swift.]]></title>
            <link>https://medium.com/@samrezikram/closures-generics-and-associatedtype-in-swift-4f22f36cbfa6?source=rss-31511e4eccb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f22f36cbfa6</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Samrez Ikram]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 13:55:31 GMT</pubDate>
            <atom:updated>2023-04-11T13:55:31.019Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Closures: </strong>In Swift, a closure is a self-contained block of code that can be passed around and used in your code. Closures can capture and store references to any constants and variables from the context in which they are defined, and can be used to create functions and methods that can be stored and passed as values.</p><p>Here’s an example of a closure in Swift:</p><pre>let myClosure = { (num1: Int, num2: Int) -&gt; Int in<br>    return num1 + num2<br>}</pre><p>This closure takes two integer parameters and returns their sum. You can call this closure like a function:</p><pre>let result = myClosure(2, 3) // result = 5</pre><p><strong>Generics:</strong> Generics are a powerful feature in Swift that allow you to write flexible and reusable code. Generics allow you to write code that can work with any type, as long as that type conforms to certain requirements.</p><p>Here’s an example of a generic function in Swift:</p><pre>func swap&lt;T&gt;(_ a: inout T, _ b: inout T) {<br>    let temp = a<br>    a = b<br>    b = temp<br>}</pre><p>This function takes two parameters of type inout T, which means that they can be of any type, as long as that type is mutable (i.e., can be changed). The function then swaps the values of the two parameters.</p><p>You can call this function with any type that conforms to the requirements of the function:</p><pre>var x = 1<br>var y = 2<br>swap(&amp;x, &amp;y) // x = 2, y = 1</pre><pre>var str1 = &quot;hello&quot;<br>var str2 = &quot;world&quot;<br>swap(&amp;str1, &amp;str2) // str1 = &quot;world&quot;, str2 = &quot;hello&quot;</pre><p><strong>Associated Types: </strong>Associated types are a feature in Swift that allow you to define placeholder types that will be filled in later, when a conforming type is specified.</p><p>Here’s an example of a protocol with an associated type:</p><pre>protocol Container {<br>    associatedtype Item<br>    func addItem(_ item: Item)<br>    func getItem() -&gt; Item?<br>}</pre><p>This protocol defines a placeholder type called Item. Any type that conforms to this protocol will need to provide its own concrete type for Item.</p><p>Here’s an example of a class that conforms to this protocol:</p><pre>class MyContainer&lt;T&gt;: Container {<br>    typealias Item = T<br>    var items: [Item] = []</pre><pre>    func addItem(_ item: Item) {<br>        items.append(item)<br>    }</pre><pre>    func getItem() -&gt; Item? {<br>        if items.count &gt; 0 {<br>            return items.removeFirst()<br>        }<br>        return nil<br>    }<br>}</pre><p>This class provides a concrete type for Item by defining a generic type parameter T and using it as the concrete type for Item. The class also implements the required methods of the Container protocol.</p><p>You can use this class like this:</p><pre>let container = MyContainer&lt;String&gt;()<br>container.addItem(&quot;hello&quot;)<br>container.addItem(&quot;world&quot;)<br>let item = container.getItem() // item = &quot;hello&quot;</pre><p>Conclusion</p><p>Closures, generics, and associated types are all powerful features in Swift that allow you to write flexible and reusable code. Closures allow you to create self-contained blocks of code that can be passed around and used in your code. Generics allow you to write code that can work with any type, as long as that type conforms to certain requirements. Associated types allow you to define placeholder types that will be filled in later, when a conforming type</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f22f36cbfa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>