Search code examples
androidshellwindows-phone-8adb

ADB command to send txt msg doesn't actually send the txt


I'm making a shell script to control txt msg from my s5 phone and I've tried 2 different ways:

1) am start -a android.intent.action.SENDTO -d sms:$1 --es sms_body "$2" --ez exit_on_sent true sleep 1 input keyevent 22 sleep 1 input keyevent 66

2) using DDMS to get the coordinates of the send button, x, y service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText". input tap x y

My goal is to generalize this for different phones that I want to test, and 1) doesn't send the message at all. It just loads sms app with the send to number and message body while not actually pressing the send buttong. 2) Works, but is specific to my phone. Some phones have the keyboard showing to coordinates are different, and additionally, most of my phones have different resolutions.

Is there a better way to automate the sending process? Like a keyevent code, or even an action to perform the last and most important step (for what I need this script for) of actually sending the message?


Solution

  • So the SENDTO syntax is for the default Android API's packages. It turns out my verizon messaging app behaves differently. All I had to do was reset my default text messenger to the android messenger and not the verizon one.

    Example: Samsung S5 Verizon default: Messages and NOT Message+(verizon)