aboutsummaryrefslogtreecommitdiff
path: root/android-push
blob: dba8e551da66b16b8a755c1cb3cb9b7e9b7d7aaf (plain)
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
#!/bin/bash
#
# Push and pull to android device.
#

# Parameters
BASENAME="`basename $0`"
ORIG="$1"
DEST="$2"
ANDROID_BASE="${3:-/storage/emulated/0}"

# Check
if [ -z "$DEST" ]; then
  echo "Usage: $BASENAME <orig> <dest> [android-base]"
  echo ""
  echo "Examples"
  echo ""
  echo "android-push /mylocal/music/ Music/"
  echo "androis-pull DCIM/Camera     /mylocal/camera"
  echo "androis-pull Music           /mylocal/music"
  echo "androis-pull Ringtones       /mylocal/ringtones $ANDROID_BASE"
  exit 1
fi

# Run
if [ "$BASENAME" == "android-pull" ]; then
  adb pull $ANDROID_BASE/$ORIG $DEST
else
  adb push $ORIG $ANDROID_BASE/$DEST
fi