Overview

Skill Level: Intermediate

For application replay, the images that you added to your application should be copied to the replay server. When the images are on the replay server, the images do not need to be sent in the payload which could cause performance issues. Instead, replay uses a unique identifier for each image to retrieve the needed images from the replay server. Part of developing your application includes collecting the images that you use in your application so that they can be copied to the replay server. You use the Target Simulator to collect images that you inserted into your application.

Prerequisites

Before you begin:

When you start the tool, you must exercise every page in your application for the tool to capture the images. The Target Simulator uses the Acoustic SDK for Node.js. You can obtain an installer from the Acoustic Experience Analytics (Tealeaf) iOS SDK package or from the Acoustic SDK for Node.js overview page at http://www.ibm.com/developerworks/web/nodesdk/. Only the Acoustic SDK for Node.js is supported with the Target Simulator.

Note: This rake tool is mainly created to handle ImageView use cases, and if you notice missing images in replay pages, then you will have to use TargetSimulator to collect missing images in conjunction with it.

Target Simulator details

The Target Simulator acts as a target page on your local machine. After you start the simulator, you exercise every page in your application. The simulator takes the images that are embedded in the application, uses the image check sum to create unique file name for each image, and saves the images in the same location where the Target Simulator tool is located. After you have the images, the images must be transferred to the replay server images folder.

Step-by-step

  1. Extract the Target Simulator archive on the device that you used to create your application.

  2. Start the simulator with the default settings by entering node target_sim.js.

    Target Simulator SDK settings

    Because images are not sent in the payload in production, you modify the SDK properties to send the images in payloads and to use a target page on the machine running the Target Simulator and not the production Acoustic Experience Analytics (Tealeaf) Target page. When you start the Target Simulator, the program gives you the URL where the Target Simulator is listening SDK for payloads that contain images.

    The Target Simulator provides you a URL with an IP address.

    The PostMessageUrl location is http://<IP addres>:<portnumber>. By default, the <portnumber> is 9000. If you change the port number on the command line, that is the port number that is used.

    You modify the TLFConfigurableItems.plist file for iOS applications. You modify the settings to point to the target page on the machine running the Target Simulator, to get image data, and to increase the payload size to allow images. You modify:

    • PostMessageURL – http://localhost:<port number>
    • GetImageDataOnScreenLayout – Yes
    After you exercise your application you modify the properties file and change the properties back to the production settings for normal operation. You reset the settings to:

    • PostMessageURL – the URL for the production Acoustic Experience Analytics (Tealeaf) Target page
    • GetImageDataOnScreenLayout – No

    Target Simulator command

    If you already have the Acoustic SDK for Node.js in your path, you can start the target simulator by entering node target_sim.js.

    If Node.js is not in your path,the Target Simulator full path command for Mac is /Applications/IBM/node/bin/node target_sim.js.

    If Node.js is not in your path, the Target Simulator full path command for Windows is “C:\Program Files\IBM\Node\node.exe” target_sim.js.

    By default the Target Simulator listens for SDK posts on port 9000. If you already have something running on port 9000 and want the Target Simulator to use a different port, specify a port number at the end of the command. For example, to change the port to 8080, enter:

    /Applications/IBM/node/bin/node target_sim.js 8080

  3. Modify the configuration properties for your platform:

    If you created your application for an Android device, then follow these steps:

    1. Edit the TealeafBasicConfig.properties file.
    2. Set PostMessageUrl: to the URL that application reports is listening on.
    3. Set GetImageDataOnScreenLayout: to YES
    4. Set CachedFileMaxBytesSize: to 2,000,000,000
    5. Save and exit the file.

    If you created your application for an iOS device, then follow these steps:

    1. Edit the TLFConfigurableItems.plist file.
    2. Set PostMessageUrl: to the URL that application reports it is listening on.
    3. Set GetImageDataOnScreenLayout: to YES
    4. Save and exit the file.
  4. Exercise every page in your application to capture all of the images that you added.

    In the target_sim.js console window, you see a running log of what POSTs were received and what images (if any) were found and saved to the file system.

  5. In the target_sim.js console window, press Control-C to exit the simulator.

  6. Reset the TealeafBasic configuration file to standard run-time settings.

    If you created your application for an Android device, then follow these steps:

    1. Edit the TealeafBasicConfig.properties file.
    2. Set PostMessageUrl: to the URL for the application Target page.
    3. Set GetImageDataOnScreenLayout: to NO
    4. Set CachedFileMaxBytesSize: to your production environment setting.
    5. Save and exit the file.

    If you created your application for an iOS device, then follow these steps:

    1. Edit the TLFConfigurableItems.plist file.
    2. Set GetImageDataOnScreenLayout: to NO
    3. Save and exit the file.
  7. Transfer the images to the replay server.

    Once the folder with the images is created, with either tool, the archive must be transferred to the replay server images folder. This folder is typically C:\Tealeaf\Replay Server\Images.

    Whoever has access to the replay server can transfer the archive. It may be you, the portal administrator, or someone else, depending on your local practices.

Join The Discussion

Your email address will not be published. Required fields are marked *