Sunday 24 April 2011

Android Platform Debugging:

Process For Platform Debugging:
Steps:
* Get into the Source Root folder and type environment setup command ------>  "source build/envsetup.sh"
* Choose which target to build with lunch. The exact configuration can be passed as an argument ----> "lunch"
* Build the source by make command -------> "make"
Emulator launching:
* once the build is over launch the emulator with following instruction
For emulator without keypad:
"sudo out/host/linux-x86/bin/emulator -system out/target/product/generic -kernel prebuilt/android-arm/kernel/kernel-qemu -data out/target/product/generic/userdata.img"
For emulator with keypad:
"out/host/linux-x86/bin/emulator -data out/target/product/generic/userdata.img"
Using Eclipse:
* Go to the eclipse Folder and launch Eclipse -------> ./eclipse.
* copy the .classpath file from "development/ide/eclipse" to root folder. get into your source root folder then type the following with "." in end  --------->  "cp development/ide/eclipse/.classpath ."
* Then "chmod u+w .classpath"
* now the .classpath file is copied. To check list all the files on root folder and find the .classpath file on
that -------> "ll"
* In eclipse now create a new java project   new --> javaproject --> import --> source(path)
* Check weather source included without any error.
* If you are getting following error "
1) 'out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar'
Generic-Android         Build path      Build Path Problem "
* If u get the problem .jar(out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar)  change above jar name to "out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar" on .classpath.
2) 'out/target/common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar'
Generic-Android         Build path      Build Path Problem
* If u get the problem .jar file error just delete that line on .classpath.
once these error is closed you may get error on  "com.android.providers.calendar,   com.android.providers.contacts "
* To solve that error we need to import "EventLogTags.java" to their corresponding packages.
1) For error on    "com.android.providers.calendar" eventlogtags  right click on that package  new --> file -->advanced --> link to file in the filesystem --> browse ..your source root -->out -->target --> common -->obj -->Apps -->calenderprovider_intermediates -->srs --> src --> com -->android --> providers --> calender -->EventLogTags.java
2) For error on    "com.android.providers.contacts" eventlogtags  right click on that package  new --> file -->advanced --> link to file in the filesystem --> browse ..your source root -->out -->target --> common -->obj -->Apps -->contactsprovider_intermediates -->srs --> src --> com -->android --> providers --> contacts -->EventLogTags.java
* clean and refresh and build again.
* launch the emulator in another terminal shell.
ddms setup:
* in eclipse goto run --> Debug configuration --> Remote java application --> new
* In project name give your source name.
* Change the port number to 8700 and click Debug.
* Open new terminal shell and start ddms. goto root folder and type ddms.
* Select the process to debug and start debug.

No comments:

Post a Comment