How to debug J2V8 in Android using tools for Chrome developers?

A similar question was asked before, but had nothing to do. Obviously, it’s possible , but it is in no way clear how to do this in our own Android application other than tabris.

The best documentation we have on this issue is this commit , but I tried V8.setFlags("--expose-debug-as=Debug");as well V8.setFlags("--expose-debug-as=" + DebugHandler.DEBUG_OBJECT_NAME);, but without debugging, the application appeared in the Chrome developer tools.

I even tried in combination with the inclusion of Stetho, in which case I was able to debug the application, but there was no javascript source for debugging. I believe that I am close, but one small critical self-birth is missing.

+4
source share
1 answer

The article in which you refer says that they implemented it in their product using the Stetho library in order to provide support for the Chrome Dev Tools debugger protocol, so you will need to use the DebugAPI class and expose it to DevTools through the Chrome debugging protocol protocol, although at first glance I don’t see how to use Stetho to set debug api.

Tests in j2v8 codebase provide a good example of using DebugAPI

0
source

Source: https://habr.com/ru/post/1667933/


All Articles