Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 71 ยท Getting Started

Setting Up with Expo

Create a React Native app with create-expo-app, run it in Expo Go, a simulator or a real phone, understand development builds and tour the project folder.

Setting up a native-app toolchain used to be the hardest part of mobile development. With Expo it takes a few commands: install Node, create a project, start the development server and scan a QR code with your phone. This lesson walks through that path, explains the three ways to run your app (Expo Go, a development build and a simulator or emulator), and tours the files you get.

Read-only commands. The terminal commands below run on your own computer, so they are shown as plain code blocks. The runnable example at the end is a stand-in that turns a component tree into HTML so you can see what your code describes.

What you need

  • Node.js (a current LTS release) and npm. Check with node --version.
  • A code editor. Visual Studio Code with the TypeScript support it ships with is a common choice.
  • A phone or a simulator. The quickest path is the free Expo Go app on your own iOS or Android phone. For a simulator you need Xcode (macOS only) for iOS, or Android Studio for an Android emulator.
  • A phone and your computer on the same Wi-Fi network when you test on a real device.

You do not need Xcode or Android Studio to start if you test on your phone with Expo Go.

Create the project

Terminal
npx create-expo-app@latest my-first-app
cd my-first-app
npx expo start

create-expo-app downloads a template, installs the dependencies and prepares a TypeScript project that uses Expo Router. npx expo start launches the Metro development server, which bundles your JavaScript and serves it to the app. The terminal prints a QR code and a short menu of keys:

Key Action
i Open in the iOS simulator (macOS)
a Open in an Android emulator or a connected device
w Open the web version in a browser
r Reload the app
j Open the debugger
? Show all commands

Scan the QR code with the camera app (iOS) or the Expo Go app (Android) and your project opens on the phone. Edit a file, save, and the screen updates in under a second thanks to Fast Refresh.

Three ways to run your app

Expo Go A ready-made app on your phone. Scan and go.
Development build Your own app binary, with your native modules.
Simulator or emulator A virtual phone on your computer.

Start with Expo Go, graduate to a development build when you need more.

1 / 2

Expo Go versus a development build

Expo Go is a prebuilt app from the store that already contains a fixed set of native modules. Your project's JavaScript is loaded into it. That makes starting instant, but it has a limit: you can only use native code that is already inside Expo Go. A library with its own native code that is not included will fail to load.

A development build is your own copy of the app, compiled with exactly the native modules your project uses, plus a development menu. You create it once (locally with npx expo run:ios or npx expo run:android, or in the cloud with EAS Build) and then keep using the same Metro workflow. You need one when you add a third-party native library, change native configuration, or test features such as push notifications that Expo Go does not fully support.

A simple rule: begin with Expo Go; switch to a development build the first time Expo Go cannot run something you need.

Simulators, emulators and real phones

Option Good for Cost
iOS Simulator Quick iPhone/iPad checks, different screen sizes Free, needs a Mac with Xcode
Android Emulator Android versions and sizes without a device Free, needs Android Studio and a few GB of disk
Real phone Touch feel, camera, sensors, performance, notifications Your own device

Simulators are convenient but never a full substitute. Performance, gestures, keyboards and sensors behave differently on real hardware. Test on a real phone before you ship.

A tour of the new project

TEXT
my-first-app/
  app/              screens and layouts (Expo Router)
    _layout.tsx     root layout
    index.tsx       the home screen
  assets/           images and fonts
  components/       reusable components
  app.json          app name, icons, platform settings
  package.json      dependencies and scripts
  tsconfig.json     TypeScript settings

The exact template changes between Expo releases, and a fresh project may include extra demo screens. A script such as npm run reset-project clears the demo and leaves an empty app/ folder with one screen. The key ideas stay the same: app/ holds your screens, each file there is a route, and app.json describes the app to the build tools. The next lesson, Project Structure and App Config, explores these files in depth.

Your first screen is just a React component:

TSX
import { Text, View } from 'react-native';

export default function Index() {
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text>Edit app/index.tsx to change this screen.</Text>
    </View>
  );
}

From component tree to what you see

Before you run anything, it helps to see that your JSX is just a tree. The stand-in below defines that tree as plain data, prints it as an indented outline (like React DevTools would) and renders it to HTML.

Component tree to HTML

The outline shows nesting, the framed box shows the result. A real device does the same job, except the final step creates native views instead of HTML elements.

Choosing how to run: a helper

This stand-in encodes the rule from earlier. Change the checklist to see which option it recommends.

Expo Go or development build?

Common setup problems

  • The phone cannot connect. Make sure both devices share a Wi-Fi network, turn off VPNs, and try npx expo start --tunnel if a firewall blocks the local network.
  • Stale cache. If the bundle looks outdated, restart with npx expo start --clear.
  • Version mismatch. Expo Go supports specific SDK versions. Update the app or the project so they match.
  • Wrong Node version. Switch to a current LTS release before installing.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which command creates a new Expo project?

    create-expo-app downloads a project template and installs dependencies. npx expo start then launches the development server.
  2. 2. What is the main limitation of Expo Go?

    Expo Go ships with a fixed set of native modules. For anything else you need a development build that includes your own native code.
  3. 3. What does the Metro server do while you develop?

    Metro is the JavaScript bundler and dev server. Fast Refresh updates arrive through it.
  4. 4. Why should you also test on a real phone, not only a simulator?

    Simulators are handy, but they cannot reproduce real-device performance, gestures, camera or sensors.

Summary

  • You need Node, an editor and either the Expo Go app or a simulator or emulator.
  • npx create-expo-app@latest creates the project; npx expo start runs the Metro dev server with a QR code.
  • Expo Go is the fastest start but limited to included native modules; a development build includes your own native code.
  • A new project has app/ for screens, assets/, app.json and package.json.
  • Your JSX is a tree that a renderer turns into native views; here a stand-in turns it into HTML.

Next, look inside the configuration files in Project Structure and App Config.