Last active
November 7, 2022 08:47
-
-
Save mikemikhaylov/145cea6f966814b6c63bc78c05935a15 to your computer and use it in GitHub Desktop.
Past file line by line to Android emulator via adb input text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
start=$(date +%s) | |
#EDIT to your value | |
export PATH=$PATH:/Users/mikhailmikhaylov/Library/Android/sdk/platform-tools/ | |
echo Starting | |
#PUT content you want to paste here | |
file="input.txt" | |
IFS=$'\n' | |
for line in `cat "$file"` | |
do | |
echo "Sending ${line}" | |
#CAUTION sends new line char at the end, to remove add -n after echo keyword | |
echo "$line" | adb shell xargs -0 input text | |
done | |
end=$(date +%s) | |
echo "Elapsed Time: $(($end-$start)) seconds" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment