公司android培训之基础debug

平台为android4.4系统。

一,烧录boot的方法:TFTP

1.将要烧录的boot.exe.bin放到指定路径下,打开tftp工具选择路径下的boot文档

2.开机长按esc键进入Uboot 

设置并保存tftp服务器的ip地址,env set serverip,ip为电脑的ip地址,192.168.2.*

设置并保存默认网关,env set gatewayip,192.168.2.1

设置并保存板子的ip,env set ipaddr,192.168.2.*

3.执行命令,

tftp 0x1500000 boot.exe.bin

go 0x1500000 boot.exe.bin

0x1500000为写boot的寄存器

借助env print/help 可以查看打印和帮助信息。

二,adb debug命令:Android Debug Bridge调试桥的作用

1.查看log的命令:

(1).

$adb shell

# logcat -c  (c-----Clears (flushes) the entire log and exits)

logcat -d (d-----Dumps the log to the screen and exits)

(2)也可以把logcat作为adb的命令

$ adb logcat ....

下面是logcat常用选项

The following table describes the command line options of logcat.

OptionDescription
-b <buffer>Loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default. See Viewing Alternative Log Buffers.
-cClears (flushes) the entire log and exits.
-dDumps the log to the screen and exits.
-f <filename>Writes log message output to <filename>. The default is stdout.
-gPrints the size of the specified log buffer and exits.
-n <count>Sets the maximum number of rotated logs to <count>. The default value is 4. Requires the-r option.
-r <kbytes>Rotates the log file every <kbytes> of output. The default value is 16. Requires the-f option.
-sSets the default filter spec to silent.
-v <format>Sets the output format for log messages. The default is brief format. For a list of supported formats, seeControlling Log Output Format.

2.install apk

(1)通过net的方式

首先连上虚拟机,adb connect /disconnect 192.168.2.* 192.168.2.*为虚拟机的ip地址

执行adb命令将com.***.apk安装到data/app/路径下 adb  install com.***.apk  data/app/

data/data/路径下是apk的安装历史记录

也可以将执行adb命令com.***.apk安装到system/app//路径下 adb install com.***.apk system/app/

adb push com.***.apk system/app/ 系统会自动安装apk################adb push com.***.apk data/app/只是将apk复制到data/app/路径下

(2)通过U盘copy的方式

首先要插上带有apk的U盘,通过挂载方式mount  -o remount  rw /system/  修改system文件夹的读写方式。

cd mnt/     copy   com.***.apk  system/app/ 或者copy  com.***.apk data/app/

再执行install动作

3.uninstall apk      uninstall com.***.apk

4. /system/framework/.jar档可以直接替换用来debug,但是要多执行几次sync动作,需要重启平台,adb connect 192.168.2.*?

init.rc不可直接替换。

5.ps命令:只是进程瞬间的状态,并不连续

kill -KILL( PID)强迫进程号为PID的进程立即停止,并不执行清理任务

kill -STOP( PID)停止进程号为PID的进程,并不消灭进程

6.top命令:可以实时监控进程状态

top命令的网页链接http://os.51cto.com/art/201205/334729_all.htm

7.adb命令的网页链接http://developer.android.com/tools/help/adb.html

8.平台的模块编译:

m:编译所有的模块 
mm
:编译当前目录下的模块,当前目录下要有Android.mk文件 
mmm
:编译指定路径下的模块,指定路径下要有Android.mk文件 

想使用这些命令,首先需要在android源码根目录执行. build/envsetup.sh 脚本设置环境

#source ./build/envsetup.sh或者#. build/envsetup.sh

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值