#!/bin/bash # How to use # runapp # Get necessary variable values APP_NAME=$1 DEV_NAME=$2 if [[ -z "$3" ]]; then ARCH_NAME="armhf" else ARCH_NAME=$3 fi # Get current version #PACKAGE_VERSION=$(cat manifest.json.in \ # | grep version \ # | head -1 \ # | awk -F: '{ print $2 }' \ # | sed 's/[",]//g') PACKAGE_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' manifest.json.in) CLICK_PATH="build/arm-linux-gnueabihf/app/$APP_NAME.${DEV_NAME}_${PACKAGE_VERSION}_${ARCH_NAME}.click" APP_ID="$APP_NAME.${DEV_NAME}_${APP_NAME}_${PACKAGE_VERSION}" # Install the newly compiled app pkcon install-local --allow-untrusted $CLICK_PATH # Run the app on your device ubuntu-app-launch $APP_ID string="ubuntumirclient: Attempted to deliver an event to a non-existent window, ignoring" LOGS_PATH="/home/phablet/.cache/upstart/" LOG_PATH="${LOGS_PATH}application-click-${APP_NAME}.${DEV_NAME}_${APP_NAME}_${PACKAGE_VERSION}.log" # Turn on the display powerd-cli display on & tail -n0 -F $LOG_PATH | \ while read LINE do echo "$LINE" # ubuntu-app-list | grep $APP_ID &> /dev/null echo "$LINE" | grep 'ubuntumirclient: Attempted to deliver an event to a non-existent window, ignoring' &> /dev/null if [ $? == 0 ]; then # echo "close" pkill tail else # echo "open" continue fi done