# Prerequisites

Before you can work with OrchardGo, ensure you have the following tools and versions installed.

## Required Versions

| Tool | Version | Location |
|------|---------|----------|
| Node.js | 20.11.1 | [.node-version](../../.node-version) |
| Ruby | 3.2.3 | [.ruby-version](../../.ruby-version) |
| Java | 17.0.14-amzn | [.java-version](../../.java-version) |
| Yarn | See version file | [.yarn-version](../../.yarn-version) |
| React Native | 0.80.2 | [package.json](../../package.json) |

## Platform-Specific Requirements

### macOS Development

#### Xcode
- **Version**: See [.xcode-version](../../.xcode-version)
- **Installation**: [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835)
- **Additional Setup**: [Xcode Configuration Guide](../maintenance/xcode-setup.md)

#### Homebrew
Required for installing dependencies:

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

#### Watchman
File watching service for React Native:

```bash
brew install watchman
```

#### CocoaPods
iOS dependency manager:

```bash
# Recommended: with admin rights
sudo gem install cocoapods

# Alternative: without admin rights
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
gem install cocoapods --user-install
```

### Android Development

#### Android Studio
- **Installation**: [Download Android Studio](https://developer.android.com/studio)
- **Setup**: Configure AVD Manager for emulators

#### Java Development Kit
```bash
brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
```

#### Environment Variables
Add to your `~/.bash_profile` or `~/.zshrc`:

```bash
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
```

#### Platform Tools
```bash
brew install --cask android-platform-tools
```

## Verification

Check all required tools are installed with the correct versions:

```bash
yarn check:tools
```

This command will verify:
- Node.js version
- Ruby version
- Java version
- Yarn version
- Xcode (macOS only)
- Android SDK (if developing for Android)

## Next Steps

Once all prerequisites are installed, proceed to [Installation](./installation.md).

## Additional Resources

- [React Native Environment Setup](https://reactnative.dev/docs/environment-setup)
- [macOS Maintenance Guide](../maintenance/macos-maintenance.md)
