Android获取源代码、编译、命令
2010-06-22 02:35:00 来源:WEB开发网显示所有head分支:
$ git branch -a
显示
* android-2.6.27
remotes/origin/HEAD -> origin/android-2.6.27
remotes/origin/android-2.6.25
remotes/origin/android-2.6.27
remotes/origin/android-2.6.29
remotes/origin/android-goldfish-2.6.27
remotes/origin/android-goldfish-2.6.29
我们选取最新的android-goldfish-2.6.29,其中goldfish是android的模拟器模拟的CPU。
$ git checkout -b android-goldfish-2.6.29 origin/android-goldfish-2.6.29
$ git branch
显示
android-2.6.27
* android-goldfish-2.6.29
我们已经工作在android-goldfish-2.6.29分支上了。
d)设定交叉编译参数
打开kernel目录下的Makefile文件,把CROSS_COMPILE指向刚才下载的prebuilt中的arm-eabi编译器
CROSS_COMPILE ?= arm-eabi-
把
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,
$(call ld-option, -Wl$(comma)?build-id,))
这一行注释掉,并且添加一个空的LDFLAGS_BUILD_ID定义,如下:
LDFLAGS_BUILD_ID =
e)编译内核映像
$ cd ~/android/kernel
$ make goldfish_defconfig
$ make
f)测试生成的内核映像
$ emulator -avd myavd -kernel ~/android/kernel/arch/arm/boot/zImage
-----------------------------------
Android tools
======= adb =======
#运行monkey程序,进行随机输入测试
$ adb shell monkey -v -p com.android.email 500
#查看system's log buffers
$ adb logcat
#Viewing stdout and stderr
$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start
#view a log buffer containing radio and telephony messages
$ adb logcat -b radio # radio, events, main is default
#Filtering Log Output
$ adb logcat ActivityManager:I MyApp:D *:S
更多精彩
赞助商链接