Sto provando a scrivere un batch (per win) e uno script di shell per linux per automatizzare gli eventi key e touch su un'interfaccia utente Android. Al momento in un file batch di Windows Sto iniziando un adb shell per ogni evento per esempioscript di shell/batch per dirigere i comandi ad adb shell
:again
adb shell am start -a android.intent.action.MAIN -n com.q.me.fui.activity/.InitActivity
sleep 15
adb shell sendevent /dev/input/event0 3 0 281
adb shell sendevent /dev/input/event0 3 1 70
adb shell sendevent /dev/input/event0 1 330 1
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 1 330 0
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 1 330 1
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 1 330 0
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 0 0 0
sleep 5
adb shell input keyevent 82
adb shell input keyevent 20
adb shell input keyevent 20
adb shell input keyevent 22
adb shell input keyevent 22
adb shell input keyevent 22
adb shell input keyevent 66
sleep 5
goto again
Il codice di cui sopra è infatti iniziare una nuova adb shell ogni volta. Voglio evitare questo. Voglio che il mio script batch avvii la shell adb solo una volta e vorrei indirizzare sendevent e altri comandi alla subshell, cioè la shell adb.
Qualche idea su come posso farlo nello script di batch batch e lin shell?
risposta semplice, solo piccolo errore, il thread t non deve avere il metodo scope –