-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchLinux-AndroidPhoneBackup
More file actions
40 lines (32 loc) · 964 Bytes
/
ArchLinux-AndroidPhoneBackup
File metadata and controls
40 lines (32 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
while true; do
if pacman -Qs android-tools | grep -q 'android-tools'; then
if adb devices | grep -q "device"; then
echo -e "\n"
echo "Please enter the target directory of the backup (example : /path/to/phone/backup/)."
read -r BackupPath
echo -e "\n"
echo "Backup starting..."
adb backup -apk -shared -all -f "$BackupPath"
adb pull /sdcard/ "$BackupPath"
mv "$BackupPath"/sdcard/ "$BackupPath"/PhoneBackup
echo -e "\n"
echo "Phone backup complete !"
exit
else
echo -e "\n"
echo "Your device is not accessible. Did you allow USB debugging ?"
exit
fi
else
echo -e "\n"
echo "This program requires the 'android-tools' package to be installed on your system."
echo "Install now ?"
select yn in "Yes" "No"; do
case $yn in
"Yes" ) pacman -S android-tools;;
"No" ) exit;;
esac
done
fi
done