[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.3 Debugging the Application

In Android Studio (with the ToDo project open), ensure you have a valid build. If you will be testing on a virtual device be sure that the emulator is running. See section Using Virtual Devices for how to configure and run the virtual device.

Click the debug icon or go to Run → Debug ’app’, then in the “Select Deployment Target” window select the device under “Connected Devices”. If that section shows “<none>” then either the device is not running, not connected (by a USB cable if it’s a physical device), doesn’t have USB debugging enabled, or may have some other problem with it. When you click “OK” then Studio should install the current app build onto the device and launch it.

The “Android Monitor” panel may be used to view any log messages from the application or the Android system. Be sure the correct device is selected. When the application is started in debug mode, Android will wait for Android Studio’s debugger to connect before the application will run so that it can catch any startup errors. If the application crashes, check then panel for an exception error message which should show the point in the code where the error occurred.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 30, 2025 using texi2html 5.0.