Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from ErickReyesR/master
Browse files Browse the repository at this point in the history
androdeb: add androdeb pull command
  • Loading branch information
joelagnel committed Jun 25, 2018
2 parents 9f87035 + e25caea commit 925a9f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
25 changes: 23 additions & 2 deletions androdeb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ case $key in
prepare) PREPARE=1; shift || true; ;;
shell) ASHELL=1; shift || true; ;;
remove) REMOVE=1; shift || true; ;;
pull) PULL=1; shift || true; ;;
git-pull) GIT_PULL=1; shift || true; ;;
pull) PULL=1; shift || true; break ;;
--arch) ARCH=$2; shift || true; shift || true; ;;
--archive) TARF=$2; shift || true; shift || true; ;;
--tracers) source $spath/packages/tracers; shift || true; ;;
Expand All @@ -53,14 +54,34 @@ case $key in
esac
done

if [ ! -z "$PULL" ]; then
if [ ! -z "$GIT_PULL" ]; then
echo "Updating androdeb by git pull"
cd $spath
git pull
echo "Done."
exit 0
fi

if [ ! -z "$PULL" ]; then
if [ $1 == "-a" ]; then
PRESERVE="-a"
echo "Preserving filestamps and mode"
shift || true
fi
file_count=$#
if [ $file_count -gt 1 ]; then
file_count=$((file_count - 1))
fi
i=0
while [ $i -lt $file_count ]; do
files["$i"]=/data/androdeb/debian/$1
shift || true
i=$((i + 1))
done
$ADB pull $PRESERVE "${files[@]}" "$@"
exit 0
fi

if [ -z "$ASHELL" ] && [ -z "$PACKAGES" ]; then
echo "No packages specified, so I'm going to build/install all packages (--fullbuild)"
config_full_build
Expand Down
3 changes: 2 additions & 1 deletion utils/banners
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ usage() {
echo "androdeb"
echo " shell Enter the androdeb shell environment and get to work!"
echo " remove Remove androdeb from the device"
echo " pull Git pull androdeb to update it on your host"
echo " git-pull Git pull androdeb to update it on your host"
echo " pull Retrieve files from the androdeb filesystem in the device"
echo ""
echo " prepare Prepare the device (when running for the first time)"
echo " --tracers Enable tracing packages (perf and trace-cmd)"
Expand Down

0 comments on commit 925a9f5

Please sign in to comment.