jakewharton / adb-event-mirror Goto Github PK
View Code? Open in Web Editor NEWMirror the touch/key/button events of one device onto one or more other devices in real-time
License: Apache License 2.0
Mirror the touch/key/button events of one device onto one or more other devices in real-time
License: Apache License 2.0
Applies to all secondary devices.
Open questions:
Being able to record touch events for replaying them later would be great for situations when the same device needs to be used. Not sure if it's actually possible to do this in the current setup.
Used command in the readme to run on emulators, however it did not forward the touch events.
Command Used
adb -s emulator-5554 shell getevent | ./adb-event-mirror.main.kts emulator-5556 --debug
After trying out the command :
adb -s 192.168.43.154:5555 shell getevent | adb-event-mirror.main.kts 58H3Y18831023558
Getting the following error
could not get driver version for /dev/input/mice, Not a typewriter The system cannot execute the specified program.
After trying adb -s 192.168.43.154:5555 shell getevent -p
command got following response :
name: "sdm845-tavil-snd-card Button Jack"
events:
KEY (0001): 0072 0073 00e2 0103 0104 0105
input props:
<none>
add device 2: /dev/input/event4
name: "sdm845-tavil-snd-card Headset Jack"
events:
SW (0005): 0002 0004 0006 0007 0010 0011 0012 0013
input props:
<none>
add device 3: /dev/input/event1
name: "gf_input"
events:
KEY (0001): 003c 0066 0067 0069 006a 006c 0074 008b
009e 0131
input props:
<none>
add device 4: /dev/input/event0
name: "qpnp_pon"
events:
KEY (0001): 0072 0074
input props:
<none>
add device 5: /dev/input/event3
name: "synaptics,s3320"
events:
KEY (0001): 003e 009e 0145 0244
ABS (0003): 002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
0031 : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
0032 : value 0, min 0, max 0, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 1079, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 2339, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_DIRECT
add device 6: /dev/input/event2
name: "gpio-keys"
events:
KEY (0001): 0072 0073
SW (0005): 0000
input props:
<none>
could not get driver version for /dev/input/mice, Not a typewriter```
@JakeWharton ,
Will the program works only on emulators not on physical devices?
Couldn't run the script by executing
adb -s emulator-5554 shell getevent | kotlinc -script -- adb-event-mirror.main.kts 0498ad080405
Result:
error: unresolved reference: clikkotlinct (adb-event-mirror.main.kts:8:25)
error: unresolved reference: multiple (adb-event-mirror.main.kts:27:4)
error: unresolved reference: it (adb-event-mirror.main.kts:28:19)
adb-event-mirror.main.kts:8:25: error: unresolved reference: clikkotlinct
import com.github.ajalt.clikkotlinct.parameters.arguments.multiple
^
adb-event-mirror.main.kts:27:4: error: unresolved reference: multiple
.multiple(true)
^
adb-event-mirror.main.kts:28:19: error: unresolved reference: it
.transformAll { it.toSet() }
Wanna be able to do brew install adb-event-mirror
.
Following the instructions
adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
adb -s emulator-5554 shell getevent | ./adb-event-mirror.main.kts emulator-5556
ready!
EVENT /dev/input/event1 3 57 0
EVENT /dev/input/event1 3 48 2755
EVENT /dev/input/event1 3 58 129
EVENT /dev/input/event1 3 53 22633
Using Pixel 3a emulators on Api 29, I dont see any events being sent ?
Emulator details:
Name: Copy_of_Pixel_3_API_29
CPU/ABI: Google Play Intel Atom (x86)
Path: /Users/iam/.android/avd/Copy_of_Pixel_3_API_29.avd
Target: google_apis_playstore [Google Play] (API level 29)
Skin: pixel_3
hw.device.name: pixel_3
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 29
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Copy_of_Pixel 3 API 29
AvdId: Copy_of_Pixel_3_API_29
Anything I am missing here ?
Maybe batching up MOVE events would help with the throttling
Curious if you are open to using kscript instead of a pure kotlin script. The wrapper would allow us to resolve and specify our own repositories to resolve the clikt dependency.
adb -s emulator-5554 shell getevent
add device 1: /dev/input/event0
name: "Power Button"
add device 2: /dev/input/event6
name: "virtio_input_multi_touch_6"
add device 3: /dev/input/event3
name: "virtio_input_multi_touch_3"
add device 4: /dev/input/event10
name: "virtio_input_multi_touch_10"
add device 5: /dev/input/event4
name: "virtio_input_multi_touch_4"
add device 6: /dev/input/event1
name: "virtio_input_multi_touch_1"
add device 7: /dev/input/event11
name: "virtio_input_multi_touch_11"
add device 8: /dev/input/event7
name: "virtio_input_multi_touch_7"
add device 9: /dev/input/event5
name: "virtio_input_multi_touch_5"
add device 10: /dev/input/event2
name: "virtio_input_multi_touch_2"
add device 11: /dev/input/event12
name: "qwerty2"
add device 12: /dev/input/event14
name: "goldfish_rotary"
add device 13: /dev/input/event9
name: "virtio_input_multi_touch_9"
add device 14: /dev/input/event8
name: "virtio_input_multi_touch_8"
add device 15: /dev/input/event13
name: "AT Translated Set 2 keyboard"
/dev/input/event12: 0001 0014 00000001
/dev/input/event12: 0000 0000 00000000
/dev/input/event12: 0001 0014 00000000
/dev/input/event12: 0000 0000 00000000
/dev/input/event1: 0003 0039 00000000
/dev/input/event1: 0003 0030 0000006f
/dev/input/event1: 0003 003a 00000081
/dev/input/event1: 0003 0035 00004d82
/dev/input/event1: 0003 0036 00000955
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0003 003a 00000000
/dev/input/event1: 0003 0039 ffffffff
/dev/input/event1: 0000 0000 00000000
/dev/input/event12: 0001 0074 00000001
/dev/input/event12: 0000 0000 00000000
/dev/input/event12: 0001 0074 00000000
/dev/input/event12: 0000 0000 00000000
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.