- Install the Viro Media App from the AppStore on your iOS device, or from the Play Store for your Android device.
- The Testbed application looks for an
index.jsor 'app.js' file with a component named 'ViroSample'. If you use the react-viro script to create a project named 'ViroSample', then this file will be created for you.
- From the root of your project, run the command:
npm startto start the packager server.
- Launch the Viro Media App, open the left panel and tap "Enter Testbed"
- In your terminal, look for the ngrok URL that was created after running npm start (see image below for example), enter it into the text field on the Testbed screen, then press "Go"
Using IP vs ngrok: if you would like to use your local IP rather than ngrok
Find your local IP, enter it into the text field on the Testbed screen, then press "Go"
Your local IP address can be found by running the command
ifconfig in the terminal. Keep in mind you need your local* IP address, not your public one.
- Your ViroReact application should now load and run in the Testbed.
Note: If you're connecting via IP, then ensure your device and development machine are on the same network. We recommend using ngrok for better connectivity.
ViroReact supports React Native's reloading features, which enable fast iteration without recompiling. In order to take advantage of these features, open your application and, within any scene, shake the device until the debug menu appears.
Reloading on Android Devices
Android devices running Nougat OS (or higher) w/ Cardboard must set
App.jsfile for the debug menu to appear. Otherwise, you must use
adb shell input text rrto reload.
Android devices running Nougat OS (or higher) w/ Daydream must reload using ADB with the command:
adb shell input text rr
In this menu there are two options for reloading:
- Reload: manually force the scene to immediately reload from the package server.
Troubleshooting: Ensure your
react-viro version in your project's package.json file matches the version at the bottom of the Testbed screen.
- If they do not match, then you may need to either update your Viro Media App or downgrade your react-viro version in your package.json.
Updated less than a minute ago