Running on a Device
You can use this guide when you want to run the app on an Android emulator, iOS simulator, or physical device instead of in the browser.
For browser testing, see Running on Web.
Prerequisites
- Install dependencies in the React Native project folder:
apps/mobile/react-native/
- Complete the database migration and ensure the backend host is running.
- Set up an emulator or simulator if needed:
- Android: Android Studio Emulator guide or Setting Up Android Emulator Without Android Studio
- iOS (macOS): iOS Simulator guide
Using ABP Studio
Note: The MobileEmulator run profile is not included in the microservice template. Follow Manual Backend Configuration and the manual CLI steps below.
Cloudflare tunnel (manual CLI)
Microservice templates do not include tunnel.js or the tunnel:api script. Configure the backend using Manual Backend Configuration, or adapt the Cloudflare tunnel guide for your auth server and mobile gateway ports.
Manual CLI (without MobileEmulator profile)
- Configure the backend as described in Manual Backend Configuration.
- Open the
Environment.tsfile in the React Native folder and replace thelocalhostaddress in theapiUrlandissuerproperties with your local IP address:
Make sure that
issuermatches the running address of the.AuthServerproject, andapiUrlmatches the running address of the mobile gateway.
- Run
yarn start,yarn android, oryarn ios.
The React Native application was generated with Expo. Expo is a set of tools built around React Native to help you quickly start an app, and it includes many features.
You can start the application on an Android emulator, an iOS simulator, or a physical phone by scanning the QR code or by choosing the corresponding option in the Expo CLI.
Enter admin as the username and 1q2w3E* as the password to log in to the application.
Android Studio
- Start the emulator in Android Studio before running
yarn start,yarn android, ornpm start. - Press a in the Expo CLI to open on Android.
iOS Simulator
- Press i in the Expo CLI to open the iOS simulator (macOS only).