Dienstag, 15. November 2016

Oracle Jet Hybrid-Application --- Enable Remote Debugging


Introduction

While I have been developing the mobile hybrid application with Oracle Jet, I have been realizing, that I couldn't do remote debugging. I did deploy the application on my Android Virtual Device and did set some breakpoints. Useless.

I did make some research and was able to find a solution with Google Chrome. Make the following steps, if you also want to be able to remote debug your Oracle Jet application, running on an Android Virtual Device.

Enable USB Debugging on Android Virtual Device

  • Start your Android Virtual Device
  • Go to the Settings of the device
  • Click on Developer Options (check here, if not visible)
  • Enable USB Debugging


Do standard deployment of your Oracle Jet hybrid application
$ grunt serve:dev --platform=android --destination=emulator-5554


Enable Remote Debugging with Chrome

We did place an onclick listener on the Start game button. Now what we are doing is connecting the Chrome browser to the Virtual Devices and setting a breakpoint in Javascript.
Start Chrome and press F12




Now click the Escape (ESC) key to enter developer mode in Chrome





Now select Remote devices





Now you have a look at all the connected Remote devices. There is a lot of information about your connections and the connected devices.
  • On the left side you can see your Android Virtual device. Select it.
  • Now you see all the hybrid apps on your Android Virtual Device
  • Select the app you are about to debug and click on Inspect





A new window is being opened.
  • Click on Sources to see all the Javascript files
  • Now set a breakpoint in the Javascript function
  • After clicking on Start game, the breakpoint should stop at your Javascript


Conclusion

This is a very nice and easy way to debug your application. But it can't only be used to Debug your application. You can also use it to make quick CSS changes, HTML changes or Javascript changes. Definitely a very useful tool for a productive development of hybrid applications.

Keine Kommentare:

Kommentar veröffentlichen