[Reprinted] records of commonly used Debugging techniques for Android development and android debugging

Source: Internet
Author: User

[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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.