Last active
July 20, 2022 07:20
-
-
Save aslamanver/fb6a4f432d1337c06d3022a53be7c82e to your computer and use it in GitHub Desktop.
Install application APK from URL using ADB (Android Developer Bridge)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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