How to use Device Logs in Android and iOS to report issues
By Kitakabee, Community Contributor - June 30, 2022
Nobody likes it when their mobile applications crash abruptly when while using it. According to research by dotcominfoway about 62% of the audience uninstall the app if they experience crashes.
To help with the diagnosis of the problem, the operation system of our device generates a ‘device log’. This guide helps you understand how to use device logs to report issues in a mobile application.
Also Read: 5 Reasons Why Mobile Apps Crash
- What Are Device Logs?
- Using Device Logs to Report Issues in an Android App
- Using Android Device Logs on BrowserStack
- Bug Report Feature from your Android Device
- Create Android Bug Reports with the Android Debug Bridge (ADB)
What Are Device Logs?
Device logs are system-generated logs that are used to monitor the operation of a device. The device logs consist of the log messages and inventory of device commands and applied policies. It also contains all the detailed information on the operations that take place in the operating system and the applications. It can help you examine the application logs in a device.
These are particularly helpful when an application in the device is being tested and the application crashes. The device logs are widely used to report issues in Android and iOS applications.
Using Device Logs to Report Issues in an Android App
When an application crashes or there is a problem with running an application, you can use device logs to report these issues on an Android device. If you are wondering how to get logs from an Android device, read the upcoming section.
Using Android Device Logs on BrowserStack
BrowserStack offers two products to test your mobile applications on a range of Android devices. The products are:
App Live: App Live is an efficient product that developers and QA can use to test mobile applications. You can review the product using its free trial option. To use App Live to test your mobile applications,
- Sign up for a free BrowserStack Account.
- Select the device that you want to test on
- Then you will see a developer’s screen on the right and an Android phone template on the left side of the screen. You can use the various functionalities on the screen like Record Session, DevTools, etc
- Now, to get the device log for a particular application, select Dev Tools and All Device Logs.
App Automate: App Automate helps its user to test native and hybrid applications on real Android devices. You can integrate various testing frameworks like Appium, Espresso, EarlGrey, XCUITest, etc with App Automate. You can use BrowserStack’s App Automate to debug your applications instantly using text logs, screenshots of test runs, video recordings, etc.
App Automate helps developers to ship quality updates at a faster rate by reducing the build time by more than 10 times the normal rate via parallel test execution on the BrowserStack Cloud. App Automate complies with Service Organisation Control (SOC) 2, hence you rest assured that all your builds are perfectly secure. They change their privacy policy regularly since user security is one of their prime agenda.
Bug Report Feature from your Android Device
A bug report consists of stack traces, device logs, and diagnostic information to aid you in locating and fixing the bugs in your application. To capture a bug report, from your Android phone:
- Enable Developer option on your device
- From the Developer options, select Take bug report.
- Then select the kind of bug report you want to create and select Report.
- You will receive a notification when the selected bug report is ready.
- If you want to share the bug report with external collaborators, select the notification and share it.
Create Android Bug Reports with the Android Debug Bridge (ADB)
You can also create bug reports using the Android Debug Bridge (ADB).
If you have a single connected device, the following command creates a bug report.
$ adb bugreport E:\Reports\MyBugReports
In the above command, if you do not provide a specific path for the report, it will be saved to the local directory.
If you have multiple connected devices, you need to specify the devices where you want to save the report with the -s option.
Use the below command to get the serial number of the device and then create the bug report.
$ adb devices
List of devices attached
emulator-5554 device
8XR7N16C31003476 device
$ adb -s 8XR7N16C31003476 bugreport
Also Read: Test mobile apps with native device features
Using Device Logs to Report Issues in an iOS App
Devices using iOS maintain continuous device logs of all the operations occurring in the iOS and the individual applications. These device logs can be accessed after an issue occurs. Let’s say you have issues installing an application, you can diagnose the issue by reviewing the device logs via the Console app on macOS.
Using iOS Device Logs on BrowserStack
You can use the effective products offered by BrowserStack (App Live and App Automate) to view the device logs of your Apple device. BrowserStack offers superior features and they are one of the best in the market.
App Live: App Live is an efficient product that developers and QA can use to test mobile applications. You can review the product using its free trial option. To use App Live to test your mobile applications,
- Sign up for a free BrowserStack Account.
- Select the device that you want to test on
- Then you will see a developer’s screen on the right and an Android phone template on the left side of the screen. You can use the various functionalities on the screen like Record Session, DevTools, etc
- Now, to get the device log for a particular application, select Dev Tools and All Device Logs.
App Automate: App Automate helps its user to test native and hybrid applications on real Android devices. You can integrate various testing frameworks like Appium, Espresso, EarlGrey, XCUITest, etc with App Automate. You can also use this program to debug your applications instantly using text logs, screenshots of test runs, video recordings, etc.
Using your physical iPhone or iPad
You can also view the device logs using your iPhone or iPad. To access the device logs using your iPhone or iPad, you need to follow these steps:
- Tap on Settings on the home screen and select Privacy
- Scroll down and select the Analytics option
- Then click on Analytics data to view the list of device logs related to app crashes
- You can further click on one of the crashes and view the detailed log of events.
Unlike BrowserStack products, this list is not very user-friendly. However, it can be useful in certain situations such as the occasional crash of a particular application.
Using iTools
iTools is mainly used to access the device logs of an iOS device when you have a Windows computer rather than an Apple Mac Computer. Follow the steps below to access the device logs of an iOS device via an application called iTools:
- Download iTools. You can select iTools for Windows or Mac depending on the operating system of your device
- Install the iTools application and launch it
- Plug in the iOS device to your computer and unlock your iOS device
- As soon as your iOS device connects to the computer, you will see a prompt asking you to trust the device
- Select Trust on the device
- You can have a free trial of iTools
- Click on Toolbox and then on Console Log
- Now you need to run an application to view the device logs related to it
- If you want to save the logs, Click on Save Full Log.
When an application on our device crashes, it generates logs of information pointing us to the issue that was behind the crash. These device logs help us to collect information about app-related issues and their diagnosis. Ultimately, these device logs play an important role in the testing of an application and ensuring that everything is running smoothly.
You can use the efficient cloud products offered by BrowserStack to view device logs and report bugs. It helps in debugging applications using a real device cloud. Therefore, developers and QA can use it for testing and debugging the application remotely.
Companies using BrowserStack have significantly reduced their testing time.
Using App Live, you can use native device features to test your mobile application on a range of Android & iOS devices supported by BrowserStack. Using App Automate, you can automate mobile application testing on real mobile phones rather than the internal testing grids. You can schedule a free trial for both the BrowserStack products before subscribing to a plan.