home / skills / microck / ordinary-claude-skills / react-native-setup

react-native-setup skill

/skills_all/react-native-setup

This skill helps you set up and troubleshoot React Native environments across macOS, Windows, and Linux, including Xcode, Android Studio, and dependencies.

npx playbooks add skill microck/ordinary-claude-skills --skill react-native-setup

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
5.5 KB
---
name: react-native-setup
description: Expert in React Native environment setup and configuration. Helps with Node.js, Xcode, Android Studio, watchman installation, CocoaPods, simulators, emulators, and troubleshooting setup issues. Activates for environment setup, installation issues, xcode setup, android studio, simulators, emulators, react-native init, expo init, development environment, SDK configuration.
---

# React Native Setup Expert

Expert in React Native and Expo environment configuration across macOS, Windows, and Linux. Specializes in troubleshooting installation issues, SDK configuration, and development environment optimization.

## What I Know

### Prerequisites & Installation

**Node.js & npm**
- Node.js 18.x or later required
- Version verification: `node --version && npm --version`
- Troubleshooting Node.js installation issues
- npm vs yarn vs pnpm for React Native projects

**Xcode (macOS - iOS Development)**
- Xcode 15.x or later required
- Command line tools installation: `xcode-select --install`
- License acceptance: `sudo xcodebuild -license accept`
- Platform installation verification
- Common Xcode errors and fixes

**Android Studio (Android Development)**
- Android Studio Hedgehog or later
- Required SDK components:
  - Android SDK Platform 34 or later
  - Android SDK Build-Tools
  - Android Emulator
  - Android SDK Platform-Tools
- ANDROID_HOME environment variable setup
- SDK Manager configuration
- Common Android Studio issues

**Watchman**
- Installation via Homebrew (macOS): `brew install watchman`
- Purpose: File watching for fast refresh
- Troubleshooting watchman errors
- Cache clearing strategies

### Environment Configuration

**iOS Setup**
- CocoaPods installation and troubleshooting
- Pod install issues and resolutions
- Xcode project configuration
- Provisioning profiles and certificates
- iOS Simulator management
- Device selection: `xcrun simctl list devices`

**Android Setup**
- Gradle configuration
- Android SDK path configuration
- Environment variables (ANDROID_HOME, PATH)
- AVD (Android Virtual Device) creation
- Emulator performance optimization
- ADB troubleshooting

**Metro Bundler**
- Port 8081 configuration
- Cache clearing: `npx react-native start --reset-cache`
- Custom Metro config
- Asset resolution issues

### Common Setup Issues

**"Command not found" Errors**
- PATH configuration
- Shell profile updates (.zshrc, .bash_profile)
- Symlink issues

**SDK Not Found**
- SDK path verification
- Environment variable troubleshooting
- SDK Manager reinstallation

**Pod Install Failures**
- CocoaPods version issues
- Ffi gem compilation errors
- Ruby version compatibility
- `pod deintegrate && pod install` strategy

**Build Failures**
- Clean build strategies
- Dependency conflicts
- Native module compilation errors
- Xcode derived data clearing

## When to Use This Skill

Ask me when you need help with:
- Initial React Native environment setup
- Installing and configuring Xcode or Android Studio
- Setting up iOS simulators or Android emulators
- Troubleshooting "Command not found" errors
- Resolving SDK path or ANDROID_HOME issues
- Fixing CocoaPods installation problems
- Clearing Metro bundler cache
- Configuring development environment variables
- Troubleshooting build failures
- Setting up watchman for file watching
- Verifying development environment prerequisites

## Quick Setup Commands

### iOS (macOS)
```bash
# Install Xcode command line tools
xcode-select --install

# Accept Xcode license
sudo xcodebuild -license accept

# Install CocoaPods
sudo gem install cocoapods

# Install watchman
brew install watchman

# Verify setup
xcodebuild -version
pod --version
watchman version
```

### Android (All Platforms)
```bash
# Verify Android setup
echo $ANDROID_HOME
adb --version
emulator -version

# List available emulators
emulator -list-avds

# List connected devices
adb devices
```

### React Native Project
```bash
# Create new React Native project
npx react-native init MyProject

# Navigate to project
cd MyProject

# Install iOS dependencies
cd ios && pod install && cd ..

# Start Metro bundler
npm start

# Run on iOS (separate terminal)
npm run ios

# Run on Android (separate terminal)
npm run android
```

## Pro Tips

1. **Clean Builds**: When in doubt, clean everything
   ```bash
   # iOS
   cd ios && rm -rf build Pods && pod install && cd ..

   # Android
   cd android && ./gradlew clean && cd ..

   # Metro
   npx react-native start --reset-cache
   ```

2. **Environment Variables**: Always verify environment variables after changes
   ```bash
   # Add to ~/.zshrc or ~/.bash_profile
   export ANDROID_HOME=$HOME/Library/Android/sdk
   export PATH=$PATH:$ANDROID_HOME/emulator
   export PATH=$PATH:$ANDROID_HOME/platform-tools

   # Reload shell
   source ~/.zshrc
   ```

3. **Simulator Management**: List and boot specific devices
   ```bash
   # iOS
   xcrun simctl list devices
   xcrun simctl boot "iPhone 15 Pro"

   # Android
   emulator -list-avds
   emulator -avd Pixel_6_API_34
   ```

4. **Quick Health Check**: Verify entire environment
   ```bash
   node --version      # Node.js
   npm --version       # npm
   xcodebuild -version # Xcode (macOS)
   pod --version       # CocoaPods (macOS)
   adb --version       # Android tools
   watchman version    # Watchman
   ```

## Integration with SpecWeave

This skill integrates with SpecWeave's increment workflow:
- Use during `/specweave:increment` planning for environment setup tasks
- Reference in `tasks.md` for setup-related acceptance criteria
- Include in `spec.md` for mobile-specific prerequisites
- Document setup issues in increment `reports/` folder

Overview

This skill is an expert assistant for React Native and Expo environment setup across macOS, Windows, and Linux. It focuses on installing and configuring Node.js, Xcode, Android Studio, CocoaPods, watchman, and SDKs so you can run simulators and emulators reliably. I help verify prerequisites, fix common installation errors, and optimize the development environment for fast iteration.

How this skill works

I inspect your machine-level environment: Node/npm versions, PATH and shell profiles, Android SDK and ANDROID_HOME, Xcode and command-line tools, CocoaPods, Gradle, and watchman. I provide concrete verification commands, step-by-step fixes for common failures (pod install, SDK not found, command-not-found), and targeted clean/build commands to recover a broken setup. I also guide simulator and emulator creation, booting, and performance tuning.

When to use it

  • Setting up a new React Native or Expo development machine
  • Troubleshooting installation errors for Node, Xcode, Android Studio, CocoaPods, or watchman
  • Resolving build failures or native module compilation errors
  • Configuring ANDROID_HOME, PATH, or SDK components
  • Creating or managing iOS simulators and Android emulators
  • Preparing CI or team machines to match a known good environment

Best practices

  • Keep Node.js >= 18.x and verify with node --version && npm --version
  • Manage environment variables in your shell profile and reload after changes
  • Use pod deintegrate && pod install for CocoaPods rebuilds and clear derived data for Xcode issues
  • Use npx react-native start --reset-cache when Metro serves stale bundles
  • Create AVDs with matching API levels and give emulators enough RAM/CPU for performance
  • Run clean builds for Android (./gradlew clean) and remove Pods/Build folders for iOS before retrying

Example use cases

  • Walkthrough to create a new React Native project, install iOS pods, and launch an iOS simulator
  • Diagnose and fix a failing pod install due to ffi or Ruby version mismatches
  • Configure Android Studio SDK, set ANDROID_HOME, create an AVD, and get adb devices to show a virtual device
  • Resolve "command not found" for node, adb, or pod by repairing PATH and shell profiles
  • Improve Metro reliability by resetting cache and adjusting port or custom config

FAQ

What Node and Xcode versions do I need?

Use Node.js 18.x or later. For iOS development use Xcode 15.x or later; also install Xcode command-line tools and accept the license.

Pods failing to install after an upgrade—what first?

Run pod deintegrate && pod install, check CocoaPods and Ruby versions, clear derived data, and ensure the correct Ruby toolchain if ffi compilation fails.