如何为Android指定javaagent? [英] How to specify javaagent for Android?
问题描述
有什么办法开始在Android APK的时指定-javaagent参数?
我想指定AspectJ的aspectjweaver.jar到Java VM参数的加载时间的仪器。
非常感谢。
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.
推荐答案
没有。在Android的Dalvik虚拟机运行的应用程序code不是一个JVM。
No. The Dalvik VM running application code in Android is not a JVM.
的Android确实,但是通过仪表类支持仪器仪表的。您可能能够找到的AspectJ为Android的端口已经支持这一点,虽然你可能还需要给它写自己。
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.
这篇关于如何为Android指定javaagent?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!