Skip to content

Testing on iOS and Android

Brett Weissbart edited this page Jul 25, 2019 · 2 revisions

Testing on iOS

If you installed Xcode as part of the setup process, you have everything you need to test in an iOS simulator. Simply run ios and a simulator will automatically boot with the application.

Testing on Android

React Native cannot automatically start an Android emulator, so you'll need to do one of the following in order to test on Android:

Option 1: create and start an emulator

  1. Open Android Studio
  2. Click the AVD Manager button (top right menu)
  3. If you don't have any virtual devices set up, click Create Virtual Device and follow the wizard
  4. Select a virtual device and click Start to open the emulator
  5. You can then run PirateShip (see below) and it will launch on the selected emulator

Option 2: run on a physical device

  1. Connect an Android device to your computer via USB
  2. Open the Settings app
  3. Navigate to "About phone"
  4. Tap on the "Build number" item 10x in a row to enable developer mode
  5. Go back to the main Settings menu and select "Developer options"
  6. Verify that the "USB debugging" checkbox is enabled
  7. You may need to change your phone's USB mode from charging only to data transfer mode. Refer to your phone's documentation for more information.
  8. From your computer, run adb devices which will list all physical and emulator devices and their debugging status
    • If the device isn't displayed, either the phone isn't in developer mode, USB debugging mode is disabled, or the USB mode is set to charging only
    • If the device is listed as "unauthorized", USB debugging is disabled or you haven't given the current computer permission to access your device. Try tapping "Revoke USB debugging authorizations" and then turn USB debugging off then on again and you should get a prompt to allow debugging
    • If the device is listed as "device" debugging should be ready to go. Run android and the application will run on the connected device.