Use testing and debugging features from Gemini in Android Studio to fix bugs faster and release higher-quality apps.
Analyze crash reports
Use Gemini in Android Studio to analyze your App Quality Insights crash reports, generate insights, provide a crash summary, and (when possible) recommend next steps, including sample code and links to relevant documentation.
Generate all of this information by clicking Insights in the App Quality Insights tool window in Android Studio after you enable Gemini from View > Tool Windows > Gemini.
Generate unit test scenarios
When writing unit tests for your app, Gemini can suggest test scenarios using the context of the code you want to test. When generating unit test scenarios, Gemini includes detailed names and descriptions for your tests, so that you better understand the intention for each suggested test. You need to implement the body of each test yourself.
To generate unit test scenarios, do the following:
- Navigate to the class you want to generate unit test scenarios for.
- Right-click on the class and select Gemini > Unit test scenarios from the context menu.
- In the dialog that appears, select the methods of the class that you want to generate scenarios for, and set the destination package for the tests.
- Click OK.
- Confirm the destination directory for your tests and click OK.
- If the test class already exists, confirm whether you want Gemini to suggest updates to the existing file.
After Gemini processes the request, you should see either a new file with the suggested unit tests or a diff for you to accept recommended changes to an existing file.