<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohammad Ali</title>
    <description>The latest articles on DEV Community by Mohammad Ali (@itsproali).</description>
    <link>https://dev.to/itsproali</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1634661%2F3e55b200-37d2-4718-872d-6feed8441b75.png</url>
      <title>DEV Community: Mohammad Ali</title>
      <link>https://dev.to/itsproali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/itsproali"/>
    <language>en</language>
    <item>
      <title>Shipping a Mac app outside the App Store: signing, notarization, Sparkle and Homebrew</title>
      <dc:creator>Mohammad Ali</dc:creator>
      <pubDate>Tue, 24 Nov 2026 15:00:22 +0000</pubDate>
      <link>https://dev.to/itsproali/shipping-a-mac-app-outside-the-app-store-signing-notarization-sparkle-and-homebrew-4aab</link>
      <guid>https://dev.to/itsproali/shipping-a-mac-app-outside-the-app-store-signing-notarization-sparkle-and-homebrew-4aab</guid>
      <description>&lt;p&gt;My Mac app can't go on the Mac App Store. One of its tools reverses the mouse scroll wheel, and that needs an Accessibility event tap that the App Store sandbox doesn't allow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe98v6sjb1gjiph4l461.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe98v6sjb1gjiph4l461.jpg" alt="Mouse scrolls the classic way while the trackpad stays natural. This tool needs an Accessibility event tap" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it ships the other way: a signed and notarized DMG from my own site, automatic updates through Sparkle, and a Homebrew cask. This is the whole pipeline, with the commands I run and the two things that cost me the most time.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get a Developer ID certificate
&lt;/h2&gt;

&lt;p&gt;You need a paid Apple Developer Program membership ($99 a year) to notarize. Without it, macOS shows every new user a warning and they have to go to System Settings → Privacy &amp;amp; Security → Open Anyway before the app will open. Most people won't.&lt;/p&gt;

&lt;p&gt;This step took me a week. I live in Bangladesh, my Apple Account was set to the US region, and Bangladesh wasn't in Apple's region list. I emailed Developer Support and never got a reply. What worked was creating a new Apple Account and enrolling with that one. If you're stuck on the same screen, try that first.&lt;/p&gt;

&lt;p&gt;Once you're in, create a &lt;strong&gt;Developer ID Application&lt;/strong&gt; certificate in Xcode (Settings → Accounts → Manage Certificates). That's the one for apps distributed outside the store. "Apple Development" certificates won't pass notarization.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Sign with the hardened runtime
&lt;/h2&gt;

&lt;p&gt;Notarization requires the hardened runtime and a secure timestamp. In Xcode, turn on Hardened Runtime under Signing &amp;amp; Capabilities. If you sign from a script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codesign --force --options runtime --timestamp \
  --entitlements Makitro.entitlements \
  --sign &lt;span class="s2"&gt;"Developer ID Application: Your Name (TEAMID)"&lt;/span&gt; \
  build/Makitro.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sign nested code first (frameworks, XPC services, helper tools), then the app. Sparkle ships its own helpers, and its docs explain how to sign them. Avoid &lt;code&gt;--deep&lt;/code&gt; as a shortcut; it signs everything with the same entitlements, which is rarely what you want.&lt;/p&gt;

&lt;p&gt;Check the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codesign --verify --deep --strict --verbose=2 build/Makitro.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Build and sign the DMG
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hdiutil create -volname &lt;span class="s2"&gt;"Makitro"&lt;/span&gt; -srcfolder build/Makitro.app \
  -ov -format UDZO dist/Makitro.dmg

codesign --sign &lt;span class="s2"&gt;"Developer ID Application: Your Name (TEAMID)"&lt;/span&gt; \
  --timestamp dist/Makitro.dmg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Notarize and staple
&lt;/h2&gt;

&lt;p&gt;Store your credentials once (with an app-specific password from your Apple Account page):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun notarytool store-credentials &lt;span class="s2"&gt;"notary"&lt;/span&gt; \
  --apple-id &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt; --team-id &lt;span class="s2"&gt;"TEAMID"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then for every release:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun notarytool submit dist/Makitro.dmg --keychain-profile &lt;span class="s2"&gt;"notary"&lt;/span&gt; --wait
