Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Feb 21, 2024

Debugging

Amplify Android v1 is deprecated as of June 1st, 2024. No new features or bug fixes will be added. Dependencies may become outdated and potentially introduce compatibility issues.

Please use the latest version (v2) of Amplify Library for Android to get started. Refer to the upgrade guide for instructions on upgrading your application to the latest version.

Amplify libraries should be used for all new cloud connected applications. If you are currently using the AWS Mobile SDK for Android, you can access the documentation here.

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.

Amplify Android Developer Menu

The developer menu is disabled in production app builds.

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/raw
mv app/src/main/res/raw/local-env-info.json app/src/main/res/raw/localenvinfo.json

If the amplify directory is not in your Android project folder, please follow the project setup instructions. The file local-env-info.json contains environment information that will be displayed on the developer menu.

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.

Shows how to simulate shaking the Android Emulator as mentioned above

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.