How to specify javaagent for Android?

空扰寡人 提交于 2019-12-23 03:13:31

问题


Is there any way to specify -javaagent argument when starting an APK on Android? I'd like to specify aspectj's aspectjweaver.jar to java vm argument for a loading time instrumentation. Thanks a lot.


回答1:


No. The Dalvik VM running application code in Android is not a JVM.

Android does, however support instrumentation through Instrumentation classes. You may be able to find a port of aspectj for Android that already supports this, though you may also need to write it yourself.

Don't forget to register your instrumentation class in your manifest if you go down this route.



来源:https://stackoverflow.com/questions/19522058/how-to-specify-javaagent-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!