xcrun stapler staple dist/Makitro.dmg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--wait&lt;/code&gt; blocks until Apple answers. If the status comes back &lt;code&gt;Invalid&lt;/code&gt;, the log tells you exactly which file failed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun notarytool log &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;submission-id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --keychain-profile &lt;span class="s2"&gt;"notary"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The usual causes are a nested binary that isn't signed, a missing hardened runtime, or a missing timestamp.&lt;/p&gt;

&lt;p&gt;Stapling attaches the ticket to the DMG, so Gatekeeper can check it even offline. Confirm it worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spctl --assess --type open --context context:primary-signature -v dist/Makitro.dmg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. The permission reset nobody warned me about
&lt;/h2&gt;

&lt;p&gt;This one surprised my early users more than me.&lt;/p&gt;

&lt;p&gt;My first builds were signed before I had a Developer ID. When 0.9.2 shipped as the first notarized build, everyone who updated had to grant Accessibility again.&lt;/p&gt;

&lt;p&gt;macOS stores privacy grants like Accessibility (the TCC database) against the app's code signing requirement, not just its bundle ID. A new signing identity means a new requirement, so the old grant no longer matches. The settings and data were all still there. The permission just wasn't.&lt;/p&gt;

&lt;p&gt;If you're moving to Developer ID after an early beta, say so in the release notes before people update. One line ("macOS will ask for Accessibility once more after this update") saved me a pile of "it stopped working" messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Updates with Sparkle
&lt;/h2&gt;

&lt;p&gt;Outside the App Store you ship your own updates. &lt;a href="https://sparkle-project.org" rel="noopener noreferrer"&gt;Sparkle&lt;/a&gt; is the standard.&lt;/p&gt;

&lt;p&gt;Generate an EdDSA key pair once. The private key stays in your Keychain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./bin/generate_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put the public key and your feed URL in &lt;code&gt;Info.plist&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;SUFeedURL&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;https://example.com/appcast.xml&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;SUPublicEDKey&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;YOUR_PUBLIC_KEY&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each release, put the notarized DMG in a folder and let Sparkle write the appcast and signatures:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./bin/generate_appcast releases/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upload the DMG and &lt;code&gt;appcast.xml&lt;/code&gt;. Sparkle refuses any update whose signature doesn't match the public key, so a hijacked download server can't push a fake build.&lt;/p&gt;

&lt;p&gt;One privacy note: Sparkle can ask the user before it starts checking automatically. I keep that prompt. It's the only network request my app makes, so I'd rather it be one the user agreed to.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. A Homebrew tap
&lt;/h2&gt;

&lt;p&gt;Developers will want &lt;code&gt;brew install&lt;/code&gt;. You don't need to get into the main Homebrew repo; your own tap is enough.&lt;/p&gt;

&lt;p&gt;Create a GitHub repo named &lt;code&gt;homebrew-tap&lt;/code&gt; and add a file under &lt;code&gt;Casks/&lt;/code&gt;. This is my real one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"makitro"&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="s2"&gt;"1.0.1"&lt;/span&gt;
  &lt;span class="n"&gt;sha256&lt;/span&gt; &lt;span class="s2"&gt;"2506f8cb1e8fb9f751c6fe51c64a95addb81767629008d2e76b349924d3cdc"&lt;/span&gt;

  &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/itsproali/makitro/releases/download/v#{version}/Makitro-#{version}.dmg"&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="s2"&gt;"Makitro"&lt;/span&gt;
  &lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s2"&gt;"Menu-bar toolkit: clipboard history, scroll reverser, color picker"&lt;/span&gt;
  &lt;span class="n"&gt;homepage&lt;/span&gt; &lt;span class="s2"&gt;"https://makitro.mdali.dev/"&lt;/span&gt;

  &lt;span class="n"&gt;livecheck&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="s2"&gt;"https://makitro.mdali.dev/appcast.xml"&lt;/span&gt;
    &lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="ss"&gt;:sparkle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;:&lt;/span&gt;&lt;span class="n"&gt;short_version&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="n"&gt;auto_updates&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="n"&gt;depends_on&lt;/span&gt; &lt;span class="n"&gt;macos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="ss"&gt;:sonoma&lt;/span&gt;

  &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="s2"&gt;"Makitro.app"&lt;/span&gt;

  &lt;span class="n"&gt;zap&lt;/span&gt; &lt;span class="n"&gt;trash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"~/Library/Application Support/dev.mdali.Makitro"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"~/Library/Preferences/dev.mdali.Makitro.plist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two lines do most of the work. &lt;code&gt;auto_updates true&lt;/code&gt; tells Homebrew that Sparkle handles updates, so &lt;code&gt;brew upgrade&lt;/code&gt; won't fight with it. The &lt;code&gt;livecheck&lt;/code&gt; block points Homebrew at the same Sparkle appcast, so it learns about new versions from one source of truth. Get the hash with &lt;code&gt;shasum -a 256 Makitro-1.0.1.dmg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Users install with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew install --cask itsproali/tap/makitro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The release checklist I run now
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Bump the version and build number.&lt;/li&gt;
&lt;li&gt;Archive, then sign nested code and the app with Developer ID and the hardened runtime.&lt;/li&gt;
&lt;li&gt;Build the DMG, sign it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notarytool submit --wait&lt;/code&gt;, then &lt;code&gt;stapler staple&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Test on a Mac user account that has never run the app: the DMG opens with no warning.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;generate_appcast&lt;/code&gt;, upload the DMG and appcast.&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;version&lt;/code&gt; and &lt;code&gt;sha256&lt;/code&gt; in the cask, push the tap.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disclosure
&lt;/h2&gt;

