
Scrcpy – An app to display and control Android devices - rom1v
https://blog.rom1v.com/2018/03/introducing-scrcpy/
======
mikeymop
This is an example of one of those applications that work so well, consists of
simple parts, and leverages these simple tools very cleverly.

It's a solution that I think 'why didn't I write this?'

Very awesome work rom1v, and very much appreciate you explaining your usage of
adb screenfetch and how you are able to arbitrarily run java code from /tmp.
This opened up an entire new world for me.

------
thatcherc
This seems pretty neat. What is the purpose of such an app though? Is it
intended for use by Android developers? I don't see what I'd use it for but
I'm interested in how people use the app.

~~~
tyingq
Would be neat to launch a SaaS service with it that let people test their apps
on various real phones.

Or have "real world device" testing in your CI/CD pipeline.

Or to automate something else that's only available via an android app.

~~~
rekwah
These exist.

* [https://aws.amazon.com/device-farm/](https://aws.amazon.com/device-farm/)

* [https://www.xamarin.com/test-cloud](https://www.xamarin.com/test-cloud)

* [https://bitbar.com/testing/](https://bitbar.com/testing/)

* [https://saucelabs.com/devices](https://saucelabs.com/devices)

~~~
Aissen
Add Google's: [https://firebase.google.com/docs/test-
lab/](https://firebase.google.com/docs/test-lab/)

And Geny's:
[https://www.genymotion.com/cloud/](https://www.genymotion.com/cloud/) (albeit
a bit different)

~~~
rom1v
Note that Genymobile/Genymotion is the company which open sources scrcpy ;-)

~~~
Aissen
I know, which is why I couldn't forget it :-)

------
pabl0rg
This opens up the possibility of making something akin to niffy [1], which
offers a sane/easy way to automate UI testing. Unfortunately, in the case of
Android apps you wouldn't have css selectors to simplify simulation of clicks
on specific elements.

1: [https://github.com/segmentio/niffy](https://github.com/segmentio/niffy)

~~~
rom1v
> Unfortunately, in the case of Android apps you wouldn't have css selectors
> to simplify simulation of clicks on specific elements.

There is UIAutomator, you can select components based on text, class, index,
etc. [https://developer.android.com/training/testing/ui-
automator....](https://developer.android.com/training/testing/ui-
automator.html)

We use it to automate actions to configure Android devices (when there is no
better way).

------
felipebueno
Hey, thank you for such an useful tool! :)

I'm an Android dev currently working on a team using NativeScript. My
coworkers' latops have only 4GB RAM and they are unable to use an AVD for
development. From now we are going to use scrpy :)

~~~
titanomachy
I have 16GB and I can barely use AVD, it's still laggy and terrible compared
to the iOS simulator.

EDIT: yes, I do have hardware acceleration enabled.

------
asmosoinio
Awesome tool, and a very good write-up! Wish I was still actively developing
for Android, this would be very useful.

This link should be a "Show HN"? I.e. it is about a tool you wrote.

~~~
rom1v
In Show HN rules:
[https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)

> Blog posts […] can't be Show HNs.

~~~
Raphmedia
Could simply link to their github
[https://github.com/Genymobile/scrcpy/](https://github.com/Genymobile/scrcpy/)

------
incidentnormal
Very clever, and nice writeup! A few years ago I wrote a bunch of bash scripts
to control my phone over adb (found it useful to script certain things and
write messages etc. Before things like WhatsApp had a Web client). This has
taken that concept to its most elegant formulation! Well done.

------
foobaw
This is amazing - something that the Android team should definitely have
supported already..

Great work!

------
shimo5037
Looks great. It certainly has become much easier to build such apps on modern
Android :)

For something a bit more old school, I’d like to insert a shameless plug here
that we open sourced something similar several years ago. It’s focused on the
enterprise side, so setting it up is unfortunately quite a bit more involved.
Screen rendering is obviously far less advanced as well, though still decent
enough. It’s compatible with (almost) all Android versions since 2.3 which has
its own fun challenges!

Anyway, great project with a modern take!

[https://github.com/openstf/stf](https://github.com/openstf/stf)

------
Abishek_Muthian
AFAIK, till now the only alternative for the features mentioned in OP was
Vysor by clockworkmod which is a monthly paid app. I had to subscribe it for
occasional demos, I'll be happy if Scrcpy fills in the role.

~~~
voltagex_
>$2.50/mo, $10/yr, or $40/lifetime. Purchase available in app.

------
defied
Very nice! We’d be interested in adding VNC support so that we can control
Android devices remotely via VNC.

------
jra101
This is awesome, worked perfectly.

Only downside is if you have swipe to unlock, I couldn't actually get the
swipe up to trigger the password input screen.

~~~
nix0n
I had this problem with another Android-on-PC app but it turns out I just
wasn't click-and-dragging fast enough.

~~~
nickphx
swipe to unlock works for me too.. great app

------
tenryuu
Been wanting an application like this for quite a long time, no wireless, no
3rd parties, just me, my usb and not requiring java :)

------
math0ne
Awesome, I've been using Vysor for this but it def has issues the least of
which is the ads, so I can't wait to try this!

------
sengork
MyPhoneExplorer and Samsung SideSync on Windows/macOS had this for a few years
now. Glad to see an application for Linux now.

------
rom1v
It now works wirelessly: [https://www.genymotion.com/blog/open-source-project-
scrcpy-n...](https://www.genymotion.com/blog/open-source-project-scrcpy-now-
works-wirelessly/) ;)

------
ASinclair
Vysor [1] has been around for a while. Does this improve upon the concept?

[1] [https://www.vysor.io/](https://www.vysor.io/)

~~~
laveur
Its kind of the same thing, Vysor has ads in it though and isn't open source.
So this seems like an improvement in general as it doesn't have ads and its
open sourced.

------
mohitmun
You can also control it wirelessly using adb tcp mode.

Run adb tcpip 5555 and connect it using adb connect command

~~~
rom1v
Actually, it won't work with the current version because of an adb bug ("adb
reverse" does not work over "adb connect"):
[https://issuetracker.google.com/issues/37066218](https://issuetracker.google.com/issues/37066218)

The solution would be to change the direction of the connection, and use "adb
forward", but then scrcpy would try to connect before the server is started,
so it would need to retry until connected (and the error would not be noticed
on connect, but on first read, due to the tunnel).

Working over "adb connect" would be good, though.

------
darepublic
Rather than control with mouse and keyboard I want to control the android
purely with voice.

------
post_break
I could see someone taking a bunch of android devices and using this to farm
stuff.

------
p47r1ck7541
This is a really nice tool for the development of headless Android device.

------
brokenmachine
Great info on how it all works. Thanks for that!

------
ww520
Is there X Windows support in Android?

------
pasbesoin
Thank you

------
tinhangliu
Amazing job! Congrats :)

------
alinspired
thanks for sharing - this can replace airdroid for me

------
rahulrav
This is amazing.

