在Android 7.1中,Google更改了SDK的权限以避免滥用。因此,我们需要更改ADB的命令以使用新的权限机制。
以下是解决方法中的代码示例:
adb shell pm grant com.android.smspush android.permission.SEND_SMS
adb shell input keyevent 22
这会将光标移动到短信输入字段中。
adb shell input text "Hello World"
adb shell input keyevent 66
这将发送短信。
请注意,此方法仅适用于Android 7.1,对于较旧的版本,可能需要使用不同的命令和权限。