Skip to content

Managing Mobile Services Instances

A variety of features is available in Visual Studio Code for managing Mobile Services instances.

The starting point for this is the Mobile Services icon in the Activity Bar. The icon looks like an O surrounded by a C.

Adding Mobile Services Instances

Click on the Mobile Services icon in the Activity Bar.

If you have not already done so, click on the Add Landscape button (or + icon) in the Primary Side Bar.

  • Enter the requested information. The Admin UI URL can be found in the SAP Mobile Services Cockpit.

  • Click OK.

The SAP Mobile Services LANDSCAPES view area in the Primary Side Bar lists your Mobile Services instances, and under each instance can be found the Mobile Applications and Analytics nodes.

Viewing the Event Logs

Expand the Analytics node and click on Event Logs. The editor area should display an Event Logs tab for the currently selected landscape. Various options for filtering and display are available.

Viewing the Mobile Destinations

Expand the Mobile Applications node, then expand the mobile application of interest, then expand the Mobile Destinations node for the application.

Accessing the OData Metadata Document

Click on the node for the mobile destination of interest.

You might see an error message at the bottom right of the editor area if there's a problem with the security configuration for the mobile destination. If needed, follow the instructions in the error message to ensure proper authentication for accessing the back-end OData services.

If authentication succeeds, the entity types from the OData service's metadata display. A drop-down list near the top right of the document tab in the editor area offers three selections: General, Diagram, and Metadata. Choose one to display the service metadata in the desired format.

Executing OData Queries Against Mobile Destinations

Right-click on the mobile destination you're interested in. Type the query URL suffix, excluding the protocol, host, and port. This could be an entity set name, like Products, or an entity set name followed by a query string. You can use OData system query options such as $select and $filter, for example, Products?$select=ID,Name&$filter=Price gt 10. Click the Send button to execute the query. The query results display in the editor area, typically in JSON format.

Generating an OData Test Client

An OData test client can be generated for the mobile destination. This can be useful to become familiar with API usage for query, create, update, and delete operations using the SAP Business Technology Platform SDKs for Android, iOS, and the server runtime APIs used to customize generated OData services.

Right-click on the mobile destination you're interested in, and choose the Generate Test Client option from the menu. Create or select a folder to store the generated test client code, then click Generate. Once the code generation completes, click the Open button to access the generated test folder.

If the test folder was already open (or did not open when the Open button was clicked), use File > Close Folder followed by File > Open Folder... (or File > Open Recent...) to reopen the test folder. The Primary Side Bar should briefly show the EXPLORER view, then after a few seconds it should switch to showing the SAP MOBILE SERVICES LANDSCAPES view, and the editor area should show a tab with a name such as Test Client - app.

If the Test Client - app tab doesn't appear automatically in the editor area, or if it's accidentally closed, use the MBT: Open Test Client for Mobile Destination command from the Command Palette (View > Command Palette...) to reopen it.

A list of named tests should be shown in the editor area. Click on one of them. You should then see, to the right, tabs for Swift, Kotlin, and Java showing corresponding example SDK API usage for SAP Business Technology Platform Mobile SDKs. These example files are contained within the test project's examples folder.

To execute the selected test, near the top right of the editor area should be an icon that looks like a running person (the Execute icon). Click on that icon to execute the test. This should execute the test and display test output in the Terminal window.

Once one test has been run in this way, and before the temporary security token expires, it is also possible to execute tests by switching to the EXPLORER view, and using Terminal > Run Task... you can select and execute one of the test tasks.

If you wish to customize the source code of one or more of the generated tests before re-executing it, see the Java source files in the src/test/java/my/tests folder (the source files in the examples folder are not used for test execution).

Generating a Development Backend Server

A development back-end server is a kind of clone of an OData back-end service. It may be useful if the back-end server's metadata is available but the back-end server is not yet sufficiently implemented to permit the initial development of a mobile client application. Using mobile back-end tools to generate a development server might permit client development to proceed in parallel with back-end server development.

To generate a development back-end server, start by accessing the metadata document. In the top right of the editor area displaying the metadata document, you'll find a set of icons. One of these icons is labeled Generate Development Backend. Click on this icon and confirm the action. You'll then be asked if you want the development backend to include a copy of some test data from the backend system.

Choose a name for your development server and press Enter to proceed.

Once the development server is generated, see Deploying the OData Service for further instructions.

If any issues arise during the process, you can create a development backend server using the MBT: Create Mobile Backend Server Project command. Before deploying the service, add the line -dev:mode to the generated server-app.options file.

Network Trace Analysis

To analyze a HAR file (HTTP Archive) generated by SAP Mobile Services, use the MBT: Network Trace Analyzer command from the Command Palette (View > Command Palette...). This command opens the HAR file for analysis.

Compared to third-party tools for HAR analysis, the Network Trace Analyzer makes it easy to analyze nested requests within OData $batch requests.


Last update: May 19, 2025