I had the same problem - need to copy text from macOS to a Android Virtual Device (AVD) in Android Studio. I tried the sms or telnet solutions, they worked but not really well for a large sum of text (e.g. a whole page of text with spaces, line feeds and all kinds of special characters).
Thanks to someone who created an Apple script to force input password into the password field when opening an encrypted volume. That amazing script also solved this problem! And its more straight forward in utilizing this script to copy and paste from Mac to an AVD.
I have the Apple script icon always stay on top of the screen (the status bar) so whenever I need to copy and paste, it is just one click away.
Here is a copy of the script (whoever created this, thank you again!)
——————
set numbers_key_codes to {82, 83, 84, 85, 86, 87, 88, 89, 91, 92}
set input to do shell script "pbpaste"
if (input is not missing value) then
tell application "System Events"
repeat with char in the characters of input
try
key code numbers_key_codes's item (char + 1)
on error
keystroke char
end try
end repeat
end tell
end if
——————
Just copy the source text, click on the target location in the AVD, and then activate the script by clicking on the script icon, voilà, everything will be pasted like typing automatically!
Be warned that if there’s a huge sum of characters you are copying and pasting, it may take a few seconds for the script to complete the ‘typing’.