For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Previewing Cordova web resources with the Mobile Browser Simulator
We can preview the web resources of your app and test some of your JavaScript code with Mobile Browser Simulator.
Restriction: The Mobile Browser Simulator supports the following web browsers:
- Firefox version 38 and later
- Chrome 49 and later
- Safari 9 and later
Restriction: You preview your web resources with Mobile Browser Simulator, but not all MobileFirst JavaScript APIs are supported by the simulator. In particular, the OAuth protocol is not fully supported. However, we can test calls to adapters with WLResourceRequest. In this case,
- Security checks are not run on the server-side and security challenges are not sent to the client that runs in Mobile Browser Simulator.
- If you do not use MobileFirst Development Server, register a confidential client that has the adapter's scope in its list of allowed scopes. We can define a confidential client with the MobileFirst Operations Console, by using the Runtime/Settings menu. For more information about confidential clients, see Confidential clients.
Note: MobileFirst Development Server includes a confidential client "test" that has an unlimited allowed scope ("*"). By default mfpdev app preview uses this confidential client.
To test your application with a device simulator, use instead cordova emulate.To preview your Cordova web resources with Mobile Browser Simulator, use the following procedure
- If we plan to use the connection with the server, start your test server. You start MobileFirst Development Server with the run command in the server installation directory. For more information, see Starting the MobileFirst Development Server.
- Use mfpdev app preview. For example, to preview the iOS platform of your application, with an update when you modify the web resource, type
$ mfpdev app preview ios --type mbs -wp
To preview the same application and test an adapter on a server that is not MobileFirst Development Server, type$ mfpdev app preview ios --type mbs -wp --clientid clientid --secret clientsecret
Where
- clientid is the ID of the confidential client to use
- cliensecret is the secret of the confidential client to use
For more information about mfpdev app preview, we can type
$ mfpdev help app preview
The following figure shows the display of the Mobile Browser Simulator.
![]()
Parent topic: Develop Cordova applications