&lt;p&gt;The app in this post is Makitro, a menu-bar app I make with 8 small utilities (clipboard history, screenshots, an ⌥Tab window switcher and more). You can download it and use every tool for 14 days; after that it's a one-time licence. &lt;a href="https://makitro.mdali.dev/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=launch" rel="noopener noreferrer"&gt;https://makitro.mdali.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you ship a Mac app outside the store, what's the step that broke for you?&lt;/p&gt;

</description>
      <category>macos</category>
      <category>swift</category>
      <category>tutorial</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Getting Started With React Native: Installation &amp; Setup</title>
      <dc:creator>Mohammad Ali</dc:creator>
      <pubDate>Sun, 16 Jun 2024 15:26:37 +0000</pubDate>
      <link>https://dev.to/itsproali/getting-started-with-react-native-installation-setup-37c5</link>
      <guid>https://dev.to/itsproali/getting-started-with-react-native-installation-setup-37c5</guid>
      <description>&lt;p&gt;React Native is a popular framework for building mobile applications using JavaScript and React. In this guide, we'll walk you through the steps to get started with React Native, including installation, environment setup, and project initialization. Today I will cover only Windows Setup!&lt;/p&gt;

&lt;h4&gt;
  
  
  Prerquisites
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://chocolatey.org/install" rel="noopener noreferrer"&gt;Chocolatey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;Node JS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Installation
&lt;/h2&gt;

&lt;p&gt;First of all, we need to install &lt;code&gt;JDK (Java Development Kit)&lt;/code&gt; and &lt;code&gt;Android Studio&lt;/code&gt; on our machine. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JDK Install:&lt;/strong&gt; Open an Administrator Command Prompt (right-click Command Prompt and select "Run as Administrator"), then run the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="n"&gt;microsoft&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;openjdk17&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Android Studio Installation:&lt;/strong&gt; There are lots of versions of &lt;a href="https://developer.android.com/studio/index.html" rel="noopener noreferrer"&gt;Android Studio&lt;/a&gt;. You may download a suitable version of your PC requirements. After Installation make sure you have downloaded these or relevant dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Android SDK Platform 34&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Intel x86 Atom_64 System Image&lt;/code&gt; or &lt;code&gt;Google APIs Intel x86 Atom System Image&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the &lt;code&gt;Android SDK Build-Tools&lt;/code&gt; entry, then make sure that &lt;code&gt;34.0.0&lt;/code&gt; is selected.&lt;/p&gt;

&lt;p&gt;Finally, click "Apply" to download and install the Android SDK and related build tools.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Environment Setup
&lt;/h2&gt;

