scrcpy: Mouse clicks do not work

I am using Xiaomi max 2 on macOS High Sierra 10.13.3

scrcpy v1.0

dependencies:
 - SDL 2.0.8
 - libavcodec 57.107.100
 - libavformat 57.83.100
 - libavutil 55.78.100

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 10
  • Comments: 79

Most upvoted comments

I find the reason of the issue,switch below option for obtain the permission of simulating Input

image

Thanks you @imkkdev I am using Xiaomi Mi11t Lite MIUI13/ Android 12 Phone, I can confirm it works after set the USB debug security settings and reboot, reboot is must!

@izayl Thank you very much! I added a question in the FAQ.

I find the reason of the issue,switch below option for obtain the permission of simulating Input

image

on XiaoMI Phone ,also need to reboot

why my android OPPO R15 no USB debugging(Security settings) option? so I cannot click my simulating screen .

In MIUI you are locked behind Mi Account link in order to enable ADBinput for keyboard and mouse. To bypass that (with root):

  1. Enable USB debugging
  2. Run any terminal as root
  3. setprop persist.security.adbinput 1
  4. That’s all, nothing else is required

I dont believe root-less solution is possible because MIUI permission service will block any user-app trying to do the same.

Solved, enable the permission of simulating Input work for me

Thanks all

On Android 14, use the latest version (v2.1.1 currently)

Everyone using a Xiaomi device -

@Mixterix-AL @ahmedsallam544

There is a way to enable keyboard input that is much easier than rooting your device, but you might be adverse to this for privacy reasons.

Others have discussed rooting your device, which, in my opinion, unless you really want root for other reasons, is probably overkill, and likely exposes your device to more threat vectors & vulnerabilities.

Easy fix - Do as they say & sign into your Mi account

The simple solution is to do what your manufacturer is telling you - “Sign in with your Mi account”.

Personally, I find the constraint odd - If I’m activating devtools & running adb, chances are I have a good idea of whatever it is I want to do, and I’ve already dismissed one or two warning dialogues already- but, personally, I take it on good faith that the manufacturer is trying to protect me from myself.

It’s odd, however, since this is maybe the only setting I’ve encountered that’s locked behind a Xiaomi account.

Pros and cons for using a Mi account instead of rooting

I don’t think anyone in this thread has explained why they are reluctant to follow the “easy” fix, and make an account

  • ✔️It’s fairly convenient to make a Mi Account
    • Mi Accounts support SSO via Google + Facebook, so you probably won’t even need to manage another credential.
    • Chances are you’re already logged into Google
  • ❓ Once you sign into your Mi account, and enable the setting, you can immediately sign back out and the setting remains active
  • ✔️ rooting may expose your device to security vulnerabilities & exploits. I haven’t looked into the state of this any time recently, but generally speaking, this holds true.
  • ❌⚠️ Xiaomi is beholden to the Chinese state government, who do have a vested interest in knowing as much as possible about as many people possible. It’s not an exaggeration to say they comprise one of the 3 largest threat actors in the world (The other two are the USA & Russia)
    • ⚠️ Mi Account’s privacy policy acknowledges this explcitly, in terms that are fairly broad image
      • 1.2 You are fully informed that we may collect and use personal information without your consent if:
        • 1.2.1 The personal information is vital to national security and defense;
    • ❌⚠️ Personally, I can’t reason with what the Chinese government considers “Vital to national security and defense”.
    • ❌ I’m also unsure of the constraints of “we may collect […] personal information”.
      • ❓ There is certain personal information explicitly discussed in the terms of the agreement, but the terminology of “collect” is broad & I’m unclear on the extent of this.

All this being said, your mileage may vary. You’re essentially making a series of Security/Convenience tradeoffs in activating the settings that allow scrcpy to function.

  • You activate adb for convenience of screen mirrroring at the cost of security.
  • You activate input simulation & permission interaction via adb for the convenience of keyboard input at the cost of security
    • To accomplish this you choose to root your phone (opening it to potential vulnerabilities), or give some amount of data to Xiaomi, at the cost of privacy.

Personally, I signed into a Mi account, activated the setting, and signed out of the account again & everything seems to be working just fine. There was no consent screen when I used Google’s SSO, so it appears that I may have already made an account in the past (I don’t remember).

I’m not clear on how much data was collected from me, what of that data is retained

@vajra108 Thank you, I just mentioned it in the doc: 21df2c240e544b1c1eba7775e1474c1c772be04b

Thanks you @imkkdev I am using Xiaomi Mi11t Lite MIUI13/ Android 12 Phone, I can confirm it works after set the USB debug security settings and reboot, reboot is must!

omg so much time lost because I didn’t reboot, thank you!

Thanks for the tip, I’ll just add when I tried to turn it on, they asked me to log into my mi community account. After that everything worked.

Personally, I signed into a Mi account, activated the setting, and signed out of the account again & everything seems to be working just fine.

Cant un-upload all the personal data they already fetched from your phone on the sign-up process.

I find the reason of the issue,switch below option for obtain the permission of simulating Input

image

thanks this works for me!

the security options too

Then it should work. What’s the output in the console?

Xiaomi Mi 6 has the same issue