In order for these scripts to work adb must be reachable in the shell.
If it's not then add adb location to PATH.
On Windows you may also place adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll to the same folder with the script.
On MacOS to open the script with double click it should be saved with .command extension.
Example: