Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 2.78 KB

simulator-setup.md

File metadata and controls

63 lines (41 loc) · 2.78 KB

Simulator Setup

Android

  1. Install Android Studio and through its interface download the Android SDK, Emulation tools (under platform SDK), and a simulator image through the Android Virtual Device manager (recommend using Pixel 4 with Android Platform API 29). Details below:

android-sdk

android-sdk-tools

avd-manager

avd-config

  1. Add the following to your .bashrc/.zshrc and reload your shell.
export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
  1. List all simulators and start one from your terminal:
$ emulator -list-avds
Pixel_4_API_29

# If you don't see any output from the command above, you haven't installed an Android image
# with Android Studio yet. Go back to step 1 and do that first.

$ emulator -avd Pixel_4_API_29
# An emulator should be started

You may have to run expo client:install:android to update the Expo Go client on the simualtor.

iOS

  1. Follow the docs to install the xcode CLI tools

  2. Launch the simulator by opening the Simulator.app file in Finder or Spotlight Search (if not already open)

  3. Choose a device to simulate (recommend using iPhone 12)

    ios-simulator

  4. Enable location mocking in the simulator by going to the menu bar and selecting Features > Location > City Run

Expo on Device

Besides running simulators on your development machine, Expo allows us to connect to phones on the local network and transmit bundles over air. This means you can use your phone as a testing device. It should be noted that using a physical device is necessary to test push notifications.

Below are the steps to enable this.

  1. Download the Expo Go app on the Apple/Android app store
  2. Sign up for an account (free) at https://expo.io/signup
  3. Open the app on your phone and sign in with your username and password from the previous step
    • The app might ask to allow permissions to the local network. You should enable this.
  4. To open the app you could either...
    • Use your camera app to read the QR code from the Metro bundler process (from yarn start). That should open the app in Expo Go directly.
    • Or, pull down on the list of projects and it should discover your machine. Of course, make sure you're on the same network (phone is using wifi) and make sure Metro/yarn start is running.
  5. Done! You should be able to use your phone as a test device.
    • Tip: To open the dev menu, you need to shake your phone physically to get it to appear.

You may have to run expo client:install:ios to update the Expo Go client on the simualtor.