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
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/bash
#
# click_n_run.sh
#
# Take ones parameter, the filepath to the click package
# Optional second parameter "--ignore-checks" which will install on a USB
# connected device, regardless of whether the tests pass or not.
#
# e.g. ./click_n_run.sh ~/Downloads/com.ubuntu.developer.dgalg.wordchain-0.3.click
if [ "$1" == "" ]; then
echo "Error: Must specify a click file as a parameter"
echo "e.g. ./click_n_run.sh ~/Downloads/com.ubuntu.developer.dgalg.wordchain-0.3.click"
exit 99
fi
FILE=$1
TARGETUSER="phablet"
TARGET="/home/$TARGETUSER"
FILENAME=`basename $FILE`
DESKTOPFILE=`echo $FILENAME | tr '-' '_'`
TMPDIR=$(mktemp -d)
HERE=$(pwd)
IGNORECHECKS="FALSE"
if [ "$2" = "--ignore-checks" ]; then
IGNORECHECKS="TRUE"
fi
# Path to the tools contained at http://launchpad.net/click-reviewers-tools
# Download somewhere with:-
# bzr branch lp:click-reviewers-tools
# Then modify this parameter to be where those tools are
PATHTOREVIEWERSTOOL="$HOME/phablet/click-reviewers-tools"
TESTTOOL="bin/click-run-checks"
if [ -e "$PATHTOREVIEWERSTOOL/$TESTTOOL" ]; then
echo `date` Running tests
cd $PATHTOREVIEWERSTOOL
echo `date` Making sure we have latest tests
bzr pull
./$TESTTOOL $FILE
RC="$?"
cd $HERE
if [[ "$RC" != "0" ]] && [[ "$IGNORECHECKS" != "TRUE" ]]; then
echo `date` Tests failed
exit 1
fi
else
echo `date` $PATHTOREVIEWERSTOOL/$TESTTOOL Not found. No tests performed!
fi
echo `date` Pushing $FILE to $TARGET
adb push $FILE $TARGET
if [ "$?" != "0" ]; then
echo `date` Push failed
else
echo `date` Installing $FILENAME
# don't use click install - well, do, because pkcon aint finished
# adb shell click install --user=$TARGETUSER --force-missing-framework $TARGET/$FILENAME
adb shell click install --force-missing-framework --user=phablet $TARGET/$FILENAME
# When pkcon works, we use this
#adb shell su - $TARGETUSER -c pkcon -y -v install-local $TARGET/$FILENAME
#adb shell sudo -H -u phablet pkcon install-local $TARGET/$FILENAME
# Fudge to force the app to be seen in the app lens
adb reboot
fi
|