-
-
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
Using scrcpy with Show Touches switch (-t, --show-touches) throws exceptions #2788
Comments
Is your device rooted? Try |
My device is not rooted.
|
If you enable it manually like this:
Does it work? |
Yep, running that command does enable the show touches setting in developer options. And of course shows touches |
OK, it seems there is a change in Android 12 (like #2671). I will try on a Pixel 4a with Android 12 as soon as I can. |
OK, I can reproduce on a Pixel 4a 🎉 I think I will need to use another way to set system settings, maybe by just calling the executable I already did the latter some time ago (before implementing the It will require some work, but this is now my priority task for the next release :) |
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. |
Tested out the newest files, it works! No errors in the console, and touches are shown on screen.
Thanks for taking care of this issue! |
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
On my recently updated to Android 12 Pixel 4a, the switch to show touches (-t, --show-touches) now throws an error. Also tried manually changing the setting in phone developer options and then running scrcpy with the switch. Still throws the same error (though touches are shown).
This issue was present in the last version of scrcpy as well as the current version (1.20). Also worked fine IIRC on Android 11.
Looks like it might be a similar issue to #2671
Console output:
The text was updated successfully, but these errors were encountered: