Android - Rooted phone - sending SMS message via command line

You should be able to call the messaging intent with

am start -a android.intent.action.VIEW "sms:numberhere" -e "sms_body" "hello"

Using the intent command as described here:

http://learnandroid.blogspot.com/2008/01/run-android-application-from-command.html

https://stackoverflow.com/questions/4967448/send-sms-in-android


An alternative approach is to install Termux and Termux-api

Then ssh in the phone by following this link

Now you can send SMS and access many other useful options mainly:

  1. Camera
  2. Battery Status
  3. Clipboard
  4. Contacts
  5. SMS and Inbox

Full list and syntax can be found here

As it is linux emulator you can use it for many other purposes also.