Android总结(adb命令等)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Android笔记adbshell说明:详细内容请参考《EmbeddedAndroid》常用命令adbversionadbpushlocalremote-copyfile/dirtodeviceadbpullremote[local]-copyfile/dirfromdeviceadbsync[directory]-copyhost-deviceonlyifchanged(-lmeanslistbutdon'tcopy)(see'adbhelpall')adbshell-runremoteshellinteractivelyadbshellcommand-runremoteshellcommandadbemucommand-runemulatorconsolecommandadbdevicesadbconnect172.27.126.8adb-dget-serialnoadb-dstatus-window查看cpu信息:adb-dshellcat/proc/cpuinfo实时打印logcat:adb-dlogcat实时打印的主要有:logcatmain,logcatradio,logcatevents,tcpdump,还有高通平台的还会有QXDM日志ddms抓的log通常是应用程序打印的日志文件1)打印应用程序的log:adblogcat-bmain-vtimeapp.log2)打印射频相关的log:adblogcat-bradio-vtimeradio.log3)打印系统事件(如触屏)的日志:adblogcat-bevents-vtime4)使用tcpdump抓包:adbshelltcpdump-s10000-w/sdcard/capture.pcap其他:通过高通芯片平台的QXDM抓取信息5)logcat#logcatActivityManager#logcat-sActivityManager查看系统状态信息:adb-dbugreportadbbugreportbugreport.logadbbugreport包含了adbshelldmesg,adbshelldumpstate,adbshelldumpsys信息。1)查看kernel的log:adbshelldmesgldmesg_kernel.logdmesg(命令adbshelldmesgldmesg_kernel.log)是kernel的log,凡是跟kernel相关的,比如driver出了问题(相机,蓝牙,usb,启动,电池温度,等等)。2)查看系统状态:adb-dshelldumpstate(需要root权限)dumpstate是系统状态信息,包括手机当前的内存信息、cpu信息、logcat缓存,kernel缓存等等。3)查看系统service:adbshelldumpsysadbshelldumpsys这个是关于系统service的内容。更详尽的用法,比如查看system这个process的内存信息:adbshelldumpsysmeminfosystem文件系统相关命令adbpushacme_user_manual.pdf/data/localadbshellls/data/localadbpull/proc/cpuinfoadb-d-p~/android/beaglebone/out/target/product/beaglebone/syncadb-esyncdata?adbinstallFastBirds.apkadbuninstallcom.acme.fastbirds1)安装apk文件adbinstall*.apk此apk文件就被存入Linux的\data\app\里,2)移除apk文件adbshellrm*.apk或者cd\data\app\rm*.apk启动仿真器:emulator–wipe-data打印linux的debug信息:adbshelldmesgadbpushadbpull系统状态rebootadbrebootadbrebootbootloaderadbrebootrecoveryadbreboot-bootloaderadb-s172.27.126.8:7878shellnetcfgservice查看当前service:servicelistdumpsys查看当前running的serviceCurrentlyrunningservices:SurfaceFlingeraccessibilityaccountactivityalarmappwidgetaudiobackupbatterybatteryinfoclipboardconnectivitycontentcpuinfodevice_policydevicestoragemonitordiskstatsdropboxentropyhardware...#dumpsysCurrentlyrunningservices:DeviceManager3LMEncryption3LMServiceHtcAppUsageStatsServiceSurfaceFlingeraccessibilityaccountactivityalarmappwidgetaudiobackupbatterybatteryinfobluetoothbluetooth_a2dpbluetooth_hidbt_fm_managementclipboardconnectivitycontentcountry_detectorcpuinfodevice_policydevicestoragemonitordiskstatsdisplaydrm.drmManagerdropboxentropygfxinfohardwarehtc_checkinhtchardwarehtctelephonyhtctelephonyinternalinput_methodiphonesubinfoismslocationmedia.audio_flingermedia.audio_policymedia.cameramedia.playermeminfomountnetpolicynetstatsnetwork_managementnotificationpackagepermissionphonepowersamplingprofilersearchsecfirewallsecloadersensorservicesimphonebooksipstatusbarstub_activitystub_audiostub_iphonesubinfostub_ismsstub_locationstub_phonestub_telephony.registrytelephony.registrytextservicesthrottleuimodeusagestatsusbusbnetuserbehaviorvibratorwallpaperwifiwifip2pwindow查看powerManagerState:dumpsyspower如电池电量、背光灯及实际值、重力感应的配置等等。am(ActivityManager)ammonitor(监控当前Activity)amstart(启动程序)启动一个Activity:amstart[-D]INTENT启动一个应用程序:#amstart-n包(package)名/包名.活动(activity)名称启动的方法可以从每个应用的AndroidManifest.xml的文件中得到启动Music和Video(音乐和视频)#amstart-ncom.android.music/com.android.music.MusicBrowserActivity#amstart-ncom.android.music/com.android.music.VideoBrowserActivity#amstart-ncom.android.music/com.android.music.MediaPlaybackActivityCamera(照相机)的启动#amstart-ncom.android.camera/com.android.camera.CameraBrowser(浏览器)的启动#amstart-ncom.android.browser/com.android.browser.BrowserActivity启动浏览器:amstart-aandroid.intent.action.VIEW-d拨打电话:amstart-aandroid.intent.action.CALL-dtel:10086启动googlemap直接定位到北京:amstart-aandroid.intent.action.VIEWgeo:0,0?q=beijingps:需要修改对应的Intentpm(PackageManager)pmlistpackages(查看已安装的packages)pminstallFastBirds.apk(安装apk)pmuninstallcom.acme.fastbirds卸载pmlistpermission-groups查看已开通的权限:pmlistinstrumentationpmlistfeaturespmlistlibraries。。。svc(控制systemservice)svcAvailablecommands:helpShowinformationaboutthesubcommandspowerControlthepowermanagerdataControlmobiledataconnectivitywifiControltheWi-FimanagerusbControlUsbstatesvchelppowerusage:svcpowerstayon[true|false|usb|ac|wireless]Setthe'keepawakewhilepluggedin'setting.svcpowerreboot[reason]Performaruntimeshutdownandrebootdevicewithspecifiedreason.svcpowershutdownPerformaruntimeshutdownandpoweroffthedevice.svchelpwifiusage:svcwifi[enable|disable]TurnWi-Fionoroff.svcwifipreferSetWi-Fiasthepreferreddatanetworkime(InputMethodSystemservice)imeusage:imelist[-a][-s]imeenableIDimedisableIDimesetIDimelist(输入法列表)input(WindowManagersystemservice)inputUsage:input[source]command[arg...]usage:input...inputtextstringinputkeyeventkeycodenumberornameinput[touchscreen|touchpad]tapxyinput[touchscreen|touchpad]swipex1y1x2y2inputtrackballpressinputtrackballrolldxdyinputkeyevent3KEYCODE_HOME=3;/**Keycodeconstant:Homekey.*/KEYCODE_BACK=4;/**Keycodeconstant:Backkey.*/KEYCODE_CALL=5;/**Keycodeconstant:Callkey.*/KEYCODE_ENDCALL=6;

1 / 21
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功