How to record screen with Android Studio

92,796

Solution 1

Maybe your device does not support the screen recorder, there are many devices which does not support screen recorder thus this is device issue. If you want to record your app screen then simply run the app on android emulator or on genymotion and start your desktop screen recorder and adjust the desktop screen to fit emulator. There are many screen recorder for PC but i prefer cam studio 8. Thanks

Solution 2

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

Solution 3

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

Solution 4

In newer versions of Android Studio it requires an external Android phone to record screen from preferably with a resolution of at least 720p. Since the internal runs on the virtual memory it can't be recorded and is therefore disabled as it can't both record and run emulator at same time. I'm running Android Studio 2.3.2 which is the latest and the one I experienced this on. But when I closed the emulator and connected my HTC One M9 it automatically enabled recording button to record the phone instead of the emulated device.
Check the images below and the difference between them in the red circles:

First image, emulated device on the computer: Emulated device not able to make a screen recording

Second image, personal device connected to computer: Personal device connected and ready to be recorded from Android Studio

Solution 5

You can record videos from the command line into an .mp4 file:

adb shell screenrecord /sdcard/video.mp4

When you are done recording, press Ctrl+C.

Then you can copy the file to your computer (current folder)

adb pull /sdcard/video.mp4

If you want you can delete the file from the sdcard

adb shell rm /sdcard/video.mp4

Share:
92,796
harsh
Author by

harsh

Updated on July 08, 2022

Comments

  • harsh
    harsh almost 2 years

    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

  • Paul
    Paul over 8 years
    "You will find the record icon". Yes, I found it, but it is inactive.
  • Machado
    Machado over 8 years
    Have you tried debugging with another device? There any many devices that doesn't support screen recording after all.
  • IgorGanapolsky
    IgorGanapolsky over 8 years
    You are assuming that record button is present for Emulator launches.
  • Machado
    Machado over 8 years
    > If you are using an AVD, make sure "Use host GPU" is disabled.
  • Admin
    Admin over 8 years
    How to enable circle where user clicked on screen?
  • ssimm
    ssimm over 8 years
    For a Genymotion API 16 (Samsung Galaxy S2) the button was disabled for me. But for an API 19 emulator (Google Nexus 4) the button is enabled.
  • ssimm
    ssimm over 8 years
    For example... I use Genymotion and on once API16 devide the video recording button was disabled and on another one (API 19) is was enabled.
  • Machado
    Machado over 8 years
    I'm not sure if it is somehow linked with the API. But yes, there are devices that doesn't support screen recording.
  • aProperFox
    aProperFox almost 8 years
    To my understanding, "Use host GPU" is no longer a setting for creating an AVD and now you must either choose a Graphics emulated performance dropdown option of "Hardware" or "Software". In this case, "Software" should let you screen record but it runs super slow.
  • Ove Stoerholt
    Ove Stoerholt over 7 years
    Sometimes it also helps to restart Android Studio.
  • Hakanai
    Hakanai over 7 years
    I don't have to clip Stop Recording, because it gets immediately automatically clicked by the application, and I get an empty file for my video.
  • Machado
    Machado over 7 years
    @Trejkaz what's your device and your Studio version?
  • Hakanai
    Hakanai over 7 years
    @Machado Huawei Watch, Android Studio 2.2.3, but was happening on the previous version I had installed from a whole year earlier too.
  • Daniel Reina
    Daniel Reina over 7 years
    For those of you who have the icon disabled/inactive, try by debugging your app first, not just running it. The debugging icon is shown in my answer here: stackoverflow.com/a/37205692/5452969
  • Nahid
    Nahid about 7 years
    How do I disable "Use host GPU" ?
  • arekolek
    arekolek about 7 years
    To add to this answer, Prerequisites to Android Monitor say that the Video Capture tool works with a hardware device only, not the emulator.
  • RobinM
    RobinM over 6 years
    haha.. so simple! I ran into this issue as I was developing with 2 devices both were the same brand and similar version. When I selected the correct one suddenly the button was no longer disabled.. sigh! yep, face + palm moment :)
  • Maximilien Belinga
    Maximilien Belinga about 6 years
    Please can you show me how you setup that AVD. Basically all the AVD I launch doesn't have such feature. Maybe you do something special. Thanks again, I'll upvote, just in case.
  • Anbuselvan Rocky
    Anbuselvan Rocky almost 3 years
    Doing this will show everything, (mouse cursor, which I don't want to see it in my record.)
  • Abed
    Abed over 2 years
    can't record audio in this method