I have a eclipse workspace with 3 subprojects
- myMp3TagBusineslogic (lib that can be used for android and for j2se)
- myMp3TagActivity_Plugin (android activity that uses myMp3TagBusineslogic and that can be launched by MyFIles, OIFilemanager and other apps: A gui to edit/view mp3-tags )
- myMp3Tag_Test_Activity (some android activity used to test myMp3TagActivityPlugin by just executing
Intent mp3Tagger = ... ; startActivity(mp3Tagger);
Reason for this layout: seperate guiplugin from testcode.
my qestion: how is it possible to debug the code of myMp3TagActivityPlugin by executing myMp3TagTestActivity?
What I tried so far:
- Set a breakpoint in onCreate of myMp3TagActivity_Plugin and started debugging myMp3Tag_Test_Activity
- effect: debugger does not stop in myMp3TagActivity_Plugin. Plugin is executed correctly.
- Add plugin and myMp3TagBusineslogic to buildpath of myMp3Tag_Test_Activity
- effect: cannot start myMp3Tag_TestActivity: myMp3TagActivityPlugin class not found.
Edit: Update and solution for those who have the same problem:
- as the comment below states the buildpath that includes the plugin into the test was not complete and therefore the testactivity crashed. Correct buildpath
- add projects plugin
- add projects busines
- order and exports check plugin (i forgot before)
- order and exports check busines (i forgot before)
- however after uninstalling the plugin.apk from the device and debugging the test.apk (that now really contains the plugin-code and a combined manifest) the debugger still does not stop in the plugin-code.
- after adding
Debug.waitForDebugger()to the plugin-source and debugging the test.apk i finally could debug the plugin source.
You could try below method, might well work.
Add a call
Debug.waitfordebugger()inmyMp3TagActivity_Pluginentry point. ExecutemyMp3Tag_Test_Activity. Now the activity will show waiting for debugger to connect.Then find the port of the process
myMp3TagActivity_Plugin, usually starts from 8600 as you can see below.Then Right click myMp3TagActivity_Plugin project, debug as -> Debug Configurations -> Double click remote java app change port in connection properties to match above(8600) -> Debug.