Skip to content

Instantly share code, notes, and snippets.

@theapache64
Created April 3, 2023 08:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theapache64/16c350cf0af5c4349b9da0c439084071 to your computer and use it in GitHub Desktop.
Save theapache64/16c350cf0af5c4349b9da0c439084071 to your computer and use it in GitHub Desktop.
To install recently download APK file
# To install recently downloaded APK file
function i(){
lastModifiedFile=$(ls -lt | head -2)
echo $lastModifiedFile
if echo "$lastModifiedFile" | grep -q ".apk"; then
read yn\?"❓ Do you want to install the above file? (y/n)"
case $yn in
[Yy]* ) installLastModifiedFile; echo "✅ Done";;
[Nn]* ) echo "Cancelled APK installation";;
* ) echo "Please answer yes or no.";;
esac
else
echo " ❌ Last modified file is not APK"
fi
}
function installLastModifiedFile(){
lastFile=$(ls -t | head -1)
echo "🚧 Installing $lastFile"
adb install "$lastFile"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment