Recording Mobile Apps on the Android Emulator with Silk Performer

Recording Mobile Apps on the Android Emulator with Silk Performer

This article guides you through the configuration of Silk Performer to record network traffic of mobile apps on the Android emulator via proxy recording.

Before you start:

If you don’t know which packages are required for the Android SDK, take a look at the following screenshots (SDK Platform and SDK Tools). The workflow for this article was created with an emulator running Android 7.1.1 API Level 25.

 

 

If you already have a configured environment that allows you to run Android apps in the emulator, you can skip step 1.

1. The Android Virtual Device (AVD)

To run your application in the Android Emulator you need an Android Virtual Device. If you have not set one up yet, open the Android Virtual Device Manager and add a new AVD.

Toolbar:

Android Virtual Device Manager:

Android Virtual Device detail:


In this case, we opted for Cold Boot to ensure all traffic is captured from the start.

 2. Configure the emulator APN to use the Recorder as a proxy

On the emulator, go to:
SETTINGS | MORE… | CELLULAR NETWORKS | ACCESS POINT NAMES.
Select an existing APN for editing, as shown below. Then edit Proxy and Port to specify the IP address of the Recorder machine and the port it is listening to. Example:

 Tip: remember to save these settings before leaving the screen.

3. Create an Android Emulator Application Profile

Let us create a new Application Profile for the Android Emulator. In Silk Performer, click SYSTEM SETTINGS | RECORDER | APPLICATION PROFILES and click the ADD… button.

Enter the following information:

  • Application profile name (e.g. Android Emulator)
  • Application path (e.g. C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe)
  • Working directory (e.g. C:\Program Files (x86)\Android\android-sdk\tools\)
  • Program arguments: leave this field blank.

In the Protocol selection area, check the Web check box, then click the Web Settings… button and select Proxy – Manual browser configuration on the Web Settings dialog.

4. Recording

Start with a new Mobile Devices project.
Start the Recorder from the main menu: RECORD | RECORDER.

Now start the Android emulator from the AVD Manager.
If you start the emulator from command line, do not use –http-proxy as the proxy is known to work with APN configuration at this time.

Open an application such as Chrome and navigate to the website you want to record.
The Recorder should show traffic being captured. Click its window title and press CTRL+Z to expand the logs area:

If no traffic is captured, try disabling the virtual wi-fi so to use the mobile connection only.

In this case, we had Microfocus CA installed on the emulator, which is necessary to record secure traffic (https). If you require recording secure traffic, let us take a step back and install the certificate on the emulator.

5. Installing Silk Performer certificate (Microfocus CA) on the Android system

First, go to Silk Performer Workbench and click Model Script on the workflow bar:

This will bring up the following screen:


Select Record via mobile device.
In the following screen, choose Install Micro Focus CA and start recording:

Now use a browser such as Chrome and point it to the address shown in the following screen:

In the emulator, confirm that you want to install the certificate and confirm any security requirements. Choose to install the certificate for VPN and apps when prompted.

To verify that the certificate is correctly installed, go to:
SETTINGS | SECURITY | TRUSTED CREDENTIALS | USER, as shown below:

Alternatively, if you have Google Drive on the emulator, copy the certificate from Silk Performer root folder and click on it. This will trigger the installation of the certificate and any required security settings by Android.

 

 

Labels (1)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
2 of 2
Last update:
‎2020-02-14 20:14
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.