Blog

MAP SDK

How-To: Retrieving MAP SDK Debug Logs from Your App

Fri, Jul 20th, 2018 | Anish Kumar

When building mobile apps with the Akamai Mobile Application Performance (MAP) SDK, occasionally you may run into an issue and want to reach out to our support team. To make it easier for everybody, it’s ideal if you can provide a copy of the debug log to the support team.

Let’s take a look at how you can collect these logs on iOS and Android apps and send them to us.

First, in your app's code, make sure that MAP SDK is generating logs by calling the following methods:

  • iOS - [ self.akaService setDebugConsoleLog : YES ];  
  • Android - Logger.setLevel(Logger.LEVEL.DEBUG)

If you have debug and production environments in your codebase, you may want to enable logging only in the debug environment. Once you’ve enabled debug logs, proceed with the steps below to obtain your debug logs on iOS or Android.

Obtaining debug logs on iOS

Start in the Apple devices window, then follow these five steps to obtain the debug log for your app:

  1. For iOS and tvOS apps, connect a device to your Mac. For watchOS apps, connect an iPhone paired with an Apple Watch.
  2. Under Devices, select your device.
  3. Under Installed Apps, select your app from the list (in the example below, it’s “SampleApp”).
  4. From the Action menu (i.e., the gear icon), choose Download Container, this selection will download a container from the device. In the sheet that appears, enter a location and click Save. The saved file will have a *.xcappdata extension.
  5. Right-click the .xcappdata file and click on "Show Package Contents". The MAP SDK debug log for your app will be available at: App Data → Library → Caches → Logs → "YYYY-MM-DD-XXX_com.akamai.vocsdk.log"

 

Here’s the directory structure of debug log:

Double click on YYYY-MM-DD-XXX_com.akamai.vocsdk.log to view the log, which will look something like this:

In the sample log above, the following information is provided:

 

  • 1st line - MAPSDK version
  • 2nd line - bundle id
  • 3rd line - device type and OS
  • 5th line - license and segments
  • look for MAPSDK REG START - This confirms that registration was successful

Obtaining debug logs on Android

  1. On the Android device, enable USB debugging (on Android 4.x, go to: Settings > Developer options > USB Debugging).
  2. Run: ./adb kill-server as a fail-safe measure, then run: ./adb devices . This will list the available connected devices, like so:
  3. Copy the device ID to the clipboard, then run: ./adb logcat -v threadtime [device ID] > /tmp/android-debug.log This will save the logs in the file named android-debug.log.
  4. Perform the actions observed as problematic on the Android device
  5. Hit control + c  to stop the adb process, and send the android-debug.log file to the support team for review.

 

Here's a sample Android log:

So that’s how you retrieve MAP SDK debug logs from your iOS or Android app. Get more info on MAP SDK here, and view the documentation here.

Anish Kumar is a solutions architect at Akamai Technologies.