Use *-testdex in libcore and jdwp testing.

These scripts are only used in a buildbot context, which only builds
the *-testdex jars.

Test: run-libcore-tests, run-jdwp-tests
Change-Id: Iea66e40c245170a4ecbafe711d23dec4e0506f0e
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh
index c7503bb..ac9f09a 100755
--- a/tools/run-jdwp-tests.sh
+++ b/tools/run-jdwp-tests.sh
@@ -125,6 +125,11 @@
     # Vogar knows which VM to use on host.
     vm_command=""
     shift
+  elif [[ "$1" == "--mode=device" ]]; then
+    # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
+    args=${args/$1}
+    args="$args --mode=device_testdex"
+    shift
   elif [[ "$1" == "--mode=jvm" ]]; then
     mode="ri"
     make_target_name="apache-harmony-jdwp-tests-host"
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index 68c4fd8..ea7464f 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -125,6 +125,9 @@
 while true; do
   if [[ "$1" == "--mode=device" ]]; then
     device_mode=true
+    # Remove the --mode=device from the arguments and replace it with --mode=device_testdex
+    vogar_args=${vogar_args/$1}
+    vogar_args="$vogar_args --mode=device_testdex"
     vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core.art"
     vogar_args="$vogar_args $(boot_classpath_arg /system/framework -testdex $BOOT_CLASSPATH_JARS)"
     shift