Xcode - Apple Developer (original) (raw)

Coding intelligence

Leverage coding models in Xcode

Powered by Apple silicon, predictive code completion uses an on-device machine learning model trained for Swift and Apple SDKs to give you intelligent suggestions based on your project and coding style. Xcode also supports interacting with code using the large language model of your choice, including support for the advanced coding model of ChatGPT. And with Coding Tools, you can get help with writing code, tests, and documentation, or fixing errors directly from the source editor. It’s just like Writing Tools, but for code!

Previews

Iterate quickly and preview while you work

With Xcode Previews, you can quickly visualize the changes you make in your views in the preview canvas. Add previews to your SwiftUI, UIKit, and AppKit views using the preview macro. Then configure how you want your previews to display using Xcode’s preview canvas, or programmatically in code.

When you select the live or interactive preview option, your view appears and interacts just like it would on a device or simulator. And in select mode, the preview displays a snapshot of your view so you can interact with your view’s UI elements in the canvas. Selecting a control in the preview highlights the corresponding line of code in the source editor. You can also adjust device settings to control how a preview displays, including in Dark Mode, landscape orientation, or different sized text.

Simulator

Prototype on every device, all from your Mac

Simulator enables rapid prototyping through testing your app in a simulated environment across Apple devices and OS versions when a real device isn’t available. Experience great performance, advanced debugging tools, and the ability to simulate various scenarios like location changes, memory warnings, network throttling, and more. Whether you’re optimizing for the latest hardware or ensuring compatibility with legacy devices, Xcode’s Simulator ensures your apps delivers the same experience across all devices.

Debug

Find and fix bugs

Xcode is packed with tools that help you inspect your app, isolate bugs, find crashes, identify bottlenecks, and more.

The Xcode debugger provides a clear look into your app’s behaviors. You can pause execution at specified breakpoints, inspect memory usage to find leaks, and monitor variables to identify when their values change.

The Xcode Organizer allows you to manage your app’s development from start to finish — including testing, debugging, building, and deploying. You can also analyze anonymized performance data from your app’s users to assess launch times, memory usage, UI responsiveness, battery impact, and more.

Profile and Analyze

Get real-time insights

Instruments takes app performance to the next level, providing real-time insights that help you deliver a smooth and responsive experience to your users. With Instruments, you can compare CPU, disk, memory, and GPU performance as graphical tracks over time; identify performance bottlenecks, then dive deep into the code to uncover the cause; analyze your app directly, or sample the entire system with very little overhead; and you can create custom instruments with unique visualizations to analyze your own code and frameworks.

Test

Measure, update, observe

Xcode includes resources to help you test your code, catch issues early, and deliver the highest quality apps and games.

With the Swift Testing framework you can write unit tests that take advantage of the powerful and expressive language capabilities of Swift. And if you already have tests written with XCTest, you can run them side by side with newer tests that were written with Swift Testing to help you migrate tests incrementally, at your own pace.

You can also use XCTest to write UI tests that control your app’s UI using XCUIAutomation. And XCTest includes built-in support for performance measurement, so you can ensure your app is running as efficiently as possible.

Xcode Cloud

Supercharge your development workflow

Xcode Cloud is a continuous integration and delivery service built into Xcode and designed expressly for Apple developers. It accelerates the development and delivery of high-quality apps by bringing together cloud-based tools that help you build apps, run automated tests in parallel, deliver apps to testers, and view and manage user feedback.