3 # Run the code in test.jar on the device. The jar should contain a top-level
4 # class named Main to run.
7 # --quiet -- don't chatter
8 # --fast -- use the fast interpreter (the default)
10 # --portable -- use the portable interpreter
11 # --debug -- wait for debugger to attach
12 # --zygote -- use the zygote (if so, all other options are ignored)
13 # --dev -- development mode
14 # --no-verify -- turn off verification (on by default)
15 # --no-optimize -- turn off optimization (on by default)
16 # --no-precise -- turn off precise GC (on by default)
19 if [ "$QUIET" = "n" ]; then
33 if [ "x$1" = "x--quiet" ]; then
36 elif [ "x$1" = "x--fast" ]; then
38 msg "Using fast interpreter"
40 elif [ "x$1" = "x--jit" ]; then
44 elif [ "x$1" = "x--portable" ]; then
46 msg "Using portable interpreter"
48 elif [ "x$1" = "x--debug" ]; then
51 elif [ "x$1" = "x--zygote" ]; then
53 msg "Spawning from zygote"
55 elif [ "x$1" = "x--dev" ]; then
58 elif [ "x$1" = "x--no-verify" ]; then
61 elif [ "x$1" = "x--no-optimize" ]; then
64 elif [ "x$1" = "x--no-precise" ]; then
67 elif [ "x$1" = "x--" ]; then
70 elif expr "x$1" : "x--" >/dev/null 2>&1; then
71 echo "unknown option: $1" 1>&2
78 if [ "$ZYGOTE" = "n" ]; then
79 if [ "x$INTERP" = "x" ]; then
81 msg "Using fast interpreter by default"
84 if [ "$OPTIMIZE" = "y" ]; then
85 if [ "$VERIFY" = "y" ]; then
86 DEX_OPTIMIZE="-Xdexopt:verified"
88 DEX_OPTIMIZE="-Xdexopt:all"
90 msg "Performing optimizations"
92 DEX_OPTIMIZE="-Xdexopt:none"
93 msg "Skipping optimizations"
96 if [ "$VERIFY" = "y" ]; then
98 msg "Performing verification"
100 DEX_VERIFY="-Xverify:none"
101 msg "Skipping verification"
105 msg "------------------------------"
107 if [ "$QUIET" = "n" ]; then
108 adb push test.jar /data
109 adb push test-ex.jar /data
111 adb push test.jar /data >/dev/null 2>&1
112 adb push test-ex.jar /data >/dev/null 2>&1
115 if [ "$DEBUG" = "y" ]; then
116 DEX_DEBUG="-agentlib:jdwp=transport=dt_android_adb,server=y,suspend=y"
119 if [ "$PRECISE" = "y" ]; then
120 GC_OPTS="-Xgc:precise -Xgenregmap"
122 GC_OPTS="-Xgc:noprecise"
125 if [ "$ZYGOTE" = "y" ]; then
126 adb shell cd /data \; dvz -classpath test.jar Main "$@"
128 adb shell cd /data \; dalvikvm $DEX_VERIFY $DEX_OPTIMIZE $DEX_DEBUG \
129 $GC_OPTS -cp test.jar "-Xint:${INTERP}" -ea Main "$@"