To run a React Native app on Android, you need either an Android Emulator or a real Android device. This setup allows developers to test, debug, and preview apps during development.
React Native uses the Android SDK to compile and run apps. The react-native run-android command builds the app, installs it on the emulator or device, and starts the app automatically.
// Command to start Android app on emulator or device
npx react-native run-android
// Check connected Android devices and emulators
adb devices
When the emulator or device is correctly set up, the app launches automatically and displays the default React Native welcome screen. Metro bundler runs in the background to serve JavaScript code.
Simulate the process of connecting a device and running the build command. Click the buttons in order.
npx react-native run-android