summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh56
1 files changed, 40 insertions, 16 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 8289c82..4b2c19e 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -29,8 +29,8 @@ function get_abs_build_var()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
- CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
- make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1
+ (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
+ make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1)
}
# Get the exact value of a build variable.
@@ -106,10 +106,11 @@ function setpaths()
# and in with the new
CODE_REVIEWS=
prebuiltdir=$(getprebuilt)
- export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
+ export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-linux-androideabi-4.4.x/bin
+ export ARM_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
export ANDROID_QTOOLS=$T/development/emulator/qtools
- export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
+ export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ARM_EABI_TOOLCHAIN$CODE_REVIEWS
export PATH=$PATH$ANDROID_BUILD_PATHS
unset ANDROID_JAVA_TOOLCHAIN
@@ -543,6 +544,19 @@ function lunch()
printconfig
}
+# Tab completion for lunch.
+function _lunch()
+{
+ local cur prev opts
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ COMPREPLY=( $(compgen -W "${LUNCH_MENU_CHOICES[*]}" -- ${cur}) )
+ return 0
+}
+complete -F _lunch lunch
+
# Configures the build to build unbundled apps.
# Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME)
function tapas()
@@ -784,7 +798,7 @@ function gdbclient()
echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT"
echo >>"$OUT_ROOT/gdbclient.cmds" ""
- arm-eabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
+ arm-linux-androideabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
else
echo "Unable to determine build system output dir."
fi
@@ -906,10 +920,10 @@ function runhat()
{
# process standard adb options
local adbTarget=""
- if [ $1 = "-d" -o $1 = "-e" ]; then
+ if [ "$1" = "-d" -o "$1" = "-e" ]; then
adbTarget=$1
shift 1
- elif [ $1 = "-s" ]; then
+ elif [ "$1" = "-s" ]; then
adbTarget="$1 $2"
shift 2
fi
@@ -918,10 +932,9 @@ function runhat()
# runhat options
local targetPid=$1
- local outputFile=$2
if [ "$targetPid" = "" ]; then
- echo "Usage: runhat [ -d | -e | -s serial ] target-pid [output-file]"
+ echo "Usage: runhat [ -d | -e | -s serial ] target-pid"
return
fi
@@ -931,18 +944,14 @@ function runhat()
return
fi
- adb ${adbOptions} shell >/dev/null mkdir /data/misc
- adb ${adbOptions} shell chmod 777 /data/misc
-
- # send a SIGUSR1 to cause the hprof dump
+ # issue "am" command to cause the hprof dump
+ local devFile=/sdcard/hprof-$targetPid
echo "Poking $targetPid and waiting for data..."
- adb ${adbOptions} shell kill -10 $targetPid
+ adb ${adbOptions} shell am dumpheap $targetPid $devFile
echo "Press enter when logcat shows \"hprof: heap dump completed\""
echo -n "> "
read
- local availFiles=( $(adb ${adbOptions} shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') )
- local devFile=/data/misc/${availFiles[0]}
local localFile=/tmp/$$-hprof
echo "Retrieving file $devFile..."
@@ -993,6 +1002,21 @@ function isviewserverstarted()
adb shell service call window 3
}
+function key_home()
+{
+ adb shell input keyevent 3
+}
+
+function key_back()
+{
+ adb shell input keyevent 4
+}
+
+function key_menu()
+{
+ adb shell input keyevent 82
+}
+
function smoketest()
{
if [ ! "$ANDROID_PRODUCT_OUT" ]; then