> ## Documentation Index
> Fetch the complete documentation index at: https://help.emergent.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Mobile App Development

> Build and deploy mobile apps with Expo/React Native

## Mobile App Development on Emergent

Emergent supports cross-platform mobile app development using **Expo** (React Native framework). Build apps for both iOS and Android from a single codebase!

**What you can build:**

* iOS apps
* Android apps
* Cross-platform apps
* Production-ready mobile applications

## Requirements

<CardGroup cols={2}>
  <Card title="Paid Subscription" icon="credit-card" color="#f59e0b">
    **Required!**

    Mobile Agent only available on paid plans (\$20+/month)

    Not available on Free Tier
  </Card>

  <Card title="Tech Stack" icon="layer-group" color="#3b82f6">
    **Fixed Stack:**

    * Frontend: Expo (React Native)
    * Backend: FastAPI
    * Database: MongoDB
  </Card>
</CardGroup>

<Note>
  **Supported:** Expo/React Native only

  **Not Supported:** Flutter, native Kotlin, native Swift
</Note>

## How to Access Mobile Agent

<Steps>
  <Step title="Have Paid Subscription">
    Upgrade to any paid plan (\$20+/month)
  </Step>

  <Step title="Go to Home Screen">
    Return to Emergent home screen
  </Step>

  <Step title="Select Mobile Agent">
    Click agent dropdown (shows "E1", "E1.5", etc.)

    Choose **"Mobile"**
  </Step>

  <Step title="Describe Your App">
    Enter what you want to build:

    ```
    I want to build a mobile app for [purpose].

    Features:
    - [Feature 1]
    - [Feature 2]
    - [Feature 3]

    Please create an Expo/React Native app.
    ```
  </Step>

  <Step title="Start Building">
    Click "Start Task"

    Mobile Agent starts building your app!
  </Step>
</Steps>

## What is Expo?

**Expo** is a framework built on top of React Native that makes mobile development easier.

**Key Benefits:**

* Write once, run on iOS and Android
* Hot reload during development
* Access to native device features
* Easy deployment with EAS
* Over-the-air updates

**What you can access:**

* Camera and photos
* Location services
* Push notifications
* File system
* Sensors (accelerometer, gyroscope)
* And much more!

## Development Workflow

### 1. Build with Mobile Agent

**Tell the agent what you need:**

```
I need a mobile app for tracking workouts.

Features:
- User authentication
- Log workouts (exercise, sets, reps)
- View workout history
- Charts showing progress
- Dark mode

Backend:
- FastAPI REST API
- MongoDB for data storage
- User accounts

Please build this mobile app with Expo.
```

**The agent will:**

* Create Expo project structure
* Set up React Native components
* Build FastAPI backend
* Configure MongoDB
* Implement all features

### 2. Test in Preview

**During development:**

* Preview functionality available
* Test on development build
* Frontend testing subagent for UI tests
* Debug and iterate

**Best practices:**

```
After each major feature, tell agent:
"Test the [feature name] thoroughly with the testing subagent"
```

### 3. Download Your Code

**When ready to deploy:**

1. Use Emergent's file management tools
2. Download your complete project
3. Get all mobile app files locally

**Your project includes:**

* Expo app code
* FastAPI backend
* Configuration files
* Assets and resources

## Deploying to App Stores

### Overview: Using Expo EAS

**EAS (Expo Application Services)** handles building and submitting your app to stores.

**What EAS does:**

* Builds native app binaries (APK/AAB for Android, IPA for iOS)
* Submits apps to Google Play Store and Apple App Store
* Provides over-the-air updates
* All builds happen in the cloud (no Xcode or Android Studio needed!)

## Step-by-Step Deployment Guide

### Prerequisites

**What you'll need:**

<CardGroup cols={2}>
  <Card title="Expo Account" icon="user">
    Sign up at [expo.dev](https://expo.dev)

    Free tier: 30 builds/month

    Paid: More builds (\$29/month)
  </Card>

  <Card title="Developer Accounts" icon="mobile">
    **Google Play:** \$25 one-time

    **Apple App Store:** \$99/year

    (Only need the stores you're targeting)
  </Card>
</CardGroup>

### Step 1: Set Up EAS Locally

**After downloading your code from Emergent:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Navigate to your mobile app folder
cd your-mobile-app

# Install EAS CLI globally
npm install -g eas-cli

# Login to your Expo account
eas login

# Configure EAS for your project
eas build:configure
```

**`This creates eas.json:`**

```json theme={"theme":{"light":"github-light","dark":"dracula"}}
{
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {
      "android": {
        "buildType": "apk"
      }
    }
  }
}
```

### Step 2: Build for Android

**Build APK/AAB file:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Build production Android app
eas build --platform android --profile production

# EAS will ask:
# - Generate a new keystore? → Yes (first time)
# - App identifier? → com.yourname.appname

# Build starts on Expo's servers
# Takes 15-30 minutes
```

**What happens:**

1. Code uploaded to Expo servers
2. Native Android app compiled
3. Signed with your keystore
4. AAB file generated

**You'll get:**

* Download link for AAB file
* Build available in Expo dashboard

### Step 3: Build for iOS

**Build IPA file:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Build production iOS app
eas build --platform ios --profile production

# EAS will ask:
# - Bundle identifier? → com.yourname.appname
# - Use Apple credentials? → Yes

# Build starts on Expo's servers
# Takes 20-40 minutes
```

**Requirements:**

* Apple Developer account
* Agree to terms in App Store Connect

**You'll get:**

* Download link for IPA file
* Build available in Expo dashboard

<Note>
  **No Mac needed -** EAS builds iOS apps in the cloud. You don't need a Mac or Xcode.
</Note>

### Step 4: Submit to Google Play Store

#### Create App in Google Play Console

1. Go to [play.google.com/console](https://play.google.com/console)
2. Click **Create app**
3. Fill in details:
   * App name
   * Default language
   * App type (app or game)
   * Free or paid

#### Prepare Store Listing

**Required information:**

* App description (short and full)
* Screenshots (phone, tablet)
* Feature graphic
* App icon
* Privacy policy URL
* Content rating questionnaire

#### Submit with EAS

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Submit to Google Play Store
eas submit --platform android

# Provide when prompted:
# - Google Service Account JSON key
# - Track to submit to (internal, alpha, beta, production)
```

**Getting Service Account Key:**

1. Google Cloud Console → IAM & Admin → Service Accounts
2. Create service account
3. Grant "Service Account User" role
4. Download JSON key file

**Review process:**

* Usually 1-7 days
* May require changes
* Check Play Console for status

### Step 5: Submit to Apple App Store

#### Create App in App Store Connect

1. Go to [appstoreconnect.apple.com](https://appstoreconnect.apple.com)
2. Click **My Apps** → **+** → **New App**
3. Fill in details:
   * Platform (iOS)
   * App name
   * Primary language
   * Bundle ID
   * SKU (unique identifier)

#### Prepare App Store Listing

**Required information:**

* App description
* Keywords
* Screenshots (various iPhone sizes)
* App preview videos (optional)
* Privacy policy URL
* Age rating

#### Submit with EAS

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Submit to Apple App Store
eas submit --platform ios

# Provide when prompted:
# - Apple App Store Connect API Key
# - App Apple ID
```

**Getting API Key:**

1. App Store Connect → Users and Access → Keys
2. Generate new key with "App Manager" access
3. Download key file

**Review process:**

* Usually 1-3 days
* May be rejected (follow guidelines)
* Check App Store Connect for status

## App Store Requirements

### Google Play Store

<AccordionGroup>
  <Accordion title="Required Information">
    * App name and description
    * Screenshots (at least 2)
    * Feature graphic (1024x500)
    * High-res icon (512x512)
    * Privacy policy URL
    * Content rating
    * Target age group
  </Accordion>

  <Accordion title="Technical Requirements">
    * Target API level 33+ (Android 13)
    * AAB format (not APK for production)
    * 64-bit support
    * Proper permissions declared
    * Size limits (varies, generally under 150MB)
  </Accordion>

  <Accordion title="Privacy & Safety">
    * Data safety form completed
    * Privacy policy posted
    * Permissions justified
    * COPPA compliance (if targeting children)
  </Accordion>
</AccordionGroup>

### Apple App Store

<AccordionGroup>
  <Accordion title="Required Information">
    * App name and subtitle
    * Description (up to 4000 characters)
    * Keywords
    * Screenshots for all device sizes
    * App icon (1024x1024)
    * Privacy policy URL
    * Age rating
    * Copyright info
  </Accordion>

  <Accordion title="Technical Requirements">
    * iOS 13.0+ minimum
    * Valid provisioning profile
    * Proper app signing
    * Size limits (4GB max)
    * No crashes or bugs
  </Accordion>

  <Accordion title="App Review Guidelines">
    * Follow Apple's guidelines
    * No private APIs
    * Proper content rating
    * Clear app purpose
    * Functional app (no placeholders)
  </Accordion>
</AccordionGroup>

## Over-the-Air (OTA) Updates

**Update your app without resubmitting to stores!**

### What Can Be Updated

**Can Update:**

* JavaScript code
* React components
* Assets (images, fonts)
* App logic and UI

**Cannot Update:**

* Native modules
* app.json configuration
* Permissions
* Native code (Java/Kotlin/Swift)

### How to Push Updates

**After making changes:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Make your code changes
# Then push update:

eas update --branch production --message "Bug fixes and improvements"

# Or for specific platforms:
eas update --platform android --branch production
eas update --platform ios --branch production
```

**Users get updates:**

* Next time they open the app
* Automatically in the background
* No app store download needed

**Perfect for:**

* Bug fixes
* UI tweaks
* Feature updates
* Content changes

## Testing Your Mobile App

### During Development (On Emergent)

**Use preview and testing tools:**

```
Tell the agent:
"Test the mobile app thoroughly:
- All screens and navigation
- User authentication flow
- Data fetching and display
- Error handling
- Forms and validation

Use the frontend testing subagent."
```

You can also preview on mobile via the Expo Go app.

### After Download (Local Testing)

**Expo Go App (Quick Testing):**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Start development server
npx expo start

# Scan QR code with:
# - Expo Go app (iOS/Android)
# - Camera app (iOS)
```

**Benefits:**

* Instant testing on real device
* No build needed
* Fast iteration

**Limitations:**

* Some native modules won't work
* Not identical to production

**Development Build (Full Testing):**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Build development version
eas build --platform android --profile development
eas build --platform ios --profile development

# Install on device
# Test exactly like production
```

**Benefits:**

* Full native module support
* Identical to production
* Test everything

## Common Scenarios

### Scenario 1: Building First Mobile App

```
Tell Mobile Agent:

"I want to build a note-taking mobile app.

Features:
- User signup/login
- Create, edit, delete notes
- Organize notes with folders
- Search functionality
- Dark mode
- Offline support

Backend:
- FastAPI REST API
- MongoDB database
- JWT authentication

Please create this as an Expo app."
```

### Scenario 2: App with Camera Access

```
Tell Mobile Agent:

"Build a photo sharing mobile app.

Features:
- Take photos with camera
- Choose from gallery
- Add filters/effects
- Upload to server
- View feed of photos
- Like and comment

Include proper permissions for camera and photo library.

Please build with Expo."
```

### Scenario 3: Location-Based App

```
Tell Mobile Agent:

"Create a location tracking mobile app.

Features:
- Track user's current location
- Show on map
- Save favorite locations
- Get directions
- Location history
- Share location

Include location permissions.

Please build with Expo."
```

## Troubleshooting

### Build Failures

**Issue:** EAS build fails

**Solutions:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Check build logs
eas build:list

# View specific build
eas build:view [build-id]

# Common fixes:
# 1. Check app.json configuration
# 2. Verify dependencies are compatible
# 3. Check for native module issues
# 4. Review error messages carefully
```

### Submission Rejected

**Google Play:**

* Follow rejection reasons exactly
* Update app accordingly
* Resubmit

**Apple App Store:**

* Review rejection details
* Fix issues mentioned
* Reply to reviewer if needed
* Resubmit

### Updates Not Appearing

**Check:**

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# View published updates
eas update:list --branch production

# Check specific update
eas update:view [update-id]

# Republish if needed
eas update --branch production --message "Republish"
```

## EAS Pricing

### Free Tier

* **30 builds per month**
* Unlimited EAS Updates
* Community support

**Good for:**

* Development and testing
* Small projects
* Learning

### Production Plan

* **\$29/month**
* More builds
* Priority build queue
* Better for active development

**Good for:**

* Professional apps
* Multiple apps
* Frequent updates

### Enterprise

* **Custom pricing**
* Unlimited builds
* Dedicated support
* SLA guarantees

**Good for:**

* Large teams
* Mission-critical apps
* Many apps

## Best Practices

### Development

**Start simple:**

```
Build core features first
Test thoroughly
Add advanced features later
```

**Test on real devices:**

```
Use Expo Go during development
Build development builds for full testing
Test on both iOS and Android
```

**Use version control:**

```
Commit changes regularly
Use Git for version management
Tag releases
```

### Deployment

**Before submitting:**

* Tested all features thoroughly
* No console errors or warnings
* Proper app icons and splash screens
* Privacy policy in place
* Store listing prepared
* Screenshots captured
* Tested on multiple devices

**Build strategy:**

```
Development → Internal Testing → Beta → Production
```

**Update strategy:**

```
Use OTA updates for JavaScript changes
Rebuild for native changes
Test updates before pushing
```

### Maintenance

**Monitor your app:**

* Check crash reports
* Review user feedback
* Monitor performance
* Track analytics

**Update regularly:**

```
Bug fixes via OTA updates
Feature updates with app versions
Security patches promptly
```

## Resources

### Expo Documentation

* [Expo Docs](https://docs.expo.dev)
* [EAS Build](https://docs.expo.dev/build/introduction/)
* [EAS Submit](https://docs.expo.dev/submit/introduction/)
* [EAS Update](https://docs.expo.dev/eas-update/introduction/)

### App Store Guidelines

* [Google Play Policies](https://play.google.com/about/developer-content-policy/)
* [Apple App Store Guidelines](https://developer.apple.com/app-store/review/guidelines/)

### Emergent Support

* **Discord:** [discord.gg/VzKfwCXC4A](https://discord.gg/VzKfwCXC4A)
* **Email:** [support@emergent.sh](mailto:support@emergent.sh)

## Getting Help

### From Emergent

**For Mobile Agent issues:**

```
Contact Emergent support:
- Discord community
- Email support
- Describe your mobile app requirements
```

**For code/feature help:**

```
Tell the Mobile Agent:
"I need help with [specific issue in mobile app].
Current behavior: [describe]
Expected behavior: [describe]
Please debug and fix."
```

### From Expo

**For EAS issues:**

* Check [Expo Status](https://status.expo.dev)
* Review [Expo Forums](https://forums.expo.dev)
* Join [Expo Discord](https://chat.expo.dev)

**For build issues:**

* Review build logs carefully
* Check Expo documentation
* Search existing issues
* Ask in Expo community

## Quick Reference

### Essential Commands

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# Setup
npm install -g eas-cli
eas login
eas build:configure

# Building
eas build --platform android --profile production
eas build --platform ios --profile production
eas build --platform all --profile production

# Submitting
eas submit --platform android
eas submit --platform ios

# Updating
eas update --branch production --message "Description"

# Checking
eas build:list
eas update:list
```

### Development Workflow

```
1. Build with Mobile Agent on Emergent
   ↓
2. Test in Preview
   ↓
3. Download code locally
   ↓
4. Set up EAS
   ↓
5. Build with EAS
   ↓
6. Test builds on devices
   ↓
7. Submit to stores
   ↓
8. Wait for approval
   ↓
9. App goes live!
   ↓
10. Push updates with EAS Update
```

***

## Remember

**Mobile Agent requires paid subscription**

**Only Expo/React Native supported**

**EAS handles building and deployment**

**No Mac needed for iOS builds**

**OTA updates for JavaScript changes**

**Test thoroughly before submitting**

**Both stores require developer accounts**

**Review processes take 1-7 days**

<Info>
  **Getting started:** Build your app with Mobile Agent, download the code, then use EAS to deploy to app stores. The Mobile Agent handles the complex Expo setup for you!
</Info>

## Next Steps

<Steps>
  <Step title="Upgrade to Paid Plan">
    If on Free Tier, upgrade to access Mobile Agent
  </Step>

  <Step title="Build Your App">
    Use Mobile Agent to create your Expo app
  </Step>

  <Step title="Download Code">
    Get your complete mobile app code
  </Step>

  <Step title="Set Up EAS">
    Install EAS CLI and configure
  </Step>

  <Step title="Deploy">
    Build and submit to app stores!
  </Step>
</Steps>

**Have questions?** Contact Emergent support for help with mobile development!
