Created
April 3, 2023 08:20
-
-
Save theapache64/16c350cf0af5c4349b9da0c439084071 to your computer and use it in GitHub Desktop.
To install recently download APK file
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
# 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