如何在消息应用程序中显示使用 adb 发送的短信

how to make sms sent with adb show in messages app

我使用三星 phone 和 Android 10 我在网上找到了这个 adb 命令

adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "${phone}" s16 "null" s16 "'${text}'" s16 "null" s16 "null"

这有效,如果我遵守字符限制,它会发送短信。但是,短信不会显示在 phone 的消息应用

我找不到关于所有这些标志及其含义的文档。请帮助我并告诉我如何让它显示在消息应用程序中。如果 adb 做不到,还有其他方法吗?

我能够通过在最后提供另一个参数来实现这一点

i32 1

this article 帮助了我

基于 this documentation 看来我需要提供 persistMessageForNonDefaultSmsApp 布尔值

不确定这是否可行,我不是 android 开发人员,但它有效:/