...
Collecting logs from Android devices is a common step when troubleshooting issues with Workspace ONE UEM on Android. You can accomplish this by following the instructions below.
ADB Logs: ADB (Android Debug Bridge) is a command line tool for interacting with Android phones on your computer. ADB lets you manually sideload apps, uninstall apps, see logs, pull and push files, backup your device, and perform some other useful actions. Download adb.exe: Download the Android SDK Platform Tools on your PC from https://developer.android.com/studio/releases/platform-toolsExtract the ZIP file at any locationOpen a CMD at %extract_location%/platform-tools/Test ADB by typing 'adb devices'. This should return an empty response for now. It is also recommended to verify that the specific drivers for your device are installed. Windows sometimes is able to get them automatically; otherwise you will have to download them from the manufacturer's website.ADB should now be installed in C:\ADB. Enable USB debugging on your device USB debugging needs to be enabled on the device in order to enable ADB features. In order to enable USB debuggining, you may do the following: The "Secure Debugging" feature requires that you manually approve your computer for an ADB connection. Developer Options are hidden.To enable Developer Options, navigate to Settings > About Phone.Tap Build Number 7 times. You will see a toast message stating you are now a developer. Go back to main Settings menu and find the sub-setting called Developer Options.Navigate to Developer Options, then check USB Debugging. Getting Started with ADB Connect your device to your PC via a USB portAccept the prompt to trust the computer on the deviceTo confirm that all necessary drivers have been installed and that USB Debugging has been successfully enabled, run adb devices on the CMD prompt and confirm that the device shows up (list is not empty).If the device does not appear, you are likely missing device drivers. To find all necessary device drivers on your PC, open a web browser and search (via Google, Yahoo, etc.) for adb drivers for device X. Download and install the drivers on your local PC with admin rights.Check that adb devices is pulling up the device in question. If the devices shows up as unauthorized, unplug the device, plug back in, and accept the prompt to trust the PC. How to gather logs using Logcat You can use logcat from an ADB shell to view the log messages. The Android logging system provides a mechanism for collecting and viewing system debug output, which then can be viewed and filtered by the logcat command. Use the below command:adb logcat *:# Where # stands for one of the following:V Verbose (show all possibly useless logs, default levelD Debug (show all reasonable debug logs)I Info (show expected logs for regular usage)W Warn (show possible issues that are not yet errors)E Error (show issues that have caused errors)F Fatal (show issues that are fatal to runtime and will often result in rebooting) ADB will start collecting logs and start writing them to a text file.Start replicating the behavior and once you have replicated the issue, type CTRL+C to stop capturing logsNavigate to c:/adb/on your file explorer. The file "txt" will now contain the logs. Bug Report These are the debug level device logs which would contain device logging for a limited period of time prior to when this report is generated. It will also contain other dumpstate information including device’s system info, apps, services running, network connections etc. To collect the bug report: Navigate to device settings and enable Developer Options (see section for ADB logs)Navigate to Developer Options and tap on Take/Submit Bug ReportSelect Full Report when prompted to get the full device info along with the logsThe bug report takes up to 2 minutes to be generated Once generated, you will see a device notification example: Bugreport #1 captured AirWatch Agent logs MDM-specific logs can be collected directly from the AirWatch Agent on an Android device. These can be sent to the Workspace ONE UEM Console for analysis by an administrator. However, these logs are not fully verbose and will only show the logging from Workspace ONE applications rather than the entire device. Nevertheless, they are useful for an initial look at where a particular issue may lie. Follow the steps below to gather these logs and send them to the Workspace ONE UEM Console. Logs will be gathered in real time on the device. As such, you will first want to reproduce the specific intended behavior in order to have relevant logs. As soon as the behavior has been reproduced, move on to the next steps.Open the AirWatch Agent and navigate to the Agent settings menu.Choose Send Debug Log. Note: The logs will be sent to the Workspace ONE UEM Console. Navigate to Device Details > More > Attachments > Documents for the device in question. All debug logs that have been sent to the console will be available for download. Request Device Log Remotely Workspace ONE UEM Admins can request logs from devices by sending a “Request Device Log” command from the Workspace ONE UEM Console. In almost all cases, these logs are limited to the log output of the Workspace ONE UEM Hub and are EMM-specific. With Android (Legacy) devices from OEMs that utilize our generic Platform OEM Service, admins can elect to collect full logs from all processes on the device. From specific devices and EMM-specific logs can be collected directly from the Workspace ONE Intelligent Hub on an Android device. These can be sent to the Workspace ONE Console for analysis by an administrator. However, these logs are not fully verbose and will only show the logging from Workspace ONE applications rather than the entire device. Nevertheless, they are useful for an initial look at where a particular issue may lie. Follow the steps below to gather these logs and send them to the Workspace ONE UEM Console. Logs will be gathered in real time on the device. As such, you will first want to reproduce the specific intended behavior in order to have relevant logs. As soon as the behavior has been reproduced, move on to the next steps.Open the Intelligent Hub and navigate to the Hub settings menu.Choose Send Debug Log. The logs will be sent to the Workspace ONE UEM Console. Navigate to Device Details > More > Attachments > Documents for the device in question. All debug logs that have been sent to the console will be available for download. Hub Wipe Logs This is strictly for when a device has been unenrolled and contains the reason for unenrollment. This is collected directly from the Hub’s Welcome screen. The steps to collect wipe logs are as follows: Tap on the Hub icon on the Welcome screen of the Intelligent Hub app 5 timesNext, on the Share logs screen, select Share or Copy If you select Copy, the log file will be stored locally on the device at the location data/com.airwatch.androidagent/files/logs Dumpstate Logs Most carriers have a dialer code that can be entered on non-tablet devices to bring up a System Dump menu. From here, verbose device logs and information can be obtained for periods of time prior to the command being run, similar to bug report. However, note that Verizon devices do not have this menu available. Follow the steps below to utilize this logging. Type *#9900# in the Phone/dialer applicationPress button ENABLE SECLOG(CURRENTLY DISABLED)Reboot device.Reproduce the issue.Soon after the reproduction, type *#9900# in the Phone applicationSelect RUN DUMPSTATE/LOGCATSelect COPY TO SDCARD(INCLUDE CP RAMDUMP).When this successfully completes, you will see a message indicating success. Connect your device to your PC, and browse to {Device} > Phone > log. Select the most recent log file and open it into a text editor.