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:
- For iOS and tvOS apps, connect a device to your Mac. For watchOS apps, connect an iPhone paired with an Apple Watch.
- Under Devices, select your device.
- Under Installed Apps, select your app from the list (in the example below, it’s “SampleApp”).
- 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.
- 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
- On the Android device, enable USB debugging (on Android 4.x, go to: Settings > Developer options > USB Debugging).
./adb kill-serveras a fail-safe measure, then run:
./adb devices. This will list the available connected devices, like so:
- Copy the device ID to the clipboard, then run:
./adb logcat -v threadtime [device ID] > /tmp/android-debug.logThis will save the logs in the file named android-debug.log.
- Perform the actions observed as problematic on the Android device
- 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:
Anish Kumar is a solutions architect at Akamai Technologies.