envsetup.sh revision b6c1cf6de79035f58b512f4400db458c8401379a
1function help() {
2cat <<EOF
3Invoke ". envsetup.sh" from your shell to add the following functions to your environment:
4- croot:   Changes directory to the top of the tree.
5- m:       Makes from the top of the tree.
6- mm:      Builds all of the modules in the current directory.
7- mmm:     Builds all of the modules in the supplied directories.
8- cgrep:   Greps on all local C/C++ files.
9- jgrep:   Greps on all local Java files.
10- resgrep: Greps on all local res/*.xml files.
11
12Look at the source to view more functions. The complete list is:
13EOF
14    T=$(gettop)
15    local A
16    A=""
17    for i in `cat $T/build/envsetup.sh | sed -n "/^function /s/function \([a-z_]*\).*/\1/p" | sort`; do
18      A="$A $i"
19    done
20    echo $A
21}
22
23# Get the value of a build variable as an absolute path.
24function get_abs_build_var()
25{
26    T=$(gettop)
27    if [ ! "$T" ]; then
28        echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
29        return
30    fi
31    CALLED_FROM_SETUP=true \
32      make --no-print-directory -C "$T" -f build/core/envsetup.mk dumpvar-abs-$1
33}
34
35# Get the exact value of a build variable.
36function get_build_var()
37{
38    T=$(gettop)
39    if [ ! "$T" ]; then
40        echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
41        return
42    fi
43    CALLED_FROM_SETUP=true \
44      make --no-print-directory -C "$T" -f build/core/envsetup.mk dumpvar-$1
45}
46
47function setpaths()
48{
49    T=$(gettop)
50    if [ ! "$T" ]; then
51        echo "Couldn't locate the top of the tree.  Try setting TOP."
52        return
53    fi
54
55    ##################################################################
56    #                                                                #
57    #              Read me before you modify this code               #
58    #                                                                #
59    #   This function sets ANDROID_BUILD_PATHS to what it is adding  #
60    #   to PATH, and the next time it is run, it removes that from   #
61    #   PATH.  This is required so lunch can be run more than once   #
62    #   and still have working paths.                                #
63    #                                                                #
64    ##################################################################
65
66
67    # out with the old
68    if [ -n $ANDROID_BUILD_PATHS ] ; then
69        export PATH=${PATH/$ANDROID_BUILD_PATHS/}
70    fi
71
72    # and in with the new
73    CODE_REVIEWS=
74    prebuiltdir=$(getprebuilt)
75    export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain-eabi-4.2.1/bin
76    export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
77    export ANDROID_QTOOLS=$T/development/emulator/qtools
78    export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
79    export PATH=$PATH$ANDROID_BUILD_PATHS
80    
81    export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
82    export OUT=$ANDROID_PRODUCT_OUT
83
84    # needed for building linux on MacOS    
85    # TODO: fix the path
86    #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
87}
88
89function printconfig()
90{
91    echo "=============================================="
92    echo "Build System Configuration"
93    echo
94    echo "   TARGET_SIMULATOR:  " $TARGET_SIMULATOR
95    echo "   TARGET_BUILD_TYPE: " $TARGET_BUILD_TYPE
96    echo "   TARGET_PRODUCT:    " $TARGET_PRODUCT
97    echo "=============================================="
98}
99
100function set_stuff_for_environment()
101{
102    if [ "$TARGET_SIMULATOR" -a "$TARGET_PRODUCT" -a "$TARGET_BUILD_TYPE" ]
103    then
104        settitle
105        printconfig
106        setpaths
107        set_sequence_number
108
109        # Don't try to do preoptimization until it works better on OSX.
110        export DISABLE_DEXPREOPT=true
111
112        export ANDROID_BUILD_TOP=$(gettop)
113    fi
114}
115
116function set_sequence_number()
117{
118    export BUILD_ENV_SEQUENCE_NUMBER=8
119}
120
121function settitle()
122{
123        if [ "$STAY_OFF_MY_LAWN" = "" ]; then
124                TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT)
125                export PROMPT_COMMAND='echo -ne "\033]0;[${TARGET_PRODUCT}] ${USER}@${HOSTNAME}: ${PWD}\007"'
126        fi
127}
128
129case `uname -s` in
130    Linux)
131        function choosesim()
132        {
133            echo "Build for the simulator or the device?"
134            echo "     1. Device"
135            echo "     2. Simulator"
136            echo
137
138            export TARGET_SIMULATOR=$1
139            while [ -z $TARGET_SIMULATOR ]
140            do
141                echo -n "Which would you like? [1] "
142                read ANSWER
143                case $ANSWER in
144                "")
145                    export TARGET_SIMULATOR=false
146                    ;;
147                1)
148                    export TARGET_SIMULATOR=false
149                    ;;
150                2)
151                    export TARGET_SIMULATOR=true
152                    ;;
153                *)
154                    echo
155                    echo "I didn't understand your response.  Please try again."
156                    echo
157                    continue
158                    ;;
159                esac
160            done
161
162            set_stuff_for_environment
163        }
164        ;;
165    *)
166        function choosesim()
167        {
168            echo "Only device builds are supported for" `uname -s`
169            echo "     Forcing TARGET_SIMULATOR=false"
170            echo
171            echo -n "Press enter: "
172            read
173
174            export TARGET_SIMULATOR=false
175            set_stuff_for_environment
176        }
177        ;;
178esac
179
180function choosetype()
181{
182    echo "Build type choices are:"
183    echo "     1. release"
184    echo "     2. debug"
185    echo
186
187    if [ $TARGET_SIMULATOR = "false" ] ; then
188        DEFAULT_NUM=1
189        DEFAULT_VALUE=release
190    else
191        DEFAULT_NUM=2
192        DEFAULT_VALUE=debug
193    fi
194
195    export TARGET_BUILD_TYPE=$1
196    while [ -z $TARGET_BUILD_TYPE ]
197    do
198        echo -n "Which would you like? ["$DEFAULT_NUM"] "
199        read ANSWER
200        case $ANSWER in
201        "")
202            export TARGET_BUILD_TYPE=$DEFAULT_VALUE
203            ;;
204        1)
205            export TARGET_BUILD_TYPE=release
206            ;;
207        2)
208            export TARGET_BUILD_TYPE=debug
209            ;;
210        *)
211            echo
212            echo "I didn't understand your response.  Please try again."
213            echo
214            continue
215            ;;
216        esac
217    done
218
219    set_stuff_for_environment
220}
221
222function chooseproduct()
223{
224    # Find the makefiles that must exist for a product.
225    # Send stderr to /dev/null in case partner isn't present.
226    choices=(`/bin/ls build/target/board/*/BoardConfig.mk vendor/*/*/BoardConfig.mk 2> /dev/null`)
227    count=${#choices[@]}
228    index=0
229    echo "Product choices are:"
230
231    while [ "$index" -lt "$count" ]
232    do
233        # The product name is the name of the directory containing
234        # the makefile we found, above.
235        choices[$index]=`dirname ${choices[$index]} | xargs basename`
236        echo "     $index. ${choices[$index]}"
237        let "index = $index + 1"
238    done
239
240    if [ "x$TARGET_PRODUCT" != x ] ; then
241        default_value=$TARGET_PRODUCT
242    else
243        if [ "$TARGET_SIMULATOR" = true ] ; then
244            default_value=sim
245        else
246            default_value=generic
247        fi
248    fi
249
250    export TARGET_PRODUCT=$1
251    while [ -z "$TARGET_PRODUCT" ]
252    do
253        echo -n "which would you like? [$default_value] "
254        read ANSWER
255        if [ -z "$ANSWER" ] ; then
256            export TARGET_PRODUCT=$default_value
257        elif [ "$ANSWER" -lt "$count" ] ; then
258            export TARGET_PRODUCT=${choices[$ANSWER]}
259        fi
260    done
261
262    set_stuff_for_environment
263}
264
265function tapas()
266{
267    choosecombo
268}
269
270function choosecombo()
271{
272    choosesim $1
273
274    echo
275    echo
276    choosetype $2
277
278    echo
279    echo
280    chooseproduct $3
281
282    echo
283    set_stuff_for_environment
284}
285
286function print_lunch_menu()
287{
288    local uname=$(uname)
289
290    echo
291    echo "You're building on" $uname
292
293    echo
294    echo "Lunch menu... pick a combo:"
295    echo "     1. device    release  generic"
296    if [ $uname = Linux ]
297    then
298        echo "     2. simulator debug    sim"
299    else
300        echo "     <no simulator on $uname>"
301    fi
302    echo
303}
304
305function lunch()
306{
307    if [ "$1" ] ; then
308        ANSWER=$1
309    else
310        print_lunch_menu
311        echo -n "Which would you like? "
312        read ANSWER
313    fi
314
315    if [ $ANSWER -eq 2 -a $(uname) != Linux ]
316    then
317        echo "Simulator builds are not supported on this platform"
318        ANSWER=0
319    fi
320
321    case $ANSWER in
322    1)
323        export TARGET_SIMULATOR=false
324        export TARGET_BUILD_TYPE=release
325        export TARGET_PRODUCT=generic
326        ;;
327    2)
328        export TARGET_SIMULATOR=true
329        export TARGET_BUILD_TYPE=debug
330        export TARGET_PRODUCT=sim
331        ;;
332    *)
333        echo
334        if [ "$1" ] ; then
335            echo "I didn't understand your request.  Please try again"
336            print_lunch_menu
337        else
338            echo "I didn't understand your response.  Please try again."
339        fi
340        return
341        ;;
342    esac
343
344    echo
345    set_stuff_for_environment
346}
347
348function partner_setup()
349{
350   # Set up the various TARGET_ variables so that we can use
351   # the lunch helper functions to build the PATH.
352   #
353   if [ $# -lt 1 ] ; then
354       export TARGET_PRODUCT=generic
355       echo "Usage: partner_setup <product-name>" >&2
356       echo "    Defaulting to product \"$TARGET_PRODUCT\"" >&2
357   else
358       export TARGET_PRODUCT=$1
359   fi
360   if [ $TARGET_PRODUCT = "sim" ] ; then
361       export TARGET_SIMULATOR=true
362       export TARGET_BUILD_TYPE=debug
363   else
364       export TARGET_SIMULATOR=false
365       export TARGET_BUILD_TYPE=release
366   fi
367
368   # setpaths will fix up the PATH to point to the tools, and will also
369   # set ANDROID_PRODUCT_OUT.  set_sequence_number is necessary for
370   # certain consistency checks within the build system.
371   #
372   setpaths
373   set_sequence_number
374
375   # Clear the TARGET_ variables so that the build is based purely on
376   # buildspec.mk and the commandline, except for sim
377   #
378   if [ $TARGET_PRODUCT != sim ] ; then
379       export TARGET_PRODUCT=
380       export TARGET_SIMULATOR=
381       export TARGET_BUILD_TYPE=
382   fi
383   export ANDROID_BUILD_TOP=$(gettop)
384   # Don't try to do preoptimization until it works better on OSX.
385   export DISABLE_DEXPREOPT=true
386
387   echo "   ANDROID_PRODUCT_OUT: $ANDROID_PRODUCT_OUT"
388   echo "   ANDROID_BUILD_TOP:   $ANDROID_BUILD_TOP"
389}
390
391function gettop
392{
393    TOPFILE=build/core/envsetup.mk
394    if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
395        echo $TOP
396    else
397        if [ -f $TOPFILE ] ; then
398            echo $PWD
399        else
400            # We redirect cd to /dev/null in case it's aliased to
401            # a command that prints something as a side-effect
402            # (like pushd)
403            HERE=$PWD
404            T=
405            while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
406                cd .. > /dev/null
407                T=$PWD
408            done
409            cd $HERE > /dev/null
410            if [ -f "$T/$TOPFILE" ]; then
411                echo $T
412            fi
413        fi
414    fi
415}
416
417function m()
418{
419    T=$(gettop)
420    if [ "$T" ]; then
421        make -C $T $@
422    else
423        echo "Couldn't locate the top of the tree.  Try setting TOP."
424    fi
425}
426
427function findmakefile()
428{
429    TOPFILE=build/core/envsetup.mk
430    # We redirect cd to /dev/null in case it's aliased to
431    # a command that prints something as a side-effect
432    # (like pushd)
433    HERE=$PWD
434    T=
435    while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
436        T=$PWD
437        if [ -f "$T/Android.mk" ]; then
438            echo $T/Android.mk
439            cd $HERE > /dev/null
440            return
441        fi
442        cd .. > /dev/null
443    done
444    cd $HERE > /dev/null
445}
446
447function mm()
448{
449    # If we're sitting in the root of the build tree, just do a
450    # normal make.
451    if [ -f build/core/envsetup.mk -a -f Makefile ]; then
452        make $@
453    else
454        # Find the closest Android.mk file.
455        T=$(gettop)
456        M=$(findmakefile)
457        if [ ! "$T" ]; then
458            echo "Couldn't locate the top of the tree.  Try setting TOP."
459        elif [ ! "$M" ]; then
460            echo "Couldn't locate a makefile from the current directory."
461        else
462            ONE_SHOT_MAKEFILE=$M make -C $T files $@
463        fi
464    fi
465}
466
467function mmm()
468{
469    T=$(gettop)
470    if [ "$T" ]; then
471        MAKEFILE=
472        ARGS=
473        for DIR in $@ ; do
474            DIR=`echo $DIR | sed -e 's:/$::'`
475            if [ -f $DIR/Android.mk ]; then
476                TO_CHOP=`echo $T | wc -c | tr -d ' '`
477                TO_CHOP=`expr $TO_CHOP + 1`
478                MFILE=`echo $PWD | cut -c${TO_CHOP}-`
479                if [ "$MFILE" = "" ] ; then
480                    MFILE=$DIR/Android.mk
481                else
482                    MFILE=$MFILE/$DIR/Android.mk
483                fi
484                MAKEFILE="$MAKEFILE $MFILE"
485            else
486                if [ "$DIR" = snod ]; then
487                    ARGS="$ARGS snod"
488                elif [ "$DIR" = showcommands ]; then
489                    ARGS="$ARGS showcommands"
490                else
491                    echo "No Android.mk in $DIR."
492                fi
493            fi
494        done
495        ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T files $ARGS
496    else
497        echo "Couldn't locate the top of the tree.  Try setting TOP."
498    fi
499}
500
501function croot()
502{
503    T=$(gettop)
504    if [ "$T" ]; then
505        cd $(gettop)
506    else
507        echo "Couldn't locate the top of the tree.  Try setting TOP."
508    fi
509}
510
511function pid()
512{
513   local EXE="$1"
514   if [ "$EXE" ] ; then
515       local PID=`adb shell ps | fgrep $1 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/'`
516       echo "$PID"
517   else
518       echo "usage: pid name"
519   fi
520}
521
522function gdbclient()
523{
524   OUT_ROOT=$(get_abs_build_var PRODUCT_OUT)
525   OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED)
526   OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
527   OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
528   PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
529   if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
530       local EXE="$1"
531       if [ "$EXE" ] ; then
532           EXE=$1
533       else
534           EXE="app_process"
535       fi
536
537       local PORT="$2"
538       if [ "$PORT" ] ; then
539           PORT=$2
540       else
541           PORT=":5039"
542       fi
543
544       local PID
545       local PROG="$3"
546       if [ "$PROG" ] ; then
547           PID=`pid $3`
548           adb forward "tcp$PORT" "tcp$PORT"
549           adb shell gdbserver $PORT --attach $PID &
550           sleep 2
551       else
552               echo ""
553               echo "If you haven't done so already, do this first on the device:"
554               echo "    gdbserver $PORT /system/bin/$EXE"
555                   echo " or"
556               echo "    gdbserver $PORT --attach $PID"
557               echo ""
558       fi
559
560       echo >|"$OUT_ROOT/gdbclient.cmds" "set solib-absolute-prefix $OUT_SYMBOLS"
561       echo >>"$OUT_ROOT/gdbclient.cmds" "set solib-search-path $OUT_SO_SYMBOLS"
562       echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT"
563       echo >>"$OUT_ROOT/gdbclient.cmds" ""
564
565       arm-eabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
566  else
567       echo "Unable to determine build system output dir."
568   fi
569
570}
571
572case `uname -s` in
573    Darwin)
574        function sgrep()
575        {
576            find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml)' -print0 | xargs -0 grep --color -n "$@"
577        }
578
579        ;;
580    *)
581        function sgrep()
582        {
583            find . -type f -iregex '.*\.\(c\|h\|cpp\|S\|java\|xml\)' -print0 | xargs -0 grep --color -n "$@"
584        }
585        ;;
586esac
587
588function jgrep()
589{
590    find . -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
591}
592
593function cgrep()
594{
595    find . -type f -name "*\.c*" -print0 | xargs -0 grep --color -n "$@"
596}
597
598function resgrep()
599{
600    for dir in `find . -name res -type d`; do find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"; done;
601}
602
603case `uname -s` in
604    Darwin)
605        function mgrep()
606        {
607            find -E . -type f -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -print0 | xargs -0 grep --color -n "$@"
608        }
609
610        function treegrep()
611        {
612            find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml)' -print0 | xargs -0 grep --color -n -i "$@"
613        }
614
615        ;;
616    *)
617        function mgrep()
618        {
619            find . -regextype posix-egrep -iregex '\(.*\/Makefile\|.*\/Makefile\..*\|.*\.make\|.*\.mak\|.*\.mk\)'  -type f -print0 | xargs -0 grep --color -n "$@"
620        }
621
622        function treegrep()
623        {
624            find . -regextype posix-egrep -iregex '.*\.(c|h|cpp|S|java|xml)' -type f -print0 | xargs -0 grep --color -n -i "$@"
625        }
626
627        ;;
628esac
629
630function getprebuilt
631{
632    get_abs_build_var ANDROID_PREBUILTS
633}
634
635
636function tracedmdump()
637{
638    T=$(gettop)
639    if [ ! "$T" ]; then
640        echo "Couldn't locate the top of the tree.  Try setting TOP."
641        return
642    fi
643    prebuiltdir=$(getprebuilt)
644    KERNEL=$T/prebuilt/android-arm/vmlinux-qemu
645
646    TRACE=$1
647    if [ ! "$TRACE" ] ; then
648        echo "usage:  tracedmdump  tracename"
649        return
650    fi
651
652    BASETRACE=$(basename $TRACE)
653    if [ "$BASETRACE" = "$TRACE" ] ; then
654        TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE
655    fi
656
657    echo "post-processing traces..."
658    rm -f $TRACE/qtrace.dexlist
659    post_trace $TRACE
660    if [ $? -ne 0 ]; then
661        echo "***"
662        echo "*** Error: malformed trace.  Did you remember to exit the emulator?"
663        echo "***"
664        return
665    fi
666    echo "generating dexlist output..."
667    /bin/ls $ANDROID_PRODUCT_OUT/system/framework/*.jar $ANDROID_PRODUCT_OUT/system/app/*.apk $ANDROID_PRODUCT_OUT/data/app/*.apk 2>/dev/null | xargs dexlist > $TRACE/qtrace.dexlist
668    echo "generating dmtrace data..."
669    q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace || return
670    echo "generating html file..."
671    dmtracedump -h $TRACE/dmtrace >| $TRACE/dmtrace.html || return
672    echo "done, see $TRACE/dmtrace.html for details"
673    echo "or run:"
674    echo "    traceview $TRACE/dmtrace"
675}
676
677function runhat()
678{
679    targetPid=$1
680    outputFile=$2
681
682    if [ "$targetPid" = "" ]; then
683        echo "Usage: runhat target-pid [output-file]"
684        return
685    fi
686
687    adb shell >/dev/null mkdir /data/misc
688    adb shell chmod 777 /data/misc
689
690    echo "Poking $targetPid and waiting for data..."
691    adb shell kill -10 $targetPid
692    echo "Press enter when logcat shows \"GC freed ## objects / ## bytes\""
693    echo -n "> "
694    read
695
696    availFiles=( $(adb shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') )
697    devHeadFile=/data/misc/${availFiles[0]}
698    devTailFile=/data/misc/${availFiles[1]}
699
700    localHeadFile=/tmp/$$-hprof-head
701    localTailFile=/tmp/$$-hprof-tail
702
703    echo "Retrieving file $devHeadFile..."
704    adb pull $devHeadFile $localHeadFile
705    echo "Retrieving file $devTailFile..."
706    adb pull $devTailFile $localTailFile
707
708    combinedFile=$outputFile
709    if [ "$combinedFile" = "" ]; then
710        combinedFile=/tmp/$$.hprof
711    fi
712
713    cat $localHeadFile $localTailFile >$combinedFile
714    adb shell rm $devHeadFile
715    adb shell rm $devTailFile
716    rm $localHeadFile
717    rm $localTailFile
718
719    echo "Running hat on $combinedFile"
720    echo "View the output by pointing your browser at http://localhost:7000/"
721    echo ""
722    hat $combinedFile
723}
724
725function getbugreports()
726{
727    reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`)
728
729    if [ ! "$reports" ]; then
730        echo "Could not locate any bugreports."
731        return
732    fi
733
734    count=${#reports[@]}
735    index=0
736
737    while [ "$index" -lt "$count" ]
738    do
739        echo "/sdcard/bugreports/${reports[$index]}"
740        adb pull /sdcard/bugreports/${reports[$index]} ${reports[$index]}
741        gunzip ${reports[$index]}
742        let "index = $index + 1"
743    done
744}
745
746function startviewserver()
747{
748    port=4939
749    if [ $# -gt 0 ]; then
750            port=$1
751    fi
752    adb shell service call window 1 i32 $port
753}
754
755function stopviewserver()
756{
757    adb shell service call window 2
758}
759
760function isviewserverstarted()
761{
762    adb shell service call window 3
763}
764
765function smoketest()
766{
767    if [ ! "$ANDROID_PRODUCT_OUT" ]; then
768        echo "Couldn't locate output files.  Try running 'lunch' first." >&2
769        return
770    fi
771    T=$(gettop)
772    if [ ! "$T" ]; then
773        echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
774        return
775    fi
776
777    (cd "$T" && mmm tests/SmokeTest) &&
778      adb uninstall com.android.smoketest > /dev/null &&
779      adb uninstall com.android.smoketest.tests > /dev/null &&
780      adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk &&
781      adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTest.apk &&
782      adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner
783}
784
785