How to record screen with Android Studio

I connect my phone to Android Studio and code. I want to record my phone screen. I saw this but that button is disabled in my Android Studio. I can capture screens but can't record. Can someone help me with this?

UPDATE

enter image description here

This is how it is there in my Android studio. The button is disabled


Now you can also record video from Android emulator to follow below option:

  • Select more more option option
  • Then select Record screen record screen option.

Check below screenshot:

Record android emulator screen


Go to your menu

  • View -> Tool Windows -> Android

You will find the record icon at the bottom left corner.

enter image description here

If you are using an AVD, make sure "Use host GPU" is disabled.

To take a video recording of your app:

  • Start your app as described in Run your App in Debug Mode.
  • Click Android to open the Android DDMS tool window.
  • Click Screen Record on the left side of the Android DDMS tool window.
  • Click Start Recording.
  • Interact with your app.
  • Click Stop Recording.
  • Enter a file name for the recording and click OK.

Source: https://developer.android.com/tools/debugging/ddms.html