Skip to content

Instantly share code, notes, and snippets.

@davidkathoh
Created January 9, 2020 11:54
Show Gist options
  • Save davidkathoh/a87901ecbbfcc01ab5e23b9e378c9c22 to your computer and use it in GitHub Desktop.
Save davidkathoh/a87901ecbbfcc01ab5e23b9e378c9c22 to your computer and use it in GitHub Desktop.
!#/bin/bash
start=$SECONDS #for duration
echo " installing apk ...."
log=log.txt
printf "" > $log
result=$(adb -d install -r livinggoods.apk) #installing apk on one device
imei=$(adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ') #IMEI
battery=$(adb shell dumpsys battery | grep level) #battery level
signal=$(adb shell dumpsys telephony.registry | grep -i signalstrength) # signal Strength
echo " generating log File ...."
echo installation result: $result >>$log
echo imei : $imei >> $log
echo battery: $battery % >> $log
echo signal : $signal >> $log
end=$SECONDS
time=$((end-start)) #duration time
echo duration: $time seconds >> $log
echo "Process complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment