How to build and run your app on an emulator or device.
Run on a device:
- Connect the device to the computer using a cable.
- Enable developer mode on the device:
- Go to Settings → About Phone.
- Find the Build Number entry and tap it repeatedly until prompted to enter a password.
- After entering the password, developer mode will be enabled.
For Xiaomi devices: Settings → About Phone. Tap 5-7 times on MIUI Version until a window appears confirming that the developer mode is enabled.
- Return to the Android Studio.
- Open the terminal and enter the command: ./gradlew parseConfig.
- Press Cmd/Ctrl + Enter (repeat this command each time you make changes to the project, including when working with the app_config.json file).
- Press ▶ Run.
The application is built, and you can view it on the device. It is important that "app" is selected in Run Configurations, as shown in the screenshot below:
Run on an emulator:
- Go to Device Manager → Create Virtual Device.
- Add any of the suggested devices, making sure it has Android OS version 8 or higher.
- Launch Android Studio.
- Open the terminal and enter the command: ./gradlew parseConfig.
- Press Cmd/Ctrl + Enter (repeat this command each time you make changes to the project, including when working with the configuration file, to apply these changes to the build).
- Press ▶ Run.
The application is built, and you can view it on the emulator. It is important that "app" is selected in "Run Configurations," as shown in the screenshot below:
How to build a debug (test) or release (published to the store) build:
- Go to Build → Select Build Variant.
- Change debug to release or vice versa. By default, debug is used for all builds.s.
- Press "▶ Run."