How to build and debug android source code
来源:互联网 发布:c语言string头文件 编辑:程序博客网 时间:2024/04/30 17:15
System: ubuntu 14.04
1. download source code and build
This step is not hard. basically following the doc here:
https://source.android.com/source/building-running.htmlYou should be able to run emulator after build. One tips for re-running emulator after closing the terminal window is to create script like belowmethod 1:
build/envsetup.sh && lunch full-eng && emulator
method 2:
where to find the emulator?
2. debug android framework java source code
download the ADT eclipse ADT: http://developer.android.com/sdk/installing/index.html
it has the eclipse IDE and DDMS debugger
you can create a java project to import all the java source code into eclipse as described in https://source.android.com/source/using-eclipse.html
I have tried the red part below:
f Eclipse asks you for a workspace location, don't choose default, create the workspace at the android root.
If you have a "Welcome" screen, close it to reveal the Java perspective.
File > New > Java Project
Pick a project name, "android" or anything you like.
Select "Create project from existing source", enter the path to your Android root directory, and click Finish.
Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)
then, pick an app like setting app to debug. Set break point to the setting app's source code.
3. common command
- croot: Changes directory to the top of the tree.- m: Makesfrom the top of the tree.- mm: Builds all of the modules in the currentdirectory.- mmm: Builds all of the modules in the supplieddirectories.- cgrep: Greps on all local C/C++ files.- hgrep: Greps on all local C/C++ header files.- jgrep: Greps on all local Java files.- mkgrep: Greps on all local make files.- rcgrep: Greps on all local .rc files.- resgrep: Greps on all local res/*.xml files.- shgrep: Greps on all local .sh files.- godir: Go to the directory containing a file.
good post:
http://apienthusiast.blogspot.com/2014/06/using-eclipse-to-browse-and-edit-aosp.html
andriod build system
http://elinux.org/Android_Build_System
use emulator
http://stackoverflow.com/questions/9022750/running-emulator-after-building-android-from-source
gdb & gdb server
http://www.thegeekstuff.com/2014/04/gdbserver-example/
http://thinksrc.com/2012/07/15/android-gdb-full-symbol/
http://www.kandroid.org/online-pdk/guide/debugging_gdb.html
- How to build and debug android source code
- how to build and debug wireshark2.4.2 source code
- How to build NCL and NCAR Graphics from source code
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)?
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)
- download android source code and build
- How to debug ASP.NET MVC using source code
- How to get Android O source code?
- How to Build Brillo Operating System from Source Code and Run Brillo Emulator Read more: http://www
- Android: How to download the latest zip Android Source Code easily and using it in Intellij
- Android source code debug
- android sw watchdog and How to Debug
- android sw watchdog and How to Debug
- How to debug Dalvik and ARM code together
- Android kernel build from source code and from prebuilt
- How to get Linux Kernel Source Code of Android?
- How To Make Bootanimation (Base on Android Source Code)
- How to build android libcore/luni, native code?
- hibernate实现有两种配置,xml配置与注释配置
- python 指南 错误和异常
- 读《大数据日知录:架构与算法》试读章节有感
- poj 3261(后缀数组,求可重叠的k次最长重复子串)
- 正则表达式匹配日期时间
- How to build and debug android source code
- LeetCode: My solution:Restore IP Addresses
- ubuntu server 10.4下的DHCP服务配置
- 为Xcode6添加Empty Application选项
- python 指南 输入和输出
- OpenGL编程指南-->深度缓冲区原理以及为什么要用它
- 小黑小波比.解决执行完代码,带指定的参数值重新加载页面
- 无法使用Django新建项目:'django-admin.py'不是内部或外部命令
- 如何阅读源代码(以X264为例)