Debugging
When running a debug build of your app, you can access information, view logs, and file GitHub issues for Amplify directly from your application through the developer menu. By filing GitHub issues through the developer menu, critical information about the issue (device and environment information) is automatically added to the issue description, allowing Amplify team members to better assist you in resolving the issue.
Setup
To enable the developer menu, pass a custom configuration when configuring Amplify:
AmplifyConfiguration config = AmplifyConfiguration.builder(getApplicationContext()) .devMenuEnabled(true) .build();Amplify.configure(config, getApplicationContext());
val config = AmplifyConfiguration.builder(applicationContext) .devMenuEnabled(true) .build()Amplify.configure(config, applicationContext)
Next, run the following commands from the Android project directory to add a copy of the file ./amplify/.config/local-env-info.json
to the ./app/src/main/res/raw/
directory in your Android project and rename the copy to localenvinfo.json
:
cp amplify/.config/local-env-info.json app/src/main/res/rawmv app/src/main/res/raw/local-env-info.json app/src/main/res/raw/localenvinfo.json
Access and Usage
Shake the device to access the developer menu during a debug build of your app. An emulator can be shaken by selecting the more option (denoted by three dots) next to the emulator, navigating to the “Virtual Sensors” tab, clicking the “Move” button, and then moving the emulator shown within the “Virtual Sensors” tab back and forth a few times.
The developer menu contains the following:
- Environment Information - View versions of Amplify plugins used in your app and developer environment information.
- Device Information - View information about the device you are using to run your application.
- Logs - View and search the logs generated by Amplify loggers.
- File a GitHub Issue - After providing a description of your issue, an issue report is generated. The issue report contains your issue description, environment information, and device information. Within the developer menu, you can copy this issue report or directly file an issue on GitHub. The issue body will be pre-populated with the aforementioned information. When using the developer menu to file a GitHub issue, you will have an opportunity to review the issue information before filing the issue.