Hybrid mobile applications contain large amounts of web
code. The more web code an IBM® Worklight application contains,
the more cross-platform support that it benefits from. As a result
mobile application developers spend much time testing and debugging
web code, for which the Mobile Browser Simulator is the ideal environment.
Deploy the application for this testing environment as follows:
- In the IBM Worklight project in IBM Worklight Studio,
right-click the environment folder of the application and select Run
As> Preview. IBM Worklight Studio performs
a full build and deploys the application code to the fast built-in
the server. The Mobile Browser Simulator is
launched and runs the application. The developer uses this environment
to perform the necessary unit tests and make further code changes.
- For code changes to take effect, go back to the environment folder
in IBM Worklight Studio and click Run
As > Build Environment and Deploy. The build finishes
after a few seconds.
- Go back to the Mobile Browser Simulator and
click Go to reload the application. In this
cycle between code change and build and run, the developer can efficiently
test and debug application code.
Server-side adapter code can be tested in a similar way with the
built-in server, as follows:
- Right-click the adapter folder and Run As> Invoke IBM
Worklight Procedure. A dialog is launched to select the
procedure to invoke and to provide input parameters, if necessary.
- Clicking Run. A browser opens and displays
the invocation result in JSON format.
- When further changes are made to the adapter code, choose Run
As> Deploy IBM Worklight Adapter to publish the changes.
- Refresh the browser to resubmit the POST request
to invoke the target procedure again.
In this scenario, all deployment tasks are automatically handled
by IBM Worklight Studio. Only the web archives,
the .wlapp and .adapter files,
are involved. The files are deployed to the built-in IBM Worklight server
by IBM Worklight Studio when you execute the 'Run
As' command.