adb shell input text "hello world"
Also useful for typing out long commands with my keyboard to be executed in Termux.
adb shell input text "'git config user.email \"22302001+lydavid@users.noreply.github.com\"'"
"' '"adb shell
panther:/ $ input text "hello world"