Skip to content

Instantly share code, notes, and snippets.

@aslamanver
Last active July 20, 2022 07:20
Show Gist options
  • Save aslamanver/fb6a4f432d1337c06d3022a53be7c82e to your computer and use it in GitHub Desktop.
Save aslamanver/fb6a4f432d1337c06d3022a53be7c82e to your computer and use it in GitHub Desktop.
Install application APK from URL using ADB (Android Developer Bridge)
#!/bin/bash
BASEDIR=$(dirname "$0")
FILE=$(basename "$1")
EXTENSION="${FILE##*.}"
if [[ $EXTENSION == "apk" ]]; then
find "${BASEDIR}/temp" -maxdepth 1 -name "*.apk" -type f -delete
wget -N $1 --no-check-certificate -P "${BASEDIR}/temp"
adb install -f "${BASEDIR}/temp/${FILE}"
else
echo -e "\e[01;31mThe URL does not contain .apk\e[0m"
fi
# Example: ./adb-url-install.sh "https://someurl.com/some.apk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment