React Native app using Expo (Prebuild / CNG).
Native folders (android/, ios/) are generated locally — not committed.
git clone cd limitter-app npm install
Before starting anythihg, delete .expo, node_modules, .android, ios if these folders exist.
- Node.js (use nvm recommended)
- Java 17 -- IMPORTANT
- Android Studio (SDK + Emulator) - SDK Platformn Tools. Build Tools. SDK, Emulator. Make Sure that these packages are installed.
Check Java: java -version
Add to ~/.zshrc or ~/.bashrc:
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_HOME/emulatorS export JAVA_HOME=$(/usr/libexec/java_home -v 17) export PATH=$JAVA_HOME/bin:$PATH
Reload: source ~/.zshrc
For windows, open System Settings -> Environment Variables
Set:
ANDROID_HOME = C:\Users\YOUR_USER\AppData\Local\Android\Sdk
Add to PATH:
%ANDROID_HOME%\platform-tools %ANDROID_HOME%\emulator
Why is this needed? Windows Defender Firewall blocks the Metro bundler port (8081) by default, and USB-connected Android devices require an ADB reverse tunnel so they can reach Metro via the USB cable. macOS handles both of these automatically; Windows does not.
One-time setup + build — just double-click:
run-android.bat
That single script will:
- Detect your connected Android device (waits up to 30 s)
- Open Windows Firewall for Metro / Expo ports (8081, 8082, 19000–19002)
- Run
adb reverse tcp:8081 tcp:8081to create the USB tunnel - Run
npx expo run:androidto build, install, and launch the app
Note: The script requires Administrator privileges (it will prompt automatically). You must have USB Debugging enabled on your phone.
Firewall-only setup (standalone):
If you only want to open the firewall ports without building, run:
windows-setup.bat
- npm i --force
- npm i expo
- npm i --force
macOS / Linux — Start emulator (Android Studio), then:
npx expo run:android
Windows — Connect phone via USB, then double-click run-android.bat (see section above).
Do NOT commit:
- android/
- ios/
- android/local.properties
Install packages using: npx expo install
SDK issue: echo $ANDROID_HOME adb --version
Java issue: java -version (must be 17)
Devices: adb devices
Windows — SocketTimeoutException: failed to connect to /192.168.x.x
Windows Firewall is blocking Metro. Fix: run windows-setup.bat as Administrator,
or double-click run-android.bat which does this automatically.
Windows — Unable to load script / adb reverse tcp:8081 tcp:8081
The ADB USB tunnel is not set up. Fix: run adb reverse tcp:8081 tcp:8081 in a terminal
after plugging in your phone, or use run-android.bat which does this automatically.
npm install npx expo prebuild --clean npx expo run:android