hey Gabor, thanks a lot for your help. Actually i tried reproducing the same steps, it is working fine till emulator starts, it launches emulator but it does not shows the home screen i tried steps after that, doing adb remount and adb sync, it pushes all the neccessay files into the emulator, but emulator is still in sleep state, just the first screen saying Android.. keeps up, does not boot after that. Then i tries running test cases using 'am' command no tests run and no coverage file got generated. Can you tell me whats the problem in this.(all the bulding process wa successfully passed with no errors)
Thanks, Mayank On Aug 20, 6:08 pm, Gabor <gabor.andr...@googlemail.com> wrote: > Hi All, > > Finally, the emma code coverage measurement is working for me (for a > custom project). So here are the steps what you need to make it work > (I have tested it, with Java 1.5 on Ubuntu 8.04): > > mkdir android-src > cd android-src > repo init -u git://android.git.kernel.org/platform/manifest.git -b > cupcake > repo sync > > # Add emma.jar to the system/core/rootdir/init.rc > sed 's/\/system\/framework\/core.jar:\/system\/framework\/ext.jar:/\/ > system\/framework\/core.jar:\/system\/framework\/ext.jar:\/system\/ > framework\/emma.jar:/' system/core/rootdir/init.rc > system/core/ > rootdir/init.rc.tmp > mv system/core/rootdir/init.rc.tmp system/core/rootdir/init.rc > > # Rebuild the boot image > make bootimage > > # To build the full system image > make -j4 > > # Set the PATH: > export PATH=${PATH}:/<_path_>/android-src/out/host/linux-x86/bin/ > > # Build the emma jar itself > make emma > > # Setting the environment and additional bash commands. (like > m,mm,mmm, choosecombo etc) Notice the space after the dot! > . build/envsetup.sh > > # Set EMMA_INSTRUMENTATION to true > export EMMA_INSTRUMENT=true > > # Copy your project to development/samples/<_projectname_> or > somewhere..:) > # Based on the ApiDemo create an Android.mk file for the project > directory and the project test directory > # The LOCAL_INSTRUMENTATION_FOR value in test dir Android.mk has to be > equal with the LOCAL_PACKAGE_NAME defined in the Android.mk in the > main project dir. > # Compile the Application would like to instrument > mmm development/samples/<_projectname_> > > # Set the ANDROID_PRODUCT_OUT directory for the emulator to know the > image location > export ANDROID_PRODUCT_OUT=/<_path_>/android-src/out/target/product/ > generic > > # Start an emulator with a simulated sdcard: > emulator -sdcard <path to sdcard> > > # Remount the drive - it is needed to have a writable drive. without > that sync wont work > adb remount > > # Synchronize the local content with the emulator > adb sync > > adb shell > # create directory: mkdir /etc/coverageresult > > # Executing tests > adb shell am instrument -w -e coverage true -e coverageFile /etc/ > coverageresult/coverage.ec hu.agsoftware.sample.tests/ > android.test.InstrumentationTestRunner > > # Dump a runtime coverage data file: > adb pull /etc/coverageresult/coverage.ec coverage.ec > > # Generate a coverage report > java -cp external/emma/lib/emma.jar emma report -r html -in > coverage.ec -sp development/samples/<_projectname_>/src -in out/target/ > common/obj/APPS/<_projectname>_intermediates/coverage.em > > I hope it helps. > > Gabor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---