Last active
December 19, 2015 08:49
-
-
Save alexito4/5928343 to your computer and use it in GitHub Desktop.
Shell script for pulling the database from an android device.
This file contains 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
#!/bin/sh | |
# Params | |
while echo $1 | grep ^- > /dev/null; do | |
eval $( echo $1 | sed 's/-//g' | tr -d '\012')=$2 | |
shift | |
shift | |
done | |
adbdefault="/Applications/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb" | |
if [ -z "$db" ]; then | |
echo "Use:" | |
echo "-db : name of the db file" | |
echo "-path : path to the folder where de db is" | |
echo "(optional) -adb : path to adb. Default to $adbdefault" | |
exit | |
fi | |
if [ -z "$adb" ]; then | |
adb=$adbdefault | |
fi | |
# Move to desktop | |
cd ~/Desktop | |
# Remove old database | |
rm $db | |
# Pull new database | |
$adb pull $path/$db |
This file contains 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
#!/bin/sh | |
# Params | |
while echo $1 | grep ^- > /dev/null; do | |
eval $( echo $1 | sed 's/-//g' | tr -d '\012')=$2 | |
shift | |
shift | |
done | |
adbdefault="/Applications/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb" | |
if [ -z "$db" ]; then | |
echo "Use:" | |
echo "-db : name of the db file" | |
echo "-path : path to the folder where de db is" | |
echo "(optional) -adb : path to adb. Default to $adbdefault" | |
exit | |
fi | |
if [ -z "$adb" ]; then | |
adb=$adbdefault | |
fi | |
# Move to desktop | |
cd ~/Desktop | |
# Remove old database | |
rm $db | |
# Pull new database | |
$adb pull $path/$db | |
killall Base | |
open $db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment