[android-emulator] Android emulator shows nothing except black screen and adb devices shows "device offline"

Had this issue on my Nexus 7,Nexus 10 & Pixel as well that means in all the emulators.

After days of struggling with this issue, I figured it out finally. Well, there are a lot of answers above which may work or may not for you because their configuration may vary slightly than yours.

I'll tell you my solution:

When creating those emulators, I checked Hardware - GLES 2.0 in Graphics for better performance. And for me it was the issue.

If you've done the same then,

Go to AVD Manager -> Select your emulator -> Click on Edit configuration (in Actions column marked as pencil) -> in Emulated performance - Graphics -> Select Software - GLES 2.0.

Then click on Show Advanced Settings -> Set none for both Front and Back camera and hit Finish.

Now select your emulator in AVD Manager and click on Dropdown arrow in Actions column -> select Cold Boot Now.

And yay you're ready to go