<?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 Khairold Safri on Medium]]></title>
        <description><![CDATA[Stories by Khairold Safri on Medium]]></description>
        <link>https://medium.com/@khairold?source=rss-7671ab208fb4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lOcSNi5CDjaVMojy.jpg</url>
            <title>Stories by Khairold Safri on Medium</title>
            <link>https://medium.com/@khairold?source=rss-7671ab208fb4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 20:05:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khairold/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[Setting up React Native on Linux without Android Studio]]></title>
            <link>https://khairold.medium.com/setting-up-react-native-on-linux-without-android-studio-a65f3e011bbb?source=rss-7671ab208fb4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a65f3e011bbb</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-studio]]></category>
            <dc:creator><![CDATA[Khairold Safri]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 08:39:11 GMT</pubDate>
            <atom:updated>2019-01-29T04:34:44.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting up React Native development on Linux without installing Android Studio</h3><p>I was primarily a web developer where I was very much into React. I only started to look at mobile development when React Native was available for Android.</p><p>I installed Android Studio as the prerequisite for React Native development for Android, and was surprised of how heavy and sluggish it felt. I found out later that you don’t need to launch Android Studio for React Native development, so I tried to find a way to not install it at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*WbZ3HUgUXqBcN81gVXgQdA.jpeg" /><figcaption>And as Marie Kondo said, if it doesn’t spark joy…</figcaption></figure><p>I just installed Fedora 29 on my laptop. I was using Ubuntu 18.04 before and it was giving me all sort of problems. As I’m setting my Fedora for React Native development, I figure I’ll share the steps. I hope you find it useful.</p><p>For Ubuntu and other Debian-based, the steps should be the same, you need to change thing up a bit though, like using <em>apt-get</em> instead of <em>dnf</em> for package installation.</p><h3>First thing first</h3><h4>Update Fedora</h4><p>You’ll always want to update existing packages before proceeding.</p><pre>sudo dnf -y update</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*70cdHrXMEyYd4iUCpoW-yQ.png" /></figure><h3>Git</h3><h4>Install git</h4><p>You don’t have to install <em>git</em> to start developing with React Native. But I supposed you’ll want to use some for of version control for your codes eventually.</p><pre>sudo dnf -y install git</pre><h4>Git Version</h4><p>Once installed, you can check the <em>git</em> version.</p><pre>git --version</pre><h4>Set up git user</h4><p>Then set up the user for <em>git</em>. <br>You’ll want to change <em>sampleuser</em> and <em>sampleuser@example.com</em> to your actual user name and email address.</p><pre>git config --global user.name &quot;sampleuser&quot;<br>git config --global user.email &quot;sampleuser@example.com&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*4_n18FH8hRrvlLyRufD1sQ.png" /></figure><h3>Node.js</h3><p><em>Node.js</em> or <em>Node</em> will be the underlying engine React Native development.</p><p><em>Node</em> also comes with <em>npm</em>, which lets you install the React Native command line interface, and other npm packages that you will need later when you are developing with React Native.</p><h4>Install development tools</h4><p>To build native add-ons</p><pre>sudo dnf install -y gcc-c++ make</pre><h4>Download Node.js</h4><p>As of writing, the stable release for <em>Node.js</em> is version 10.15.0<br>Official <a href="https://github.com/nodesource/distributions/blob/master/README.md">Node.js binary distributions</a> are provided by NodeSource.</p><pre>curl -sL https://rpm.nodesource.com/setup_10.x | bash -</pre><h4>Install Node.js</h4><pre>sudo dnf install nodejs</pre><h4>Node.js Version</h4><p>Once installed, you can check the <em>Node.js</em> and <em>npm</em> version</p><pre>node -v<br>npm -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XW7Li0dI5RDmtruVtn7pCg.png" /></figure><h3>React Native</h3><h4>Install React Native CLI</h4><p>This will be used to initiate a React Native development project</p><pre>npm install -g react-native-cli</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*1CMbmHsN5-12UdZY6ppzAw.jpeg" /></figure><h3>Java Development Kit (JDK)</h3><p>React Native requires a recent version of the Java SE Development Kit (JDK).<br><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Download and install Oracle JDK 8</a> if needed.</p><h4>Create a directory for JDK</h4><pre>sudo mkdir -p /usr/local/java</pre><h4>Download JDK</h4><p>Go to <a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Oracle JDK 8 website</a>. Download the latest JDK for your OS. <br>As of writing, the latest is Java SE Development Kit 8u202:</p><ul><li><em>jdk-8u202-linux-x64.tar.gz</em> for <em>Linux x64</em></li></ul><blockquote>You have to check the <em>Accept License Agreement</em> radio button first before you can download.</blockquote><h4>Copy and Extract JDK files</h4><p>Go to the directory where you downloaded the file, for example <em>~/Downloads</em></p><pre>cd ~/Downloads</pre><p>Copy to the new directory that you have created previously and the change directory.</p><pre>sudo cp -r jdk-8u202-linux-x64.tar.gz /usr/local/java<br>cd usr/local/java</pre><p>Extract the files.</p><pre><br>sudo tar xvzf jdk-8u202-linux-x64.tar.gz</pre><p>There is now a <em>jdk1.8.0_202 </em>folder.</p><h4>Update PATH file for JDK</h4><p>You can use any text editor like <em>nano</em> to edit <em>/etc/profile.</em></p><pre>sudo nano /etc/profile</pre><p>In the text editor, paste the text below; exit and save.</p><pre>JAVA_HOME=/usr/local/java/jdk1.8.0_202<br>PATH=$PATH:$HOME/bin:$JAVA_HOME/bin<br>export JAVA_HOME<br>export PATH</pre><h4>Tell the system about the new Oracle Java version</h4><pre>sudo update-alternatives --install &quot;/usr/bin/java&quot; &quot;java&quot; &quot;/usr/local/java/jdk1.8.0_202/bin/java&quot; 1<br>sudo update-alternatives --install &quot;/usr/bin/javac&quot; &quot;javac&quot; &quot;/usr/local/java/jdk1.8.0_202/bin/javac&quot; 1<br>sudo update-alternatives --install &quot;/usr/bin/javaws.itweb&quot; &quot;javaws.itweb&quot; &quot;/usr/local/java/jdk1.8.0_202/bin/javaws.itweb&quot; 1</pre><h4>Make Oracle Java JDK as default</h4><pre>sudo update-alternatives --set java /usr/local/java/jdk1.8.0_202/bin/java<br>sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_202/bin/javac<br>sudo update-alternatives --set javaws.itweb /usr/local/java/jdk1.8.0_202/bin/javaws.itweb</pre><h4>Reload system wide PATH</h4><pre>source /etc/profile</pre><h4>Restart your Machine</h4><p>Restart for the installation to take effect</p><h4>Check Java JDK version</h4><pre>java -version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*XLFGXpYdZpKufTGnxUR9Tw.png" /><figcaption>Not installing this</figcaption></figure><h3>Android SDK instead Android Studio</h3><p>We are not installing Android Studio. Fortunately there’s a way of doing it just by downloading the Android SDK.</p><h4>Download Android SDK</h4><p>Go to <a href="https://developer.android.com/studio/index.html">Android Studio</a> website. Scroll down to <em>Command line tools only </em>near the bottom of the page. Download the SDK tools package for your platform. As of writing, the current file is:</p><ul><li><em>sdk-tools-linux-4333796.zip</em> for <em>Linux</em></li></ul><h4>Unzip the Android SDK files</h4><p>Go to the directory where you downloaded the file, for example: <em>~/Downloads</em></p><pre>cd ~/Downloads</pre><p>Unzip the files to <em>/opt/android, </em>that will eventually be your ANDROID_HOME</p><pre>unzip sdk-tools-linux-4333796.zip -d /opt/android</pre><h4>Configure the ANDROID_HOME environment variable</h4><p>Change to your home directory. <br>Open <em>.bash_profile </em>with a text editor. Again, you can use <em>nano</em>.</p><pre>cd ~<br>nano .bash_profile</pre><p>Add the following lines to your<em> .bash_profile</em></p><pre>export ANDROID_HOME=/opt/android export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools</pre><p>Load the config above into the current shell</p><pre>source .bash_profile</pre><h4>Use sdkmanager to list Android SDK packages</h4><p>First, list available packages</p><pre>sudo /opt/android/tools/bin/sdkmanager --list</pre><p>As of today, these are the latest packages that need to be installed. You might need to change this to the latest version available:</p><ul><li>platform-tools</li><li>platforms;android-28</li><li>build-tools;28.0.3</li><li>add-ons;addon-google_apis-google-24</li></ul><h4>Use sdkmanager to install Android SDK packages</h4><pre>sudo /opt/android/tools/bin/sdkmanager &quot;platform-tools&quot; &quot;platforms;android-28&quot; &quot;build-tools;28.0.3&quot; &quot;add-ons;addon-google_apis-google-24&quot;</pre><p>You will be asked for confirmation, type “y” then enter</p><h3>Setting up physical Android Device (your phone)</h3><h4>Enable debugging over USB</h4><ol><li>Go to <em>Settings &gt; About phone</em></li><li>Tap <em>Build number</em> row seven (7) times</li><li>Go to <em>Settings &gt; Developer options</em></li><li>Enable <em>USB debugging</em></li></ol><h4>Plug in your device via USB</h4><p>Plug in your device via USB to your development machine.</p><p>Check the manufacturer code by using <em>lsusb</em></p><pre>lsbub</pre><p>The output lines represent the USB devices currently connected to your machine. Find teh line wich has your phone model. For example:</p><pre>Bus 001 Device 003: ID 22b8:2e76 Motorola PCS</pre><p>Get the first four digits from the device ID. From the example above, the number is:</p><pre>22b8</pre><h4>Input the number into your udev rules</h4><p>Make sure that you replace <em>22b8</em> with the identifier you get in the command below:</p><pre>echo &#39;SUBSYSTEM==&quot;usb&quot;, ATTR{idVendor}==&quot;22b8&quot;, MODE=&quot;0666&quot;, GROUP=&quot;plugdev&quot;&#39; | sudo tee /etc/udev/rules.d/51-android-usb.rules</pre><p>Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running <em>adb devices</em></p><pre>adb devices</pre><h3>Initiate a React Native Project</h3><p>Now you are ready.<br>Use <em>react-native-cli</em> that you have installed earlier.</p><pre>react-native init yourproject</pre><h4>Change directory and start the development server</h4><pre>cd yourproject<br>react-native start</pre><h4>Run your app</h4><pre>react-native run-android</pre><p>Your app should be running on your phone now.</p><blockquote>You can also install simulator like <a href="https://www.genymotion.com/">Genymotion</a>, which is much lighter than Android Studio’s emulator</blockquote><p>I hope everything turns out well. Post a comment if you need any help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a65f3e011bbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>