Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.81k stars 10.47k forks source link

Chrome OS support #2156

Open RevGemmy opened 3 years ago

RevGemmy commented 3 years ago

it would be nice if there was a port to Chrome OS, yes i know linux exists on chromebooks, but it would be nice to have it on the chrome webstore to download since some chromebooks cant run linux

Lucaacer commented 3 years ago

I don't think scrcpy, in its current iteration, might work without a "real" linux OS, i.e. without crostini or crouton and the latter is the way to go if your device does not support crostini.

Chome OS, without crostini, supports web apps only, but the main requisite for scrcpy is adb which cannot run in a web app.

Maybe, in the future, someone will make a wasm (webassembly) port of adb... But so far a "real" linux is required to rub adb.

I must stand corrected, please have a look here https://www.xda-developers.com/webadb-run-adb-from-web-browser/

It works well in landscape mode only, btw.

smithj76 commented 3 years ago

scrcpy works but you have to update the Linux distribution to bullseye. Add deb http://deb.debian.org/debian bullseye main to /etc/apt/source.list . sudo apt update and scrcpy should be there. And I believe unless you enable development Android apps you can only connect to it via ADB connect local IP address. This program works better than of even Samsung flow on Windows.

Inderix commented 1 year ago

This appears to have worked at one point but as of now on Crostini running Debian Bullseye, scrcpy fails to create the window it seems.

This is what I get attempting to connect to a Samsung Galaxy A12, connected via wireless debugging. ChromeOS version 110.0.5421.0, Canary channel.

INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file push...0 skipped. 73.2 MB/s (34015 bytes in 0.000s)
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.
[server] INFO: Device: samsung SM-A125U (Android 12)ERROR: Could not retrieve device information

[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
        at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:75)
        at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:243)
        at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
        at com.genymobile.scrcpy.Server.main(Server.java:252)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:378)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
        ... 7 more
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
        at android.view.SurfaceControl$Transaction.setDisplaySurface(SurfaceControl.java:3371)
        at android.view.SurfaceControl.setDisplaySurface(SurfaceControl.java:2345)
        ... 9 more
WARN: Killing the server...
rom1v commented 1 year ago

Android 12 requires scrcpy >= 1.18. #2129