以下情况可能会出现在红米4X机型
手机第一次连接电脑,进入开发者模式做一些必要的设置
D:\adb\py_files>adb devices
List of devices attached
SWFEMFS4TCH6IJ8S device
可以确认电脑识别到了手机,然后就在电脑上信心满满的运行python程序,发现程序运行没有问题,但是手机一点反应都没有,这是为什么呢?
通过adb命令查看手机状态
D:\adb\py_files>adb shell
shell@nikel:/ $ ge
geomagneticd getenforce getevent getopts getprop
shell@nikel:/ $ get
getenforce getevent getopts getprop
shell@nikel:/ $ gete
getenforce getevent
shell@nikel:/ $ getevent -p
could not open /dev/input/event3, Permission denied
could not open /dev/input/event16, Permission denied
could not open /dev/input/event15, Permission denied
could not open /dev/input/event14, Permission denied
could not open /dev/input/event13, Permission denied
could not open /dev/input/event12, Permission denied
could not open /dev/input/event8, Permission denied
could not open /dev/input/event7, Permission denied
could not open /dev/input/event6, Permission denied
could not open /dev/input/event5, Permission denied
could not open /dev/input/event4, Permission denied
could not open /dev/input/event0, Permission denied
could not open /dev/input/event11, Permission denied
could not open /dev/input/event10, Permission denied
could not open /dev/input/event9, Permission denied
could not open /dev/input/event1, Permission denied
could not open /dev/input/event2, Permission denied
在网上千搜万搜,没有找到答案,最后只能在手机上找原因,原来是开发者选项中有一项 USB调试(安全设置)
其解释就是允许通过USB调试修改权限或模拟点击,要想开启这个功能还必须登录小米账号,通过一顿操作,注册了小米账号,竟然还需要插入SIM卡,真的是坑。。。
手机识别卡后,通过adb命令查询状态
130|shell@nikel:/ $ getevent -p
add device 1: /dev/input/event3
name: "uinput-fpc"
events:
KEY (0001): 0001 001c 0067 0069 006a 006c 0161
input props:
<none>
add device 2: /dev/input/event16
name: "HALL"
events:
SW (0005): 0000
input props:
<none>
add device 3: /dev/input/event15
name: "mtk-tpd-kpd"
events:
KEY (0001): 008b 009e 00ac
input props:
<none>
add device 4: /dev/input/event14
name: "mtk-tpd"
events:
KEY (0001): 0011 0012 0018 001f 0026 002c 002e 002f
0032 0067 0069 006a 006c 0074 008b 009e
00ac 014a
ABS (0003): 0000 : value 0, min 0, max 1080, fuzz 0, flat 0, resolution 1080
0001 : value 0, min 0, max 1920, fuzz 0, flat 0, resolution 1920
0018 : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0030 : value 0, min 0, max 100, fuzz 0, flat 0, resolution 0
0031 : value 0, min 0, max 100, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 1080, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 1920, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 10, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_DIRECT
add device 5: /dev/input/event13
name: "m_step_c_input"
events:
REL (0002): 0000 0001 0002
ABS (0003): 0008 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 6: /dev/input/event12
name: "m_mag_input"
events:
REL (0002): 0000 0003 0006 0007 0008 0009
ABS (0003): 0000 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0003 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0004 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0005 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0006 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
0008 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 7: /dev/input/event8
name: "m_gyro_input"
events:
REL (0002): 0000 0006 0007
ABS (0003): 0000 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0008 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 8: /dev/input/event7
name: "m_acc_input"
events:
REL (0002): 0000 0006 0007
ABS (0003): 0000 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0001 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0008 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 9: /dev/input/event6
name: "bmi160_acc"
events:
ABS (0003): 0000 : value 2208, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0001 : value -5655, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0002 : value 6120, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0028 : value 0, min 0, max 0, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 10: /dev/input/event5
name: "m_alsps_input"
events:
REL (0002): 0001 0002
ABS (0003): 0000 : value 0, min -32768, max 32767, fuzz 0, flat 0, resolution 0
0008 : value 0, min 0, max 64, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 11: /dev/input/event4
name: "hwmdata"
events:
REL (0002): 0001 0002
input props:
<none>
add device 12: /dev/input/event0
name: "ACCDET"
events:
KEY (0001): 0072 0073 00a3 00a4 00a5 0246
input props:
<none>
add device 13: /dev/input/event11
name: "yas537_euler"
events:
ABS (0003): 0000 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0001 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0002 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0007 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
000a : value 0, min 0, max 3, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 14: /dev/input/event10
name: "yas537_cal"
events:
ABS (0003): 0000 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0001 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0002 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0007 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
000a : value 0, min 0, max 3, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 15: /dev/input/event9
name: "yas537_raw"
events:
ABS (0003): 0000 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0001 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0002 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
0007 : value 0, min -2147483648, max 2147483647, fuzz 0, flat 0, resolution 0
input props:
<none>
add device 16: /dev/input/event1
name: "mtk-kpd"
events:
KEY (0001): 0072 0073 0074 0198
input props:
<none>
add device 17: /dev/input/event2
name: "fpc_irq"
events:
KEY (0001): 0074 008f
MSC (0004): 0004
input props:
<none>
shell@nikel:/ $