Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify javaagent for Android?

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.

like image 523
bettermanlu Avatar asked Aug 28 '26 18:08

bettermanlu


1 Answers

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.

like image 192
Bryan Herbst Avatar answered Aug 30 '26 10:08

Bryan Herbst



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!