Skip to content

Instantly share code, notes, and snippets.

@alexito4
Last active December 19, 2015 08:49
Show Gist options
  • Save alexito4/5928343 to your computer and use it in GitHub Desktop.
Save alexito4/5928343 to your computer and use it in GitHub Desktop.
Shell script for pulling the database from an android device.
#!/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
#!/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