-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtextInput.sh
executable file
·45 lines (37 loc) · 960 Bytes
/
textInput.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Created by Sujay Davalgi
#
# Send the entered text to the device input field
#
# Usage: ./textInput.sh [<Device Serial>]
# Command line Arguments (Optional):
# $1 - Input the device serial
# If the serial number is not provided, it will display the list of attached devices to pick from
. ./library/mainFunctions.sh
. ./library/textFormatting.sh
. ./library/deviceOperations.sh
. ./library/keycodeEvents.sh
if [ $# -lt 1 ]; then
getDeviceChoice
else
buildDeviceSnArray
deviceSerial="$1"
fi
displaySelectedDevice $deviceSerial
inputevent="null"
while [ "$inputevent" != "n" ]
do
#echo -e -n " Do you want to input text : [y/n] "
#stty -echo && read -n 1 inputevent && stty echo
#formatYesNoOption $inputevent
#case "$inputevent" in
# [yY])
echo -e -n " --> Enter the text you want to input : "
read inputtext
adb -s $deviceSerial shell input text "${inputtext}"
# ;;
# [nN])
# exit 1 ;;
#esac
done
echo ""