Inspecting elements and debug mode (to avoid timeout on appium server)

I have appium installed, and android studio (windows) . When launching a test, it’s running on Android Studio android emulator.

How do I inspect elements? Also when running a test script in debug mode, what must I do so that the appium server doesn’t timeout?