Creating adb scripts
By redirecting adb's standard
input file at invocation, adb can be
directed to read commands from a text file
instead of the keyboard.
To redirect the standard input, use the standard redirection
symbol < and supply a filename.
For example:
adb sample <scriptThe file supplied must contain valid adb commands. Such files are called script files, and can be used with any invocation of the debugger.
Scripts are typically used to display the contents of core files after a program error. For example, this file containing the following commands will display most relevant information about a program error:
120$w 4095$s $v =3n $m =3n"C Stack Backtrace" $C =3n"C External Variables" $e =3n"Registers" $r 0$s =3n"Data Segment" <b,-1/8xna