[Reprinted] records of commonly used Debugging techniques for Android development and android debugging
ANDROID debugging technology:
1) Ps command
Ls-l/proc/27/
The cat/proc/27/cmdline # cmdline file indicates the command line of the process.
The cat/proc/27/status # status file indicates that information about the process is obtained. # Stat contains more information, but it is difficult to read.
The cat/proc/27/task # task file indicates the process information.
2) Run vmstat to view the virtual memory statistics.
3) top statistics on CPU consumption
4) dumpstat dumpsys
# Adb shell dumpstat | grep CPU
5) dmesg
6) ioctl
Ioctl-l 16-r/dev/graphics/fb0 0x4600
Android-specific Debugging commands:
1) netcfg
2) service
1. service list
Lists All running services on the local machine.
Service call:
Service call phone <span style = "color: # FF0000;"> 2 </span> s16 "123"
Service call isms <span style = "color: # FF0000;"> 4 </span> s16 "12345678" s16 "" s16 "hello world! "S16" "s16 ""
3) am
# Am start-n com. android. music/com. android. music. MusicBrowserActivity
# Am start-n com. android. music/com. android. music. VideoBrowserActivity
# Am start-n com. android. music/com. android. music. MediaPlaybackActivity
The start method of Camera (Camera) is as follows:
# Am start-n com. android. camera/com. android. camera. Camera
Browser is started as follows:
# Am start-n com. android. browser/com. android. browser. BrowserActivity
Start the browser:
Am start-a android. intent. action. VIEW-d http://www.google.cn/
Call number:
Am start-a android. intent. action. CALL-d tel: 10086
Start google map to go directly to Beijing:
Am start-a android. intent. action. VIEW geo: 0, 0? Q = beijing
Appendix: android shell table
Dumpcrash
Sh
Date
Am
Hciattach
Dd
Dumpstate
Sdptool
Cmp
Input
Logcat
Cat
Itr
Servicemanager
Dmsg
Monkey
Alibaba-daemon
Df
Pm
Debug_tool
Getevent
Svc
Flash_image
Getprop
Ssltest
Installd
Hd
Debugadh
Dvz
Id
Dhcpcd
Hostapd
Ifconfig
Hostapd_cli
Htclogkernel
Insmod
Fillup
Mountd
Ioctl
Linker
Qemud
Kill
Logwrapper
Radiooptions
Ln
Telnetd
Toolbox
Log
Iftop
Hcid
Lsmod
Mkdosfs
Route
Ls
Mount
Setprop
Mkdir
Mv
Sleep
Dumpsys
Notify
Setconsole
Service
Netstat
Smd
Playmp3
Printenv
Stop
Sdutil
Reboot
Top
Rild
Ps
Start
Dalvikvm
Renice
Umount
Dexopt
Rm
Vmstat
Surfaceflinger
Rmdir
Wipe
App_process
Rmmod
Watchprops
Mediaserver
Sendevent
Sync
System_server
Schedtop
Netcfg
Ping
Chmod
Common debugging methods in Android Development
You can enter the required string or expression (in the string form) in the brackets of log. I () where you want to view the information ). Then, you can see in logcat whether the sentence is executed or whether the obtained information is the information you want.
How to debug android Development
Generally, you can handle minor errors in logCat as prompted. Sometimes you need to debug and set a breakpoint line by line. errors are generally the same as developing java programs.