-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Fails on android 12 when use --stay-awake #2671
Comments
Is your device rooted? For some reasons, some features do not work if scrcpy is run as root on the device. |
It seems to pass when I set USER_ID:2000
|
Where do you set this? |
Not root |
I try modified the source code and ran it locally |
I think I know what's going on here. Maybe it really has something to do with android system permissions. |
What change did you do exactly? |
I probably realized the problem (my system MIUI is dev channel), but some attempt ended in failure. Maybe xiaomi did something to cause it. |
I'm having the same issue on a Linux computer using a Pixel phone running Android 12. ADB connects but scrcpy fails to start: java.lang.IllegalArgumentException: displayToken must not be null |
@randodude123 You must use scrcpy >= 1.18 (the latest is 1.19). |
It works, I forgot to update from git. @rom1v |
I updated to android 12 and that message started appearing too. I can confirm the stack is only displayed when using the
|
Before Android 8, executing the "settings" command from a shell was very slow (~1 second), because it spawned a new app_process to execute Java code. Therefore, to access settings without performance issues, scrcpy used private APIs to read from and write to settings. However, since Android 12, this is not possible anymore, due to permissions changes. To make it work again, execute the "settings" command on Android 12 (or on previous version if the other method failed). This method is faster than before Android 8 (~100ms). Fixes #2671 <#2671> Fixes #2788 <#2788>
Please test #2802. |
This is working, thanks @rom1v 🎉
|
Before Android 8, executing the "settings" command from a shell was very slow (~1 second), because it spawned a new app_process to execute Java code. Therefore, to access settings without performance issues, scrcpy used private APIs to read from and write to settings. However, since Android 12, this is not possible anymore, due to permissions changes. To make it work again, execute the "settings" command on Android 12 (or on previous version if the other method failed). This method is faster than before Android 8 (~100ms). Fixes #2671 <#2671> Fixes #2788 <#2788> PR #2802 <#2802>
👍 Fixed by #2802. |
Environment
Describe the bug
run: scrcpy --stay-awake
The text was updated successfully, but these errors were encountered: