<?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: nitish</title>
    <description>The latest articles on DEV Community by nitish (@nitish173).</description>
    <link>https://dev.to/nitish173</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F310734%2Fe937b205-60d3-4e6b-b058-417b056f1c21.png</url>
      <title>DEV Community: nitish</title>
      <link>https://dev.to/nitish173</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nitish173"/>
    <language>en</language>
    <item>
      <title>How to generate a debug apk in react-native</title>
      <dc:creator>nitish</dc:creator>
      <pubDate>Thu, 04 Jun 2020 20:17:48 +0000</pubDate>
      <link>https://dev.to/nitish173/how-to-generate-a-debug-apk-in-react-native-1gdg</link>
      <guid>https://dev.to/nitish173/how-to-generate-a-debug-apk-in-react-native-1gdg</guid>
      <description>&lt;h4&gt;
  
  
  What is an .apk file?
&lt;/h4&gt;

&lt;p&gt;An Android Package Kit (APK) is the package file format used by the Android OS for distribution and installation of mobile apps. It is similar to the .exe file you have on Windows OS, a .apk file is for android.&lt;/p&gt;

&lt;h4&gt;
  
  
  What can I use it for?
&lt;/h4&gt;

&lt;p&gt;A debug .apk file will allow you to install and test your app before publishing to app stores. Mind you, this is not yet ready for publishing, and there are quite a few things you'll need to do to before you can publish. Nevertheless, it'll be useful for initial distribution and testing.&lt;/p&gt;

&lt;p&gt;You'll need to enable debugging options on your phone to run this apk.&lt;/p&gt;

&lt;h4&gt;
  
  
  Prerequisite:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;react-native version &amp;gt; 0.57&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How to generate one in 3 steps?
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Step 1:&lt;/em&gt; Go to the root of the project in the terminal and run the below command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step 2:&lt;/em&gt; Go to android directory:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd android&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step 3:&lt;/em&gt; Now in this &lt;code&gt;android&lt;/code&gt; folder, run this command&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./gradlew assembleDebug&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;There! you'll find the apk file in the following path: &lt;br&gt;
 &lt;code&gt;yourProject/android/app/build/outputs/apk/debug/app-debug.apk&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now you have your .apk file generated, install it on your android phone and enjoy!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank you.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>android</category>
      <category>apk</category>
      <category>build</category>
    </item>
  </channel>
</rss>
