Is there an easy way to copy/paste (desktop\'s) clipboard content to EditView
on Android Emulator?
(just for the sake to ease development/test)
An easy way is there
See original answer: https://www.quora.com/How-do-I-paste-text-from-my-computer-to-Android-emulator
I got tired of this problem so I just made this alias to handle it:
alias ap="pbpaste | xargs adb shell input text"
Then when you open a new terminal window, typing "ap" will paste whatever is on your clipboard into the emulator's actively selected text field.
Simply add this to your profile (for most users that's ~/.bash_profile
for zsh users that's ~/.zshrc
) to make the alias available everywhere. Alternatively, if you're a bash user (the default for MacOS), then you can run the following command in the terminal to set it up for you:
echo "alias ap='pbpaste | xargs adb shell input text'" >> ~/.bash_profile && source ~/.bash_profile
You can do this without workarounds too. Just click and hold for a bit in the input field till the paste notification appears and then click on paste. That's it!
Just copy from wherever, click and hold on the emulator phone's edit text where you want the text to go (kind of like you would press and hold to paste on an actual phone), the PASTE option will appear, then PASTE.
Only For API level >= 24
Copy any text from your local machine and then simply run this command
adb shell input keyevent 279
Make sure In Android Emulator Settings the Enable Clipboard Sharing
options is enabled
(converting comment discussion to answer)
only solution on windows: https://github.com/gcb/AdbPaste
wrote it in a couple hours to work around this problem. I am now back on 100% linux, so feel free to join it as a contributor or maintainer!