Use Oracle JET CLI to launch your hybrid mobile application in a browser, simulator, or mobile device for testing and debugging. When you serve your application to a browser or emulator, a live reload option is enabled, and changes you make to the code are immediately reflected in the running application.
LiveReload: The Spring Boot DevTools module includes an embedded server called LiveReload. It allows the application to automictically trigger a browser refresh whenever we make changes in the resources. It is also known as auto-refresh. Note: We can disable the LiveReload by setting the property spring.devtools.livereload.enabled to false. Click the 'hamburger' at the far right of the main toolbar to open the menu and then click 'customize' at the bottom. The icon you're looking for is listed with the other 'additional tools and features' and can be dragged to the toolbar. I had to restart firefox after that to get it to actually enable livereload. Running as Firefox OS App. To run this application in Firefox as a packaged app, open 'Menu' - 'Developer' - 'WebIDE' (or hit Shift + F8). Choose 'Open packaged app' from the Project menu and select the app folder. Run npm start (gulp watch) to watch for file changes and automatically rebuild the app. Running in production. LiveReload: The Spring Boot DevTools module includes an embedded server called LiveReload. It allows the application to automictically trigger a browser refresh whenever we make changes in the resources. It is also known as auto-refresh. Note: We can disable the LiveReload by setting the property spring.devtools.livereload.enabled to false. Is there a way to have it open up firefox instead of chrome? (note: my system default browser is chrome) I could not find any documentation on this in gulp webserver or gulp livereload either.
Before you begin:
- Familiarize yourself with the
ojet serve
command optiontheme
when you want to run the application with an optional platform and a custom theme, as described in Customize Alta Themes Using the Tooling. - Optionally, use the
ojet serve
command with the--release
option to serve a release-ready version of your application, as described in Package and Publish Hybrid Mobile Applications. - If you want to send your application to an iOS device, you must take additional steps as described in Package a Hybrid Mobile App on iOS.
At a command prompt, change to the application’s top level directory and use the ojet serve
command with options to launch the application.
Tip:
Livereload Firefox Extension
You can also enterojet help
at a terminal prompt to get help for specific Oracle JET CLI commands. The application will launch in a local browser, emulator/simulator, or device depending upon the options you specify. The following table shows examples.
Command | Description |
---|---|
| Launches a Windows version of the application in the Firefox browser. |
| Launches the application in the iOS Simulator using the Alta iOS theme. |
| Launches the application in the Android emulator using the AVD named “MyEmulator”. The emulator name is case-sensitive. |
| Launches the application on the attached Android mobile device. |
The terminal will also output the names of the files as they are loaded. If your application contains multiple views, the output will reflect the names of the views and associated files as you navigate through the application.
WARNING:
If you specify the Android platform, use a proxy server and skipped theojet build
step, the serve
command will fail the first time you issue it. To resolve this, create a gradle.properties
file in your Livereload Extension Firefox
HOME/.gradle
directory and rerun the serve command. The file should contain the following:If you left live reload enabled (default, --livereloadtrue
), the terminal window updates to reflect that the code has changed. For example, if you save a change to dashboard.html
in an application scaffolded with the navbar or navdrawer template, the terminal window outputs the name of the changed file, and the browser or emulator/simulator updates with the change. Live reload is disabled when you serve an application to a device.
To terminate the batch job when using live reload, press Ctrl+C in the command window and then enter y
if prompted to terminate the batch job.
About ojet serve Command Options for Hybrid Mobile Applications
Use ojet serve
to run your hybrid mobile application in a local web server for testing and debugging.
The following table describes the commonly-used options and provides examples for their use.
Option | Description |
---|---|
| Desired platform. Enter |
| Specify the path to You do not need this file when building a debug version of your application for Android or Windows, or if you are building your app for deployment to an iOS simulator. However, you must configure one for testing on an iOS device and for pre-release testing of your Android, iOS or Windows application. |
| Server port number. If not specified, defaults to 8000. |
| Live reload port number. If not specified, defaults to 35729. |
| Specify one of the following:
|
| Equivalent to |
| Equivalent to |
| Equivalent to |
| Equivalent to |
| Enable the live reload feature. Live reload is enabled by default ( Use Disabling live reload can be helpful if you’re working in an IDE and want to use that IDE’s mechanism for loading updated applications. |
| Build the app before you serve it. By default, an app is built before you serve it ( Use |
| Theme to use for the application. The theme defaults to Note: If you have migrated to JET 9.0.0 and later, and want to continue building with your Alta theme, for hybrid mobile themes, you can specify: You can also enter a different |
| Themes to use for the application, separated by commas. If you don’t specify the |
| Injects a Redwood theme CSS file that supports working with CSS custom properties when you want to override CSS variables to customize the Redwood theme. For details about theming with CSS variables, see About CSS Variables and Custom Themes in Oracle JET. |
| Manages Sass compilation. If you add Sass and specify the Note: The option that you choose controls both Sass compilation in the build step and Sass watch in the serve step. |
| Platform-specific options that will pass verbatim to the Cordova CLI. This option is typically required for Windows device deployments or if a Cordova plugin contains multiple static libraries for different CPUs. If the value passed contains a quoted string, the quotation marks must be escaped. For example, you can use platform-options to specify Windows architectures. By default, the architecture defaults to To specify a single architecture, use the --arch option and specify arm , x86 , x64 , or anycpu . |