# Get sms messages through adb Android Shell (no root needed)
content query --uri content://sms/
# Specify fields returned
projection="thread_id:address:person:date:date_sent:protocol:read:status:type:reply_path_present:subject:body:service_center:locked:sub_id:error_code:creator:seen"
content query --uri content://sms/ --projection ${projection}
projection="thread_id:address:person:date_sent:body"
content query --uri content://sms/ --projection ${projection}
# By default the newest messages are listed first
# lets grab just the first 25 messages
# and put them so the newest are at the bottom.
# Some messages are multi line messages
# lets put them on one line for sorting
content query --uri content://sms/ --projection ${projection}|tr "\n" "|"|sed 's/|Row:/\nRow:/g'|head -n 25|tac
# This can take some time if you have a lot of messages
# also see https://pastebin.com/J1VDDJ11