[XPERIA X10 Android Development] anantshri:
Version 1.0 debug script

# DEBUG Log generation script created by Anant Shrivastava
# known as anantshri in XDA forum
# credit goes to B,J,Z and other developers.
# any specific code taken from other dev's have credit in place.
# incase i missed something send me a PM and i will add it.
debug()
{
#general debug listing.
echo "********** BUSYBOX *****************"
which
which busybox
busybox
echo "********** MOUNT *******************"
mount
cat /proc/mtd
echo "*************Command Permissions***************"
ls -l `which mount`
ls -l `which busybox`
ls -l `which sh`
ls -l `which chmod`
ls -l `which chwon`
ls -l `which grep`
ls -l `which sed`
ls -l `which awk`
echo "********** ROM SPECIFIC SETTINGS ***************"
cat /system/build.prop | grep "ro.build.id"
cat /system/build.prop | grep "ro.build.display.id"
cat /system/build.prop | grep "ro.build.version.incremental"
cat /system/build.prop | grep "ro.build.version.sdk"
cat /system/build.prop | grep "ro.build.version.release"
cat /system/build.prop | grep "ro.product.model"
cat /system/build.prop | grep "ro.modversion"
cat /system/build.prop | grep "ro.rommanager.developerid"
cat /system/build.prop | grep "ro.build.description"
cat /system/build.prop | grep "ro.build.fingerprint"
echo "************* KERNEL INFORMATION ****************"
uname -a
echo "************* DEFAULT PATH **********************"
echo $PATH
}
debug_bt()
{
echo "************* BackTrack Specific Log ************"
ls -l /sdcard/bt
ls -l /data/local/bt
ls -l `which bt`
ls -l `which stopbt`
ls -l `which startbt`
echo "************* VNC Config File *******************"
cat /data/local/bt/root/.vnc/xstartup

}
chk_recovery()
{
#
# Script (v1) to check for type of Recovery
# by DooMLoRD
#
# For Xperia X10 users only
#
echo "*********************** RECOVERY DETAILS ***************"
echo "Recovery disk's available"
if [ -e /system/bin/xrecovery.tar ]
then
echo "xRecovery FOUND!"
fi
if [ -e /system/recovtools/xrecovery.tar.gz ]
then
echo "FreeXperia Recovery FOUND! [TYPE 1]"
fi
if [ -e /system/recovery/recovery.tar.bz2 ]
then
echo "FreeXperia Recovery FOUND! [TYPE 2]"
fi
echo -n "Chargemon Configured Recovery : "
REC=`cat /system/bin/chargemon | grep tar | grep recovery | cut -f4 -d"/"`
if [ $REC == "xrecovery.tar" ]
then
echo "Xrecovery"
elif [ $REC == "xrecovery.tar.gz" ]
then
echo "FreeXperia Recovery"
elif [ $REC == "recovery.tar.bz2"]
then
echo "FreeXperia Recovery type 2"
fi
}
logcats()
{
echo "========== LOGCAT : MAIN ==================="
logcat -b main -d
echo "========== LOGCAT : EVENTS ================="
logcat -b events -d
echo "========== LOGCAT : RADIO =================="
logcat -b radio -d
echo "******** DALVIK STACK TRACE *********************"
cat `cat /system/build.prop | grep "dalvik.vm.stack-trace-file" | cut -f2 -d"="`
echo "******** Kernel Messages DMESG ******************"
dmesg
echo "******** LOG LAST KMESG *************************"
cat /proc/last_kmsg
}
export LOG_FILE=/data/local/debug_log.txt
echo "Creating DEBUG LOG please wait"
echo "Collection general information"
debug > $LOG_FILE 2>&1
echo "Checking Recovery installed on phone"
chk_recovery >> $LOG_FILE 2>&1
echo "Collecting BT specific information"
debug_bt >> $LOG_FILE 2>&1
echo "Collecting logcat's : main, events, radio + stack trace"
logcats >> $LOG_FILE 2>&1