Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect incompatible Android versoin (API < 21) #277

Open
isotopeneo opened this issue Sep 26, 2018 · 3 comments
Open

Detect incompatible Android versoin (API < 21) #277

isotopeneo opened this issue Sep 26, 2018 · 3 comments

Comments

@isotopeneo
Copy link

isotopeneo commented Sep 26, 2018

Initial title: Segmentation fault when trying scrcpy on Kindles

/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.8 MB/s (17874 bytes in 0.010s)
error: closed
2018-09-26 01:12:43.306 scrcpy[2646:20517898] ERROR: "adb reverse" returned with value 1
2018-09-26 01:12:43.306 scrcpy[2646:20517898] WARN: 'adb reverse' failed, fallback to 'adb forward'
Segmentation fault

Model: Kindle Fire HDX 8.9 (3rd generation)

@isotopeneo isotopeneo changed the title Segmentation fault when trying to scrcpy use on Kindles Sep 26, 2018
@isotopeneo isotopeneo changed the title Segmentation fault when trying scrcpy use on Kindles Sep 26, 2018
@rom1v
Copy link
Collaborator

rom1v commented Sep 26, 2018

scrcpy requires Android >= 5.

The segfault occurs on the device.

See #174.

@eku
Copy link

eku commented Sep 26, 2018

@rom1v Since this issue occurs again and again, is it possible that the CLI program tests the Android version and gives a hint?

@rom1v
Copy link
Collaborator

rom1v commented Sep 26, 2018

The version could be easily detected on the server-side, unfortunately the crash occurs before the server code is actually executed.

It is possible to check on the client with adb shell getprop ro.build.version.release. I didn't want to do that because I thought getprop was written in Java (like settings), which would require to exec app_process (which would delay the start of the client by 500ms or 1s). But in fact, it seems it's native, and fast enough:

$ time adb shell getprop ro.build.version.release
4.3

real	0m0,028s
user	0m0,000s
sys	0m0,005s

Since adb reverse exists only since 5.0, we can add a check only if adb reverse fails (before adb forward fallback).

@rom1v rom1v changed the title Segmentation fault when trying scrcpy on Kindles Sep 26, 2018
@rom1v rom1v added the android4 label Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants