on 7.85+14.04.20140404.is.7.85+14.04.20140403.1-0ubuntu1
help
sign in
8TARGET_IP=${TARGET_IP-127.0.0.1}
9TARGET_SSH_PORT=${TARGET_SSH_PORT-2222}
11RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT
16SUDO="echo $PASSWORD | sudo -S"
17NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
19CHROOT_PREFIX="/data/ubuntu"
24 echo "usage: run_on_device [OPTIONS]\n"
25 echo "Script to setup a build environment for the shell and sync build and run it on the device\n"
27 echo " -s, --setup Setup the build environment"
28 echo " -p, --pinlock Enable a PIN lock screen when running"
29 echo " -k, --keylock Enable a Keyboard lock screen when running"
32 echo " * Make sure to have networking setup on the device beforehand."
33 echo " * Execute that script from a directory containing unity8 code."
38 if [ $SSH_STARTED -eq 0 ]; then
39 exec_with_adb initctl start ssh
46 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t $USER@$TARGET_IP -p $TARGET_SSH_PORT sudo -u $USER -i bash -ic \"$@\"
53 adb shell chroot /data/ubuntu /usr/bin/env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin "$@"
63 ssh-keygen -R $TARGET_IP
64 HOME_DIR="${CHROOT_PREFIX}/home/phablet"
65 adb push ~/.ssh/id_rsa.pub $HOME_DIR/.ssh/authorized_keys
66 adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh
67 adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh/authorized_keys
68 adb shell chmod 700 $HOME_DIR/.ssh
69 adb shell chmod 600 $HOME_DIR/.ssh/authorized_keys
72setup_adb_forwarding() {
73 adb forward tcp:$TARGET_SSH_PORT tcp:22
74 adb forward tcp:$TARGET_DEBUG_PORT tcp:$TARGET_DEBUG_PORT
77install_dependencies() {
78 exec_with_adb apt-get update
79 exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache gdb ninja-build devscripts equivs unity-plugin-scopes
83 [ -e .bzr ] && bzr export --uncommitted --format=dir /tmp/$CODE_DIR
84 [ -e .git ] && git checkout-index -a -f --prefix=/tmp/$CODE_DIR/
86 rsync -crlOzv --delete --exclude builddir -e "ssh -p $TARGET_SSH_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" /tmp/$CODE_DIR/ $USER@$TARGET_IP:$CODE_DIR/
91 exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/ && PATH=/usr/lib/ccache:$PATH ./build"
106 exec_with_ssh "stop unity8"
107 exec_with_ssh "start maliit-server"
108 exec_with_ssh "cd $CODE_DIR/ && ./run $ARGS -- $RUN_OPTIONS"
109 exec_with_ssh "stop maliit-server"
110 exec_with_ssh "start unity8"
113set -- `getopt -n$0 -u -a --longoptions="setup,gdb,pinlock,keylock,help" "sgpkh" "$@"`
115# FIXME: giving incorrect arguments does not call usage and exit
119 -s|--setup) SETUP=true;;
121 -p|--pinlock) PINLOCK=true;;
122 -k|--keylock) KEYLOCK=true;;
131[ "${TARGET_IP}" = "127.0.0.1" ] && setup_adb_forwarding
133if [ "`adb shell 'grep -q Ubuntu /etc/lsb-release 2> /dev/null && echo -n FLIPPED'`" = "FLIPPED" ]; then
136 if [ "${TARGET_IP}" != "127.0.0.1" ]; then
137 echo "ERROR: Flipped image detected, adb over TCP/IP isn't supported, yet :/"
138 echo "Unset TARGET_IP and try again."
143status_output=$(exec_with_adb initctl status ssh)
144if [[ $status_output == "ssh start/running, process "* ]]; then
147SSH_STARTED=$SSH_WAS_STARTED
150 echo "Setting up environment for building shell.."
155 echo "Transferring code.."
163if [ $SSH_WAS_STARTED -eq 0 ]; then
164 exec_with_adb initctl stop ssh
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list