You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
532 B
28 lines
532 B
#!/bin/bash |
|
set -e -o pipefail |
|
|
|
# Copy a file or directory to the target Android device. |
|
# |
|
# Usage: target_cp <src> <target>:<dest> |
|
|
|
src="$1" |
|
shift |
|
|
|
targetdest="$1" |
|
shift |
|
|
|
target="${targetdest%:*}" |
|
dest="${targetdest#*:}" |
|
|
|
if [[ -z "${src}" || -z "${target}" || -z "${dest}" || "${targetdest}" != "${target}:${dest}" || -n "$*" ]] |
|
then |
|
echo "Usage: target_cp <src> <target>:<dest>" |
|
exit 1 |
|
fi |
|
|
|
if [[ -d ${src} ]] |
|
then |
|
adb_${target} push ${src} ${dest}/${src##*/} 2>/dev/null |
|
else |
|
adb_${target} push ${src} ${dest} 2>/dev/null |
|
fi
|
|
|