Configure Application Wrapping in Microsoft Windows

This section describes the steps to collect data using the online wrapper.
maasaas
This article describes the typical workflow to use
App Experience Analytics
:
Step 1 - Register Your Application
The first step is to register your application. For more information, see the section.
Step 2 - Wrap the App
To collect the application data, you must wrap the apk file. Wrapping is the process of integrating the apk file with
App Experience Analytics
to collect information about crashes, sessions, usage, and network performance. After the wrapping, the wrapped apk file is signed with the packaged self-signed certificate. Sign the application with your own certificate and distribute it on Google Play, after testing the application.
The
App Experience Analytics
SDK requires the following permissions:
  • <uses-permission android:name="android.permission.INTERNET" />
  • <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  • <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
To use the custom APIs, see the section.
Consider the following points while wrapping:
  • If some or all the permissions are missing but the resources are present,
    App Experience Analytics
    wraps the application and adds the missing permissions to
    AndroidManifest.xml
    after wrapping.
  • If all the permissions are present but some resources missing,
    App Experience Analytics
    wraps the application using the
    -r
    option. If you wrap the application using
    -r
    with some permissions missing, the wrapping does not fail but CA App Experience Analytics might not function properly.
  • If both the permissions and resources are missing, the application wrapping fails with an error message. Add the missing permissions to the
    AndroidManifest.xml
    and try again.
You can find logs under
$CA_EMM_HOME/logs
with the file name as
wrap_<tenant_name>_<app_name>_<timestamp>.log
.
The following steps do not work for Cordova based applications. You must use the
wrap.sh
script to wrap the app.
Prerequisites:
  • Administrator has access to the Windows Command Line Utility.
  • Java Development Kit (JDK) 1.8 and above with jarsigner is available. Hardcode the JDK path and not the JRE.
Follow these steps:
  1. Click
    MANAGE APPS
    in the Administration Console
  2. Select the application you want to wrap and then select the platform as
    ANDROID
    .
  3. Download the
    Wrapper Utility
    (
    CAMobileAppAnalytics-wrapper.zip
    ) and extract the file.
  4. Set the current wrapping directory as
    $CA_EMM_HOME: SET CA_EMM_HOME=%~dp0\emm
  5. Create the bat file that passes the wrapping parameters.
    1. Open a notepad and copy the following snippet:
      SET CA_EMM_HOME=%~dp0\emm "C:\Program Files\Java\jdk1.8.0_131\bin\java" -jar ca-maa-android-sdk-wrapper-17.2.jar - verbose -apk "%1" -plist "%2" -rules AUTO_DETECT -signconfig emm/conf/jarsigner.properties -disablejsinterception "false" -buildtype "release" -nores "release" Where %1 is the path to the apk file and %2 is the path to the plist file. Note: Hardcode the JDK path.
    2. Save the file as wrapcustom.bat.
  6. Open the command terminal in the Administrator mode.
  7. Execute the following command:
    wrapcustom.bat <apk_file_path> <plist_file_path>