Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Apk from URI
#!/usr/bin/fish
while true
rm .tmp.target.apk 2&> /dev/null || true
set uri $argv
if test -z "$uri"
read uri -p "echo 'URI |> '"
set -gx uri $uri
end
aria2c -x10 -s10 -o .tmp.target.apk "$uri"
set -gx adb_count 0
while true
if adb.exe install .tmp.target.apk
break
else
set -gx adb_count (math $adb_count+1)
if test $adb_count = 10
break
end
end
end
rm .tmp.target.apk 2&> /dev/null || true
read break -p "echo 'Break? Y/n |> '"
if test $break = n
else if test $break = N
else
set -gx uri
set -gx argv
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment