Lately I’ve been experiencing the Android emulator being very slow. I’m using Intel HAXM but still it was behaving rather slow. One way obviously is to use a real device to test on. However I do not like to leave my editor and to move away from the code to be able to test a certain feature. These should be as close as possible to each other so that I can more easily test the things that I’m making.
So that was not an option. Perhaps it would be possible to use a utility to mirror the screen of a real device and perhaps even control the device from that mirrored screen? Turns out that this is easily possible, even with an open-source tool.
The tool is called scrcpy. Setting it up is as simple as executing these commands:
brew install scrcpy
scrcpyIf you have only one device connected.
scrcpy -s $serialwill do the trick.
This will open up a window where everything that you will do on the device will be mirrored and you can also interact with this as you would normally with an emulator.