-
Notifications
You must be signed in to change notification settings - Fork 14
/
installApkFromPath.sh
41 lines (33 loc) · 962 Bytes
/
installApkFromPath.sh
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
#!/bin/bash
# Created by Sujay Davalgi
#
# Installs the apks from the default configured folder
# Will prompt to install apks if there are multiple apks
#
# Usage: ./installApkFromPath.sh [<filename>]
# Arguments (Optional):
# $1 - Complete path to the APK file.
. ./library/mainFunctions.sh
. ./library/textFormatting.sh
. ./library/deviceOperations.sh
. ./library/machineFileOperations.sh
getDeviceChoice
displaySelectedDevice $deviceSerial
if [ $( isAdbDevice $deviceSerial ) == "true" ]; then
if [ $# -lt 1 ]; then
echo -e -n "${txtbld} Enter the Full Path : ${txtrst}"
read pathName
else
pathName="${1}"
fi
if [ -d "${pathName}" ]; then
installFromPath $deviceSerial "${pathName}" "*.apk"
elif [ -f "${pathName}" ]; then
adb -s $deviceSerial wait-for-device install -r -d "${pathName}"
else
echo -e -n " Could not verify the Path type as Directory/File.\n"
fi
else
echo -e -n " Device is not in 'adb' mode\n"
fi
echo -e -n "\n"