Debugging Oracle JET Applications

Since Oracle JET web applications are client-side HTML5 applications written in JavaScript, you can use your favorite browser's debugging facilities. The process for debugging hybrid mobile applications differs, depending on whether you’re debugging your application in a web browser, emulator, or device.

Debugging Web Applications

Debugging facilities vary by browser. For example, Google Chrome provides the Knockoutjs Context Debugger extension to examine the knockout context and data for a DOM node in a sidebar. You can also add the Window Resizer extension to resize the browser window to emulate common screen sizes or set your own. You can find these extensions and other developer tools at the Chrome Web Store.

If you’re using an Integrated Development Environment (IDE) for development, you can use debugging tools such as the one provided by the NetBeans IDE to set break points and watches. For details, see Debugging and Testing JavaScript in an HTML5 Application.

Debugging Hybrid Mobile Applications

There are several ways to debug a hybrid mobile application, depending on the environment where you are running the application:

  • Debugging in a local web browser

    Since Cordova applications are HTML5 applications written in JavaScript, you can use the same debugging facilities that you would use for web applications. With this approach, however, you might find it difficult to debug code that depends on device services and Cordova plugins.

    To run an Oracle JET hybrid mobile application in your desktop Safari or Chrome browser, build it first and then serve it with the --web option.

    grunt build:dev --platform={ios|android}
    grunt serve:dev --platform={ios|android} --web
    
  • Debugging in the emulator

    You can run the app in the emulator which eliminates the need for an actual device. However, emulators can run slowly and include limited support for emulating native device services.

    To run an Oracle JET hybrid mobile application in an emulator, build it first and then serve it.

    grunt build:dev --platform={ios|android}
    grunt serve:dev --platform={ios|android}
    
  • Debugging on the device

    Running the application on a real device provides the most accurate experience, but the development cycle can take longer since you must package the application, deploy it to the device, and use a desktop browser or other development tool to connect to it running on the device.

    To run an Oracle JET hybrid mobile application on the device, build it first and then serve it.

    grunt build:dev --platform={ios|android}
    grunt serve:dev --platform={ios|android} --destination=device
    

You can find additional information about debugging Cordova applications at: Cordova Next Steps.