Appearance
๐ฑ Mobile Development Setup Guide โ
Stack: React Native 0.81 ยท Expo SDK 54 ยท Expo Router ยท NX Monorepo
Package manager: Yarn 1.x
App bundle ID:com.touli.development(dev) ยทcom.touli(prod)
๐ Table of Contents โ
- Prerequisites
- Environment Setup
- Running the App
- Daily Development Workflow
- Troubleshooting
- iOS Release Runbook
Prerequisites โ
Install these tools before anything else.
Both Platforms โ
| Tool | Version | Install |
|---|---|---|
| Node.js | 18+ | nodejs.org |
| Yarn | 1.22+ | npm install -g yarn |
| Git | Latest | git-scm.com |
bash
# Verify versions
node -v
yarn -v
git --versionEnvironment Setup โ
Android Environment โ
1 โ Install JDK 17 โ
powershell
# Windows โ via winget
winget install Microsoft.OpenJDK.17
# macOS โ via Homebrew
brew install --cask temurin@17Set environment variables (Windows โ run in new terminal after install):
powershell
# Windows (PowerShell โ set permanently)
[System.Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Microsoft\jdk-17.0.19.10-hotspot", "User")bash
# macOS/Linux โ add to ~/.zshrc or ~/.bashrc
export JAVA_HOME=$(/usr/libexec/java_home -v 17)Verify:
bash
java -version
# Expected: openjdk version "17.x.x"2 โ Install Android Studio โ
Download: developer.android.com/studio
During setup, install:
- โ Android SDK
- โ Android SDK Platform (API 35)
- โ Android Virtual Device (AVD)
3 โ Set Android SDK Environment Variables โ
Windows:
powershell
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LOCALAPPDATA\Android\Sdk", "User")
# Add platform-tools to PATH
$current = [System.Environment]::GetEnvironmentVariable("PATH", "User")
[System.Environment]::SetEnvironmentVariable("PATH", "$current;$env:LOCALAPPDATA\Android\Sdk\platform-tools", "User")macOS/Linux โ add to ~/.zshrc or ~/.bashrc:
bash
export ANDROID_HOME=$HOME/Library/Android/sdk # macOS
# export ANDROID_HOME=$HOME/Android/Sdk # Linux
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulatorThen reload:
bash
source ~/.zshrc # or source ~/.bashrcVerify:
bash
adb devices
# Expected: List of devices attached (empty list is fine, means it's working)iOS Environment โ
macOS only โ iOS development requires a Mac with Xcode.
1 โ Install Xcode โ
Install from the Mac App Store (free, ~14 GB).
Then install command-line tools:
bash
xcode-select --install
sudo xcodebuild -license accept2 โ Install CocoaPods โ
bash
sudo gem install cocoapods
# or via Homebrew
brew install cocoapodsVerify:
bash
pod --version
# Expected: 1.x.x3 โ Install iOS dependencies โ
bash
cd apps/mobile/ios
pod install
cd ../../..Running the App โ
โ ๏ธ First time only: You must build the native app before using the Metro dev server.
After the first build, you only needyarn dev:mobile:expofor JS changes.
Android Emulator โ
Step 1 โ Create a Virtual Device (AVD) โ
- Open Android Studio
- Go to Device Manager โ Create Device
- Choose a device (e.g. Pixel 8) โ Select API 35 system image โ Finish
- Click โถ to start the emulator
Step 2 โ Build & Install (first time) โ
bash
yarn androidThis compiles the native Android app and installs the
com.touli.developmentAPK on the running emulator. Takes ~3โ5 minutes on first run.
Step 3 โ Start Dev Server (daily use) โ
bash
yarn dev:mobile:expoThe app will open automatically. Press a to open on Android if it doesn't.
Android Physical Device โ
Step 1 โ Enable Developer Mode on your phone โ
- Go to Settings โ About Phone
- Tap Build Number 7 times
- Go back to Settings โ Developer Options
- Enable USB Debugging
Step 2 โ Connect via USB โ
bash
adb devices
# Expected output:
# List of devices attached
# XXXXXXXXXX deviceIf it shows unauthorized, unlock your phone and tap Allow on the USB debugging prompt.
Step 3 โ Build & Install โ
bash
yarn androidStep 4 โ Start Dev Server โ
bash
yarn dev:mobile:expo๐ก Wireless debugging (Android 11+): In Developer Options, enable Wireless debugging, then use
adb pairandadb connectto go cable-free.
iOS Simulator โ
Step 1 โ Open a Simulator โ
bash
# List available simulators
xcrun simctl list devices available
# Open Simulator app (picks a default device)
open -a SimulatorOr launch from Xcode โ Xcode menu โ Open Developer Tool โ Simulator.
Step 2 โ Build & Install (first time) โ
bash
yarn iosThis compiles the native iOS app and installs it on the running simulator. Takes ~5โ8 minutes on first run.
Step 3 โ Start Dev Server (daily use) โ
bash
yarn dev:mobile:expoPress i to open on iOS if it doesn't launch automatically.
iOS Physical Device โ
Step 1 โ Connect your iPhone via USB โ
Step 2 โ Trust the computer โ
Unlock your phone and tap Trust when prompted.
Step 3 โ Register your device in Xcode โ
- Open
apps/mobile/ios/mobile.xcworkspacein Xcode - Go to Signing & Capabilities
- Select your Team (Apple ID โ free account works for dev)
- Xcode will register your device automatically
Step 4 โ Build & Install โ
bash
yarn ios --deviceIf you have multiple devices, Xcode will prompt you to choose.
Step 5 โ Start Dev Server โ
bash
yarn dev:mobile:expoDaily Development Workflow โ
Once the native app is installed, your everyday workflow is just:
bash
# Start Metro bundler โ hot reload works automatically
yarn dev:mobile:expo| Key | Action |
|---|---|
a | Open on Android |
i | Open on iOS |
r | Reload app |
m | Toggle dev menu |
j | Open debugger |
w | Open in browser |
Ctrl+C | Stop server |
When to re-run the full build โ
Re-run yarn android / yarn ios only when:
- โ
You install a new native package (e.g.
react-native-camera) - โ
You change
app.jsonnative config (icons, permissions, plugins) - โ
You pull changes that modified
android/orios/folders - โ Native build errors that Metro can't resolve
Troubleshooting โ
โ JAVA_HOME is not set โ
bash
# Check if Java is installed
java -version
# Windows โ set JAVA_HOME (replace version number as needed)
[System.Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Microsoft\jdk-17.0.19.10-hotspot", "User")
# Then restart terminalโ No development build installed โ
You're running yarn dev:mobile:expo before building the native app. Run the full build first:
bash
yarn android # for Android
yarn ios # for iOSโ adb: command not found โ
bash
# Windows โ add platform-tools to PATH
$current = [System.Environment]::GetEnvironmentVariable("PATH", "User")
[System.Environment]::SetEnvironmentVariable("PATH", "$current;$env:LOCALAPPDATA\Android\Sdk\platform-tools", "User")
# Restart terminalbash
# macOS
export PATH=$PATH:$HOME/Library/Android/sdk/platform-toolsโ Gradle build failed (Android) โ
bash
# Clean Gradle cache and rebuild
cd apps/mobile/android
./gradlew clean # macOS/Linux
gradlew.bat clean # Windows
cd ../../..
yarn androidโ CocoaPods error (iOS) โ
bash
cd apps/mobile/ios
pod deintegrate
pod install
cd ../../..
yarn iosโ Metro bundler cache issues โ
bash
yarn dev:mobile:expo --clear
# or
npx expo start --clearโ Device not detected by adb โ
- Check USB cable (use data cable, not charge-only)
- Try a different USB port
- Revoke USB debugging authorizations and re-authorize
bash
adb kill-server
adb start-server
adb devicesQuick Reference โ
bash
# โโโ First time setup โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
yarn install # Install all dependencies
yarn android # Build & install Android dev client
yarn ios # Build & install iOS dev client
# โโโ Daily development โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
yarn dev:mobile:expo # Start Metro + hot reload
# โโโ Utilities โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
adb devices # List connected Android devices
xcrun simctl list devices # List iOS simulators (macOS)
cd apps/mobile/android && gradlew.bat clean # Clean Android build (Windows)
cd apps/mobile/android && ./gradlew clean # Clean Android build (macOS)iOS Release Runbook โ
For TestFlight/release flow (versioning, archive steps, smoke tests, and crash triage), see: