I have a bash script that uses ADB to install a couple apps. The apps are kept in a folder and are referenced as ./apps/1.apk
. When executed from the terminal, this script acts as intended. It can locate the apk files and install them.
When double clicked through a file manager, the script acts differently. I get an error message telling me it "cannot find location" of ./apps/1.apk
. Why doesn't the executable recognize it's current directory when double clicked?
I need this to work as I've built this script for people I work with who are unfamiliar with the Terminal.
Below is the script. It is not that complex at all. Currently running with all permissions granted.
#!/bin/bash
adb install ./apps/1.apk
adb install ./apps/2.apk