mac-device-connect-daemon icon indicating copy to clipboard operation
mac-device-connect-daemon copied to clipboard

What about all usb devices

Open rsanjuan87 opened this issue 3 years ago • 3 comments

Hi, nice work I love it I have done with my cell phone to start 'scrcpy' app but I want to do it with all usb devices? like on Windows conecting usb devices, plays a sound I have tried with no vendor and/or product section, with a empty values but it's like it need those values to work

rsanjuan87 avatar May 09 '21 01:05 rsanjuan87

I would like this function as well. I can write a script that loops until change, but this is far more efficient.

applebit924 avatar Jan 27 '22 20:01 applebit924

The more I read the other issues thread the more I am thinking my method would be more ideal: I want to detect changes as a whole: connects and disconnects and take action. I simply wish there was an action based event (such as this) rather than a timed based method (my loop). It would be gold!

My method at the moment for comparing is to execute (shell):

ioreg -p IOUSB -w0; ioreg -p IOPCI -w0

Either to set the above command as a variable or write to a temporary file, then compare to last. If there is a difference, then device changes have occured on PCI (Thunderbolt) and/or USB.

FYI: More verbose info on devices:

ioreg -p IOUSB -l -w0 ioreg -p IOPCI -l -w0

applebit924 avatar Jan 27 '22 20:01 applebit924