If there is a way to run JavaScript command on native app?

I have an appium test running on real device with native application installed. If there is a way to run JavaScript command on native app? Thanks!

Please explain the use case for wanting to run javascript on a native app ?? Is the app a javascript app wrapped in code that makes it look native ??

Hi! No, it’s an android native app.
The use case is to workaround the limitation of searching for objects, the app uses map , and object spy cannot locate elements on it, it’s like a one solid canvas for it. With javascript, it’s may be possible to ‘ask’ the application what is currently on screen. However ((JavascriptExecutor)theDriver).executeScript("***)") didn’t worked for me

My guess is that javascript will not work on a 100% native app. The app isn’t javascript based. However, the folks at Experitest can be more definitive than myself.

The following may help you figure out how to work with a map.