I am looking to create a simple script that allows me to uninstall and reinstall an application on many devices connected to a hub.
This should be a quick easy task for anyone who understands the language.
Some of the devices have the application installed as a system app and others are not. This requires a check and uninstall based on its location. Once uninstalled the new version which is a different signing needs to be installed.
Below I included the code I started working on and got stuck.
while read sn device; do
adb -s "$sn" root
adb -s "$sn" shell
file="/system/app/ourcompany-gallery"
if [ -f "$file" ]
then
rm -rf ourcompany-gallery
else
exit
adb -s "$sn" uninstall [login to view URL]
fi
adb -s "$sn" install E:\[login to view URL]
adb -s "$sn" shell reboot
done < <(adb devices | sed '1d')
i can do this in 30 min
........................................................................................................................................................................................