#!/bin/bash
# (C) 2016 Esteban D.Dortta
#
# tools/adb-install
# YeAPF 0.8.60-153 built on 2018-06-26 07:22 (-3 DST)
# Copyright (C) 2004-2018 Esteban Daniel Dortta - dortta@yahoo.com
# 2018-06-01 09:31:47 (-3 DST)

if [ -f www/js/version.js ]; then
	my_dir="$(dirname "$0")"
	source "$my_dir/adb-lib.inc.sh"

	version="$(currentVersion)"

	dev=$1
	if [ -z $dev ]; then
	  dev=$firstdev
	fi

	if [ $devcount -eq 0 ]; then
	  echo "Please, attach/indicate a device"
	else
	  echo "Installing on $dev"
	  adb -s $dev install platforms/android/app/build/outputs/apk/debug/app-debug.apk
	fi
else
	echo "www/js/version.js file not found"
fi