-
Notifications
You must be signed in to change notification settings - Fork 10
/
restartLiveView.sh
executable file
·55 lines (37 loc) · 1.42 KB
/
restartLiveView.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
46
47
48
49
50
51
52
53
54
# Stop all mobile device sessions
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
DISPLAYOPTS="--video-scaling=100 --desktop-fullscreen=true --pixel-depth=16 --desktop-scaling=auto --window-close=ignore --speaker=disabled --microphone=disabled --pulseaudio=no"
echo "Terminating any existing live view sessions"
$DIR/terminateLiveViewSessions.sh
echo "Restart VirtualHere connection to devices"
$DIR/restartVhClient.sh
echo "Print VirtualHere Server Log"
cat $DIR/vhserver.log
adb start-server
SLEEP=10
vhclientx86_64 -t LIST
DEVICESCOUNT=$(expr $(adb devices | tee >(wc -l) | tail -1) - 2)
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
while [ $DEVICESCOUNT -le 0 ]
do
VHCLIENTERROR="$(vhclientx86_64 -t LIST | awk /'No response from IPC server'/)"
while [ ! -z $VHCLIENTERROR ]
do
echo "Error with VirtualHere Client... restarting"
$DIR/restartVhClient.sh
VHCLIENTERROR="$(vhclientx86_64 -t LIST | awk /'No response from IPC server'/)"
sleep $SLEEP
done
echo "Retry - Number of devices connected: $DEVICESCOUNT"
adb kill-server
sleep $SLEEP
adb start-server
DEVICESCOUNT=$(expr $(adb devices | tee >(wc -l) | tail -1) - 2)
done
echo "Number of devices connected: $DEVICESCOUNT"
echo "Start UIAutomatorViewer"
$DIR/xpra_uiautomatorviewer.sh
echo "Prepare device_info.txt"
$DIR/prepare_device_info_list.sh
echo "Start Live View Sessions"
$DIR/update_connection.sh