how to do ui testing
Asked on 06/18/2025
1 search
To perform UI testing in Xcode, you can utilize the UI automation features that have been enhanced in recent versions. Here's a step-by-step guide based on the sessions from WWDC:
-
Set Up a UI Testing Target:
- In Xcode, add a new target by clicking the plus button below the targets list and select "UI Testing Bundle" from the popover. This will create a new UI test folder and template in your project.
-
Record Your Interactions:
- Use the UI automation recording feature in Xcode to record your interactions with the app. This can be done by starting a UI recording session, which will automatically convert your interactions into Swift code. This feature is demonstrated in the session Record, replay, and review: UI automation with Xcode.
-
Review and Edit Recorded Code:
- After recording, review the generated code to ensure it accurately represents the interactions you want to test. You can make adjustments to the code to fine-tune the test.
-
Replay and Review:
- Replay your recorded interactions across multiple devices and configurations to ensure consistency. You can also review video recordings of the test runs to identify any issues. This process is covered in the session Record, replay, and review: UI automation with Xcode.
-
Utilize Xcode Cloud:
- Take advantage of Xcode Cloud to run your tests autonomously, which can help streamline the testing process and ensure your app's UI remains responsive and functional across updates.
For more detailed information, you can refer to the sessions "What’s new in Xcode" and "Record, replay, and review: UI automation with Xcode" from WWDC 2025.

What’s new in Xcode
Discover the latest productivity and performance advancements in Xcode 26. Learn how to leverage large language models in your development workflow. Explore editing and debugging enhancements, improved performance and testing tools, and Swift Build - the open-source build system engine used by Xcode.

Record, replay, and review: UI automation with Xcode
Learn to record, run, and maintain XCUIAutomation tests in Xcode. Replay your XCTest UI tests in dozens of locales, device types, and system conditions using test plan configurations. Review your test results using the Xcode test report, and download screenshots and videos of your runs. We’ll also cover best practices for preparing your app for automation with Accessibility and writing stable, high-quality automation code.

Integrate privacy into your development process
Learn how to build privacy into your apps from the planning stages through deployment. We’ll cover practical ways to integrate privacy at each step of the development lifecycle, focusing on data minimization, on-device processing, and transparency and control. You’ll discover how to use Apple’s tools and frameworks to protect user data and create a privacy-respecting app experience.