---
title: Step 4. Running and testing the app
description: Start the Metro bundler, launch the app on Android or iOS, authenticate through a journey, view OAuth 2.0 tokens, and sign out.
component: orchsdks
page_id: orchsdks:journey:try-it-out/react-native/04_run_the_sample
canonical_url: https://developer.pingidentity.com/orchsdks/journey/try-it-out/react-native/04_run_the_sample.html
llms_txt: https://developer.pingidentity.com/orchsdks/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["PingOne Advanced Identity Cloud", "PingAM", "Journeys", "Setup &amp; Configuration", "Source Code", "Tutorial", "SDK", "React Native"]
section_ids:
  starting_the_metro_bundler: Starting the Metro bundler
  running_on_android: Running on Android
  running_on_ios: Running on iOS
  troubleshooting: Troubleshooting
  how_do_i_fix_failed_to_build_ios_project_xcodebuild_exited_with_error_code_70: "How do I fix \"Failed to build ios project. \"xcodebuild\" exited with error code '70'.\"?"
  authenticating_with_a_journey: Authenticating with a journey
  viewing_oauth_2_0_tokens: Viewing OAuth 2.0 tokens
  signing_out: Signing out
  next_steps: Next steps
---

# Step 4. Running and testing the app

[icon: circle-check, set=far]PingOne Advanced Identity Cloud [icon: circle-check, set=far]PingAM [icon: react, set=fab]React Native

* [Prepare](00_before-you-begin.html)

* [Download](01_download_samples.html)

* [Install](02_prepare-projects.html)

* [Configure](03_configure_sample.html)

* **Run**

In this step you build and run the sample app, then authenticate as a demo user using an authentication journey.

All commands should be run from the `PingSampleApp` directory unless otherwise specified.

## Starting the Metro bundler

Metro is the JavaScript bundler for React Native.

Start it from the `PingSampleApp` folder in a terminal window, and leave it running:

```shell
cd PingSampleApp
yarn start
```

## Running on Android

In a separate terminal window, make sure you are in the `PingSampleApp` folder, and run the sample app on an Android emulator or a connected device:

```shell
cd PingSampleApp
yarn android
```

## Running on iOS

In a separate terminal window, make sure you are in the `PingSampleApp` folder, and run the app on the iOS simulator:

```shell
cd PingSampleApp
yarn ios
```

Xcode compiles the native layer and launches the simulator automatically. The first build takes several minutes.

### Troubleshooting

#### How do I fix "Failed to build ios project. "xcodebuild" exited with error code '70'."?

This might be caused by the default simulator not being available as a destination for Xcode 26 from the command-line.

To work around this issue, close any open iPhone 17 simulators, and in the **Simulator** app, manually open an iPhone 15 or iPhone 16 simulator.

The sample app attempts to launch on a booted iOS device by default, but will start one if none are available. Leaving an iPhone 15 or 16 device running prevents the error code '70' issue in Xcode 26.

## Authenticating with a journey

After launching the app, follow these steps to run an authentication journey:

1. On the home screen, scroll to and tap **[icon: settings, set=material, size=inline] Configuration** under the **SETUP** section.

   1. On the **Configuration** page, select **Journey Test Config**, and then click the back arrow ([icon: arrow_back, set=material, size=inline])

      ![Android sample app showing the Configuration page with Journey Test Config selected](../../_images/sample-apps/react-native/android-react-native-select-config.png)Figure 1. Selecting Journey Test Config on the Configuration page

2. On the home screen, tap **[icon: map, set=material, size=inline] Journey Flow** under the **AUTHENTICATION** section.

   ![Android sample app home screen showing the Journey Flow option under the Authentication section](../../_images/sample-apps/react-native/android-react-native-journey-flow.png)Figure 2. Starting a Journey Flow from the home screen

3. On the Journey screen, enter the name of an authentication journey, for example `Login` or `sdkUsernamePasswordJourney`, and then tap **Start Journey**.

4. When prompted, sign in as your demo user:

   * **Username**: `demo`

   * **Password**: `Ch4ng3it!`

   |   |                                                                                                                                                                                                  |
   | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   |   | Depending on the journey you ran, you might see a screen with a **Logout** and a **Continue** button.If this page appears, click the **Continue** button to complete the authentication journey. |

   After successful authentication, the app displays user info:

   ![Android sample app showing user information after a successful authentication journey](../../_images/sample-apps/react-native/android-react-native-journey-user-info.png)Figure 3. User info displayed after successful authentication

## Viewing OAuth 2.0 tokens

1. From the home screen, tap **[icon: token, set=material, size=inline] Access Token** under the **USER MANAGEMENT** section.

   1. On the **Token** screen, select the **Journey** tab, and then tap **Access Token**.

      The screen displays the access token and OAuth 2.0 user info retrieved from the server:

      ![Android sample app showing the access token and OAuth 2.0 user info on the Journey tab of the Token screen](../../_images/sample-apps/react-native/android-react-native-access-token.png)Figure 4. Access token and OAuth 2.0 user info on the Token screen

## Signing out

* From the home screen, tap **[icon: logout, set=material, size=inline] Logout** under the **USER MANAGEMENT** section.

  The app revokes the tokens on the server and clears them from secure storage on the device.

## Next steps

You have successfully run the `PingSampleApp` and authenticated a user through a journey.

The app also provides screens to explore Device Management, OATH tokens, Push notifications, and more, all available from the home screen.

Try authenticating with a more complex authentication journey that includes MFA functionality such as device binding or OATH passcodes, then viewing and managing the registered authenticators in the **[icon: device_hub, set=material, size=inline] Device Management** page.