&lt;p&gt;The React Native tools require some environment variables to be set up to build apps with native code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Configure the ANDROID_HOME environment variable&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the &lt;strong&gt;Windows Control Panel&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;User Accounts&lt;/strong&gt;, then click &lt;strong&gt;User Account&lt;/strong&gt;s again&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Change my environment variables&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;New...&lt;/strong&gt; to create a new &lt;code&gt;ANDROID_HOME&lt;/code&gt; user variable that points to the path to your Android SDK:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5qgtzsp0z6iumov75mb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5qgtzsp0z6iumov75mb.png" alt="Environment Variable Setup" width="653" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Add platform-tools to Path&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the &lt;strong&gt;Windows Control Panel&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;User Accounts&lt;/strong&gt;, then click &lt;strong&gt;User Account&lt;/strong&gt;s again&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Change my environment variables&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Path&lt;/strong&gt; variable.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New&lt;/strong&gt; and add the path to platform-tools to the list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;C:\Users\username\AppData\Local\Android\Sdk\platform-tools&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will need an Android device to run our React Native Android app. This can be either a &lt;code&gt;physical Android device&lt;/code&gt;, or more commonly, you can use an &lt;code&gt;Android Virtual Device&lt;/code&gt; which allows you to emulate an Android device on your computer.&lt;/p&gt;

&lt;p&gt;Either way, you will need to prepare the device to run Android apps for development.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Create a New React Native Project
&lt;/h2&gt;

&lt;p&gt;Once the development environment is set up, you can create a new React Native project using the React Native CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt; &lt;span class="nc"&gt;MyReactNativeApp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a new directory called &lt;code&gt;MyReactNativeApp&lt;/code&gt; with all the necessary files and dependencies.&lt;/p&gt;

&lt;p&gt;Navigate to your project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="nc"&gt;MyReactNativeApp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;React Navigation Native Stack Setup (optional)&lt;/strong&gt;&lt;br&gt;
If you don't want to implement React Navigation, you may skip this part.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reactnavigation.org" rel="noopener noreferrer"&gt;React Navigation&lt;/a&gt; is the most popular library for Routing and navigation for &lt;code&gt;Expo&lt;/code&gt; and &lt;code&gt;React Native&lt;/code&gt; apps. Run the below command to work with React Navigation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="nd"&gt;@react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;navigation&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt; &lt;span class="nd"&gt;@react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;navigation&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;screens&lt;/span&gt; &lt;span class="n"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;safe&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;area&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;react-native-screens&lt;/code&gt; package requires one additional configuration step to properly work on Android devices. Edit &lt;code&gt;MainActivity.kt&lt;/code&gt; or &lt;code&gt;MainActivity.java&lt;/code&gt; file which is located under &lt;code&gt;android/app/src/main/java/&amp;lt;your package name&amp;gt;/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Add the highlighted code to the body of the &lt;code&gt;MainActivity&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;onCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;savedInstanceState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Bundle&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and make sure to add the following import statement at the top of this file below your package statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;android&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Bundle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This change is required to avoid crashes related to View state being not persisted consistently across Activity restarts.&lt;/p&gt;

&lt;p&gt;Now, we need to wrap the whole app in NavigationContainer. Usually, you'd do this in your entry file, such as index.js or App.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'react'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;NavigationContainer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@react-navigation/native'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavigationContainer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Rest of your app code */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavigationContainer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to use the Native stack follow code block below to setup the native stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createNativeStackNavigator&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@react-navigation/native-stack'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;Stack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createNativeStackNavigator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;MyStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Navigator&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Home"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Notifications"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Notifications&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Profile"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Profile&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Settings"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Settings&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Navigator&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Run the project
&lt;/h2&gt;

&lt;p&gt;If all the setup is done, then it's time to see some magic by running the project. Open the terminal and run the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;native&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;android&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;You now have a basic React Native setup ready for development. From here, you can start building your mobile application using React Native. Happy coding!&lt;/p&gt;

&lt;h4&gt;
  
  
  Note:
&lt;/h4&gt;

&lt;p&gt;I am not a React Native Expert. Still, If you have any questions or run into any issues or if there are any corrections, feel free to leave a comment below.&lt;/p&gt;

&lt;h4&gt;
  
  
  About the Author:
&lt;/h4&gt;

&lt;p&gt;I am &lt;code&gt;Mohammad Ali&lt;/code&gt;, a Full Stack Developer (MERN). You can connect with me and see my work through the following links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://itsproali.me/" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/itsproali/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.github.com/itsproali/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to reach out for any collaborations or inquiries. Happy coding!&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>android</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
