Skip to main content

Set Debugging Options

On BrowserStack App Automate, you can debug and fix your failed XCUI tests using video recording and a variety of logs. While executing your XCUI tests, you can configure the debugging options that need to be enabled.

Instrumentation logs

Instrumentation logs are a comprehensive record of your XCUI test executions. They are used to identify all the steps executed in the test and troubleshoot errors for any failed steps. Instrumentation logs are accessible both from the App Automate dashboard, as well as using our REST API.

Instrumentation logs are enabled by default, and cannot be disabled.

Network logs

Network logs capture performance data such as network traffic, latency, HTTP requests and responses in the HAR (HTTP Archive) format. You can download network logs using both the App Automate dashboard, as well as using our REST API. You can visualize HAR files using a HAR Viewer.

Network Logs are disabled by default. To enable network logs, you need to pass the networkLogs parameter in the REST API request to start XCUI test execution.

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"networkLogs": "true", "devices": ["iPhone 8 Plus-11"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"

Device logs

Device logs are system logs specific to your application generated by iOS. They can help you access your application logs and are especially helpful if the application under test crashes during test execution.

Device logs are disabled by default. To enable device logs, you need to pass the deviceLogs parameter in the REST API request to start XCUI test execution. An example cURL request to enable device logs is shown below :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"deviceLogs": "true", "devices": ["iPhone 8 Plus-11"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"

Visual logs

You can capture screenshots for your XCUI tests to find the exact step and the app screen where the failure occurred. They also help identify any layout or design-related issues in your application.

To enable the capture of visual logs, you need to pass the debugscreenshots parameter in the REST API request to start XCUI test execution to save the screenshots automatically captured by XCode.

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"debugscreenshots": "true", "devices": ["iPhone 8 Plus-11"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"

Video recording

Every test executed on the BrowserStack is recorded. This feature is particularly helpful whenever a test fails - it helps you see the test in action. You can access these videos from the App Automate dashboard for each test. You can also download the videos from the dashboard or retrieve a link to download the video using our REST API.

Video logs are enabled by default. Note that video recording slightly increases the text execution time. To disable video recording, you need to set the video parameter to false in the REST API request to start XCUI test execution.

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"video": "false", "devices": ["iPhone 8 Plus-11"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"


Note: Your video recordings are retained on BrowserStack for 30 days from the day of test execution. All other test execution data, including screenshots and logs, are retained on BrowserStack for 60 days from the day of test execution.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert