(hoofbeats) Fixes the Tizen deply script.
authorSalvatore Iovene <salvatore@iovene.com>
Wed, 30 Jan 2013 09:09:55 +0000 (11:09 +0200)
committerSalvatore Iovene <salvatore@iovene.com>
Wed, 30 Jan 2013 09:09:55 +0000 (11:09 +0200)
examples/hoofbeats/tests/deploy.sh

index 31eab27..7ee8084 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh
+LOCAL_PORT=11223
+SOCKET='unix:/tmp/qemu.sock'
+
 echo "Building..."
 ./make-wgt.sh >/dev/null
 
@@ -6,5 +9,12 @@ echo "Pushing the widget file..."
 sdb push hoofbeats-unittests.wgt /home/developer
 
 echo "Installing the widget file..."
-sdb shell 'wrt-launcher -k 1234567891; sleep 2; wrt-installer -un 1234567891; wrt-installer -i /home/developer/hoofbeats-unittests.wgt; wrt-launcher -d -s 1234567891' | awk '/port:/ { print $2 }' | xargs -i google-chrome http://$(sdb shell ifconfig eth0 | awk '/inet addr/ { print $2 }' | cut -d':' -f2):{}
+REMOTE_PORT=`sdb shell 'wrt-launcher -k 1234567891; sleep 2; wrt-installer -un 1234567891; wrt-installer -i /home/developer/hoofbeats-unittests.wgt; wrt-launcher -d -s 1234567891' | awk '/port:/ { print $2 }'`
+
+echo "Enabling forwarding to port $PORT..."
+echo "hostfwd_remove ::$LOCAL_PORT" | socat $SOCKET -
+echo "hostfwd_add ::$LOCAL_PORT-:$REMOTE_PORT" | socat $SOCKET -
+
+echo "Starting debuggin..."
+google-chrome http://localhost:$LOCAL_PORT
 echo "Done."