5 echo "Usage: lldb-android [-d <DEVICE>] <package>."
10 adb
-s "$DEVICE" shell
"$@"
13 while getopts "d:" option
; do
22 if [ "$1" == "" ]; then
31 if [ "$DEVICE" = "" ]; then
32 DEVICE_COUNT
=`adb devices | grep 'device$' | wc -l`
33 if [ $DEVICE_COUNT -eq 1 ]; then
34 DEVICE
=`adb devices | grep 'device$' | awk -F"\t+" '{print $1}'`
38 if [ -z $DEVICE ]; then
39 echo "Unable to find a device."
43 echo "Device: $DEVICE"
45 for i
in 1 2 3 4 5; do
46 PID
=$
(shell
"ps" |
grep -E "\b$PKG\b$" |
awk -F' +' '{print $2}')
48 if [ "$PID" != "" ]; then
54 if [ "$PID" == "" ]; then
55 echo "Can't find process pid."
59 START_FILE
=/tmp
/lldb_commands.
$DEVICE.
$PID
62 platform select remote-android
63 platform connect connect://[$DEVICE]:6101
64 settings set auto-confirm true
65 settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd
66 process attach -p $PID
67 process handle -p true -n true -s false SIGPWR SIGXCPU SIGTTIN
68 p (void)monodroid_clear_lldb_wait()" > $START_FILE