BLE GATT and NFC support

You can use Digital Lab with Service Virtualization to simulate communication over BLE GATT or NFC between a mobile phone and a smart device (IoT), and virtualize smart devices and their service offerings.

BLE overview

BLE GATT is an acronym for Bluetooth Low Energy Generic Attribute Protocol.

NFC is an acronym for Near Field Communication.

By learning and simulating a smart device's behavior, you can perform automated testing on mobile applications that are connected to smart devices. For example, you can simulate a smart coffee maker connected to a mobile phone, and test an application that controls the coffee maker's behavior.

While Service Virtualization can simulate some of the mobile API scenarios, for advanced cases involving data pushing and synchronization, use the SV Lab. For details, see SV Lab Concepts And Architecture Overview.

Back to top

Service Virtualization simulation over BLE GATT and NFC

Back to top


This section describes the hi-level workflow for learning or simulating a smart device connected to a mobile phone:

  1. Create a Mobile API agent that runs in Service Virtualization Designer or Server and enables the virtualization of mobile applications.
  2. Package the mobile application being tested using code that enables the virtualization of smart devices connected over BLE GATT or NFC devices.
  3. Use the SV Connector application to configure the packaged mobile application, so that you can connect the application being tested to the Android BLE GATT / NFC Service Virtualization agent running in the Service Virtualization Designer or Server.

Back to top

Testing mobile apps with BLE GATT or NFC

To test a mobile application for a device connected via BLE GATT or NFC:

  1. Package and install the application under test.

    1. Locate the APK for the application under test.
    2. Get the ApkInfuser tool from the Microfocus AppDelivery Marketplace. Download the 'APKInfuser - Android app packager 2.53' package and extract the Zip file to the <Service Virtualization Designer installation directory>/Tools/AndroidTools folder.

    3. Navigate to the <Service Virtualization Designer installation directory>/Tools/AndroidTools folder and package the application using the APKInfuser tool. Use the following syntax, where <myapp...> is the name of the APK:

      For Bluetooth:

      MCAndroidEnabler.bat -custom sv-ble-net.json sv-ble.dex -signdebug

      For NFC:

      MCAndroidEnabler.bat -custom sv-nfc-hce-net.json sv-nfc-hce.dex -signdebug

    4. Install the packaged APK on the Android phone in one of the following ways:

      • Upload the packaged APK to Digital Lab and install it on the mobile phone.
      • Install the packaged APK using the ADB tool from the Android SDK. For example:

        adb install

  2. Connect the mobile phone to the Service Virtualization Designer.

    1. Install the SV Connector application (also located in the <Service Virtualization Designer installation directory>/Tools/AndroidTools folder) on the phone in one of the following ways:

      • Upload the SV Connector to Digital Lab and install it on a specific device through Digital Lab.

      • Install SV Connector using the ADB tool from the Android SDK. For example:

      • adb install sv-android-connector-4.0.apk

    2. In Service Virtualization Designer, create and configure the Mobile API Agent. Note the assigned port for the next step.

    3. On the Android device, open the SV Connector application, set the Service Virtualization Server host name or IP address and the port of the Mobile API Agentcreated in the previous step.

      You can enable the connector debug log stored on the mobile phone in /sdcard/sv_event_log.txt. The log is recreated every time the application under test restarts.

  3. In the Service Virtualization Designer, create a new BLE GATT / NFC service using the Mobile API service protocol.

  4. Learn and simulate as you would with any other protocol.

Back to top