Good question 👍
The Metro bundler is the JavaScript packager that React Native uses. It must be running in the background for your app to load JS code.
🚀 How to start Metro bundler
Go to your React Native project root (where package.json is).
bash
cd ~/Desktop/your_project_name
Start Metro:
bash
npx react-native start
By default, Metro will run on port 8081.
Leave this terminal window open.
In another terminal, build & install the app:
bash
npx react-native run-android
or
bash
npx react-native run-ios
🌐 For wireless debugging
If you’re not using USB, run Metro with your laptop’s IP address:
bash
npx react-native start --host <your-laptop-ip>
Then configure your phone (Dev Settings → Debug server host & port) with:
makefile
<your-laptop-ip>:8081
⚡ Pro tip: If you already ran npx react-native run-android, Metro usually auto-starts in another tab. But if you closed it, just re-run npx react-native start.
Do you want me to also show you how to make Metro auto-restart whenever you run run-android, so you don’t have to open it manually each time?
Yes 👍 wireless debugging is very handy in React Native, especially when your USB is unreliable. Here’s a step-by-step guide to set up wireless debugging with Android (ADB):
📱 1. Prerequisites
Android device (e.g., your Redmi A2 or Galaxy A06 5G)
Android 11+ (Wireless debugging is built into Developer Options)
Laptop with ADB installed (platform-tools package)
Both laptop and phone must be on the same Wi-Fi network
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ npx react-native init ReadingAppForBrightOrange
Need to install the following packages:
react-native@0.81.1
Ok to proceed? (y) y
🚨️ The `init` command is deprecated.
- Switch to npx @react-native-community/cli init for the identical behavior.
- Refer to the documentation for information about alternative tools: https://reactnative.dev/docs/getting-started
Exiting...
👉 This creates a folder MyFirstApp with everything set up.
Move into it:
bash
cd MyFirstApp
3. Run the App
▶️ On Android (emulator or real device)
bash
npx react-native run-android
(Phone must have USB debugging enabled OR emulator running)
▶️ On iOS (Mac only)
bash
npx react-native run-ios
4. Start the Development Server
React Native uses Metro bundler. Start it with:
bash
npx react-native start
This watches your code and reloads app changes automatically.
5. Edit Your App
Open App.js in your project folder.
Change the text inside the default screen, e.g.:
jsx
importReactfrom'react';
import { Text, View } from'react-native';
constApp = () => {
return (
<Viewstyle={{flex:1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Hello Ashish 👋, this is my first React Native app!</Text>
</View>
);
};
exportdefaultApp;
Save → App reloads → You see your changes instantly.
6. Learn Core Components
Some essential components:
View → like a <div> (containers)
Text → display text
Image → display images
Button → basic buttons
TextInput → input fields
ScrollView / FlatList → lists and scrolling
7. Next Steps
Learn React Navigation (@react-navigation/native) for multiple screens
Use AsyncStorage or SQLite/Realm for local data
Try fetching APIs with fetch or axios
✅ With just this, you’ll have a working mobile app you can run on your Redmi A2 (or emulator) and keep improving step by step.
Do you want me to:
👉 (A) give you a minimal working "Hello World" project code you can paste directly, OR
👉 (B) outline a step-by-step practice roadmap (small milestones to learn React Native gradually)?