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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With