Generate APK in React Native
In this article, we're going to see how to generate Debug APK in React Native using CLI.
About React Native:
React Native is an open source mobile application framework created by facebook. In other words React Native is a JavaScript framework for writing real natively rendering mobile applications for iOS and Android. React components wrap existing native code and interact with native APIs via React’s declarative UI paradigm and JavaScript. This enables native app development for whole new teams of developers, and can let existing native teams work much faster.
How to Create App in React Native:
npx react-native init spanishNumber
Here, spanishNumber is name of my application. You can name your application according to your convenience.
Generate The APK In React Native:
Before generating the APK make sure your code should be error free. Once your code is error free just come into the android folder through command cd android
cd android
Once you are in android folder, the last command that creates APK is gradlew assembleRelease
gradlew assembleRelease
This command takes couple of minutes for creating APK, For APK you have to follow the path spanishNumber\android\app\build\outputs\apk\release here you find the app-release.apk once the APK is created successfully get BUILD SUCCESSFUL message in your terminal Follow the above mention path and find the app-release APK
APK is succesfully created, Feel free to download it and Install the application in your device
Now there is no need of USB cable for using the App, even you can also share the APK file.