Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

A Summary of the WWDC25 Group Lab - Developer Tools
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for Developer Tools. Will my project codebase be used for training when I use Xcode's intelligent assistant powered by cloud-based models? When using ChatGPT without logging in, your data will not be used to improve any models. If you log in to a ChatGPT account, this is based on your ChatGPT account settings, which allows you to opt-out (it defaults to on). When using Xcode with accounts for other model providers, you should check with the policies of your provider. And finally, at no point will any portion of your codebase be used to train or improve any Apple models. We'd love to make our SwiftUI Previews (and soon, Playgrounds) as snappy as possible. Is there any way to skip certain build steps, such as running linters? It seems the build environment is exactly the same (compared to a debug build), but maybe there's a trick. Starting with Xcode 16, SwiftUI previews use the exact same build artifacts as the regular build. The new Playgrounds support in Xcode 26 uses these build artifacts too. Shell script build phases are the most common thing that introduces extra build time, so as a first step, try turning off all shell script build phases (like linters) to get an idea if that’s the issue. If those build phases add significant time to your build, consider moving some of those phases into asynchronous steps, such as running linters before committing instead of on every build. If you do need a shell script build phase to run during your build, make sure to explicitly define the input and output files, as that is a huge way to improve your build performance. Are we able to provide additional context for the models, like coding standards? Documentation for third party dependencies? Documentation on your own codebase that explains things like architecture and more? In general, Xcode will automatically search for the right context based on the question and the evolving answer, as the model can interact multiple times with your project as it develops an answer. This will automatically pick up the coding style of the code it sees, and can include files that contain architecture comments, etc. Beyond automatic context, you can manually attach other documents, even if they aren't in your project. For example, you could make a file with rules and ideas and attach it, and it will influence the response. We are very aware of other kinds of automatic context like rule files, etc, though Xcode does not support these at this time. Once ChatGPT is enabled for Coding Intelligence in Xcode 26, and I sign into my existing ChatGPT account, will the ChatGPT Coding Intelligence model in Xcode know about chat conversations on Xcode development done previously in the ChatGPT Mac app? Xcode does not use information from other conversations, and conversations started in Xcode are not accessible in the web UI or ChatGPT app. Is there a plan to make SwiftUI views easier to locate and understand in the view hierarchy like UIKit views? SwiftUI uses a declarative paradigm to define your user interface. That allows you to specify what you want, with the system translating that into an efficient representation at runtime. Unlike traditional AppKit and UIKit, seeing the runtime representation of SwiftUI views isn't sufficient in order to understand why it's not doing what you want. This year, we introduced a SwiftUI Instrument that shows why things are happening, like view re-rendering. Is it possible to use the AI chat with ChatGPT Enterprise? My company doesn't allow us to use the general ChatGPT, only the enterprise version they have setup that prevents data from being leaked Yes, Xcode 26 supports logging into any existing ChatGPT account, including enterprise accounts. If that does not meet your needs, you can also setup a local server that implements the popular chat completions REST API to talk to your enterprise account how you need. Now that Icon Composer is here, how does it complement or replace existing vector design tools such as Sketch for icon design? Icon Composer complements your existing vector design tools. You should continue to create your shapes, gradients, and layers in another tool like Sketch, and compose the exported SVG layers in Icon Composer. Once you bring your layers into Icon Composer, you can then use it to influence the translucency, blur, and specular highlights for your icon. What’s one feature or improvement in the new Xcode that you personally think developers will love, but might not immediately discover? Maybe something tucked away or quietly powerful that’s flown under the radar so far? One feature we're particularly excited about is the new power profiler for iOS, which gives you further insights into the energy consumption of your app beyond what was possible with the energy instrument previously. You can learn more about how to use this instrument and how it can help you greatly reduce your apps battery usage in the documentation, as well as the session Profile and optimize power usage in your app. There were also improvements in accessibility this year with Voice Control, where you can naturally speak your Swift code to Xcode, and it understands the Swift syntax as you speak. To see it in action, take a look at the demonstration in What’s new in Xcode 26. We have a software advisory council that is very sensitive to having our private information going to the cloud in any form. What information do you have to help me guide Xcode and Apple Intelligence through the acceptance process? One thing you can do is configure a proxy for your enterprise that implementing the popular Chat Completions API endpoint protocol. When using a model provider via URL, you can use your proxy endpoint to inspect the network traffic for anything that you do not want sent outside of your enterprise, and then forward the traffic through the proxy to your chosen model provider. Are there list of recommended LLMs to use with Xcode via Intelligence/Local? I've tried Gemma3-12B, but.. I hope there are better options? Apple doesn't have a published list of recommended local models. This is a fast-moving space, and so a recommendation would become out of date very quickly as new models are released. We encourage you to try out the local model support in Xcode 26 with models that you find meet your needs, and let us and the community know! (continued below)
1
0
1.1k
Jul ’25
Xcode Simulator error
Following is an error I encounter when trying to run a foundation model function in simulator. Error Domain=FoundationModels.LanguageModelSession.GenerationError Code=-1 "(null)" UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=ModelManagerServices.ModelManagerError Code=1026 "(null)" UserInfo={NSMultipleUnderlyingErrorsKey=(\n)}" )} Its a swift playground I'm building in xcode and works fine in the preview and on a real device too but since it's my submission for the swift student challenge I need it to run on the simulator. I have updated my macOS to latest version of Tahoe(26.3) and Xcode is also on latest version. The simulator I run the playground is also on ios and iPadOS 26. I have set my region to US and have turned on Apple Intelligence on my mac too. Any suggestions on how to fix the issue?👾
1
0
39
2d
Build/Archive failure in Xcode 16.2 after updating macOS to 26.2
We are encountering a build and archive failure in Xcode after updating our development machine to macOS 26.2. Environment: macOS: 26.2 Xcode: 16.2 iOS Deployment Target / Runtime: iOS 18.5 App Type: Production iOS app (App Store distribution) Issue: Before updating macOS, the project built and archived successfully. After the macOS 26.2 update, archiving fails consistently, even though no major changes were made to the project code or configuration. Certificates, provisioning profiles, and signing settings are correctly configured. The issue appears to be related to the macOS/Xcode environment rather than application logic. Steps to Reproduce: Open the existing iOS project in Xcode 16.2. Select the App Store distribution scheme. Attempt to Archive the project. Archive/build fails. Expected Result: Successful archive allowing upload to App Store Connect. Actual Result: Archive fails after macOS 26.2 update. Additional Info: This post is linked to Apple Developer Technical Support Case-ID: 18413014.
1
0
35
3d
Q&A Summary for Code-along: Experiment with coding intelligence in Xcode 26
We received many great questions from the community during Code-along: Experiment with coding intelligence in Xcode 26. Here are the highlights from the questions submitted by the audience during the event. What models does coding intelligence features support In Xcode? Xcode integrates directly with ChatGPT and Claude user accounts. You can also configure Xcode to integrate any model provider that supports the Chat Completions API, such as models that you access with an API key. You can also download and run a local model on a Mac with Apple silicon. Setting up coding intelligence provides all of the information you need to get started with Xcode’s direct integration with ChatGPT and Claude, as well as how to set up Xcode to access other providers. Does Coding Intelligence have access to Apple API and developer documentation? How does it stay up to date with the latest SwiftUI API? Coding agents are great because they talk to a model, generate code and fix errors, but they also have access to tools, which make a significant difference in their capabilities. Xcode provides tools for the agent to use, including the ability to search Apple’s documentation and, code snippets. As an example, you can ask for a new API that was released in iOS, and if the model doesn't have this knowledge, the agent will call the tool to search for the documentation and bring that context into the conversation. As an organization, we do not have permission to share our codebase with any AI model due to security reasons. If we enable coding intelligence and give it access to our codebase, will the code be shared with Apple? Will OpenAI or Anthropic have access to my entire project? Privacy is fundamental to our design. When you connect an AI subscription account (like an account with OpenAI or Anthropic), the connection is only between you and that service. Apple does not act as an intermediary, and never sees the code sent to these services. Because this interaction happens directly between the you and your provider, the security and privacy of your code is determined entirely by your existing agreement with your provider. What exactly does the agent have access to? Only the files in the scope of the project? By default, the agent works in the directory of your project, and can access all files in that directory. This includes code file, assets, and your Xcode project configuration file. Does coding intelligence remember previous conversations? Each time you start a new conversation window, it resets the context of the conversation, but you can always go back to a previous conversation you had and continue and iterate on a previous idea. If a result contains errors or did not go in a direction you are happy with, you can use the history to go back to any point in time. Writing code with intelligence in Xcode goes into detail on how you can use these features. For command-line tools (Claude Code, OpenAI Codex), I can create guidelines as Markdown with rules or project descriptions. Does Xcode Agentic Coding take these into account, or should I define them differently? You can add skills that you’ve created, hints about Xcode and your project to configuration files, and other files supporting your use of coding intelligence such as AGENTS.md or CLAUDE.md files, to the respective Codex and Claude Agent directories that Xcode uses exclusively: ~/Library/Developer/Xcode/CodingAssistant/codex ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig For more information on configuring agentic coding tools that run inside Xcode, see Customize the Codex and Claude Agent environments. How do you add a Model Context Protocol server for the Xcode agent to be able to access? You can add additional Model Context Protocol (MCP) servers in Xcode with product-specific configuration files so the agents can use those MCP servers from within Xcode. Locate the files needed to configure those additional MCP servers in the same directory where you set other customizations for Codex or Claude Agent, listed above.
0
0
35
3d
AVP, Developer Strap v2, Ethernet connection and Xcode
Hi, I wonder if there's something that can be configured to force Xcode (and preferably MVD too) to use Ethernet connection between Mac Mini and Apple Vision Pro (over a USB hub, not a direct USB connection)? If I connect AVP to Mac directly via USB, the bridge gets created and both MVD and Xcode default to it, which is great because of higher speed and lower latency. My problem is that I work with external camera, so I can have either the camera, or the Mac connection, but not both. I tried to solve that by plugging in a small active USB hub, so the strap and camera are connected to it, plus it has Ethernet adapter, which is plugged into Mac port. I tried with internet sharing on Mac - AVP has internet access, I can ping AVP from Mac, but Xcode and MVD still use wifi. I tried to manually configure bridge without internet sharing - same effect. I tried to make the bridge highest priority connection - nothing changed. I tried to force routing to AVP IP over the bridge - nothing (and it seems that my routing entry went missing after some time and was replaced by "use wifi interface"). So - is there something more I can do to make at least Xcode go over the cable? Debugging over wifi often takes forever.
0
0
22
3d
Place an app on a family device
I had a free developer account and now have a paid account. I can now install unlimited number of apps on my personal devices. I want to install more than 3 apps on a device of a family member. The device of this member has been registered under Certificates, Identifiers & Profiles. When I try to install apps with xCode on this family device I still get the message that I reached the limit of 3 apps (free account). By signing & capabilities I use the paid account as team. I have deleted all the apps on that device where installed with the free account, restarted the device and restarted xcode but the problem still exists.
0
0
34
3d
Can not delete "Other installed Platforms"
I recently found out that my System Storage is at about 200GB. I checked my XCode and found these "ohter installed platforms" (screenshot1). I can delete them there but as soon as I restart my computer, they will show up again. I found the folder /System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime which uses 75GB and Im pretty sure that these simulators are the ones in XCode. This folder doesnt change a bit when I delete the simulators in Xcode. I cant delete the folder because of permissions... anyone an idea? Btw: 200gb systemdata of 500gb seems pretty miserable. Kind regards
2
0
41
3d
App freezes when running in Rosetta simulator on Xcode 26 (works on device and ARM simulator)
Hello, We are experiencing a recurring issue when running iOS apps in the Rosetta simulator on Xcode 26. Environment: Xcode: 26.0 macOS: 15.7.3 Simulator: Intel-based (Rosetta) simulators Languages: Both Swift and Objective-C Issue: When launching an app in a Rosetta simulator, the app frequently freezes or fails to run. In many cases, Xcode reports that the debugger has lost connection. Xcode error message: Lost connection to the debugger on “iPhone 12”. Domain: IDEDebugSessionErrorDomain Code: 22 Failure Reason: Message from debugger: lost connection Console log: assertion failed: GPR thread_set_state is unimplemented for NewThread (ThreadContextRegisterState.cpp:920 host_gpr_state_from_guest_state) Observed behavior: Rebuilding after fully quitting the simulator sometimes resolves the issue temporarily. Disabling Scheme > Run > Debug executable allows the app to run normally, but debugging (breakpoints, etc.) becomes unavailable. The issue does not occur: On real devices On ARM-based simulators When building with Xcode 16 using Rosetta Has anyone encountered this issue with Xcode 26 and Rosetta simulators? Is this a known bug, and are there any recommended workarounds besides disabling the debugger or restarting the simulator? Thank you in advance for any insights or guidance.
0
0
29
4d
Apple Intelligence cant change Xcode build target...?!
› It is reasonable to assume Xcode AI integration means AI being able to change the build target... “Why can Xcode Intelligence see source files but not .xcodeproj/project.pbxproj for direct edit?” “Is this a known limitation/bug in Xcode 26.3 RC Project Context or MCP Xcode Tools?” “Any required entitlement/setting beyond Intelligence > Xcode Tools for build-setting edits?”
2
0
33
4d
Simulator since XCode update completely broken
Since one of the last updates of XCode, there are two very annoying bugs in the simulator that just don't get fixed. What's going on Apple? You kill my productivity. There is a red bar reading "rdar" and some numeric string at the top. You can get rid of it by going to Settings -> Developers -> Zoom -> Larger Text (then change it back). Took a while to find that. I have a German laptop with a QWERTZ keyboard layout. Now when I type, it somehow sends keys from an US keyboard to the simulator. Since I don't have the labels, I don't know what the hell I'm typing. Very frustrating. Please fix this.
3
0
62
4d
Localizing NSAlarmKitUsageDescription
I've added NSAlarmKitUsageDescription to Info.plist and InfoPlist.xcstrings. The localized string is being used when I run the app, but Xcode is marking the string as "stale" in InfoPlist.xcstrings. This doesn't occur for any of the other UsageDescription strings in our app, such as NSPhotoLibraryUsageDescription and NSSiriUsageDescription. This occurs in both Xcode 26.2 and Xcode 26.3 RC. Is this a known issue? Should I just mark the string as being managed "Manually" instead of "Automatically" to make the warning go away?
1
0
33
5d
protocol witness error in Playgrounds
I'm importing SwiftUI, Foundation and Charts into an iOS app I'm writing in Swift in Xcode Playgrounds and am getting this error: error: Couldn't look up symbols: protocol witness table for Foundation.Date : Charts.Plottable in Charts the code looks like this in just two example files: file 1, the view import Foundation import SwiftUI import Charts import PlaygroundSupport struct FirstChart_WithDates: View { private let data = ChartDateAndDoubleModel.mockData(months: 3) var body: some View { Chart(data) { item in BarMark( x: .value("Label", item.date, unit: .month), y: .value("Value", item.value) ) } .padding() .aspectRatio(1, contentMode: .fit) .dynamicTypeSize(.accessibility1) ChartDateAndDoubleModelView(data: data) } } struct ChartDateAndDoubleModelView: View { var data: [ChartDateAndDoubleModel] var body: some View { VStack { HeaderRowView(texts: ["date", "value"]) ForEach(data) { datum in HStack { Text(datum.date.formatted(date: .abbreviated, time: .omitted)) .frame(maxWidth: .infinity) // TODO: Format for 2 decimal places. Text(datum.value, format: .number.precision(.fractionLength(2))) .frame(maxWidth: .infinity) } } } .padding(.bottom, 8) .overlay(.quaternary, in: .rect(cornerRadius: 8).stroke()) .padding() } } struct HeaderRowView: View { var texts: [String] var body: some View { HStack(spacing: 2.0) { ForEach(texts, id: \.self) { text in Text(text) .padding(4) .frame(maxWidth: .infinity) .background(.quaternary) } } .font(.headline) .mask(UnevenRoundedRectangle(topLeadingRadius: 8, topTrailingRadius: 8)) } } and file 2, the model: import Foundation import SwiftUI import Charts // ChartDateAndDoubleModel.swift // // // Created by Michael Isbell on 2/10/26. // public struct ChartDateAndDoubleModel: Identifiable { public let id = UUID() public let date: Date public let value: Double } public extension ChartDateAndDoubleModel { static func mockData(months: Int = 5) -> [ChartDateAndDoubleModel] { var data: [ChartDateAndDoubleModel] = [] let calendar = Calendar(identifier: .gregorian) let currentDate = Date() for month in 0..<months { //add month to current date and append to data data.append( ChartDateAndDoubleModel( date: calendar.date(byAdding: .month, value: month, to: currentDate)!, value: Double.random(in: 0...1000) ) ) } return data } }
1
0
35
5d
XCode: cannot pair devices
Since upgrading to a new Mac I have been unable to pair XCode to devices using the Devices and Simulators window. When I press the + button I get 'no devices found'. I have a second Mac which works as expected. When I try 'xcrun devicectl list devices' the phone I've connected shows up with limited information and is 'unavailable'. If I run 'sudo xcrun devicectl list devices' then I get a message telling me not to run xcrun as root but also the full information about the phone as expected, plus it shows the status as 'available (paired)'. So the device seems to be defined with root privileges but XCode is not. I am running XCode 26.2 but this issue has been around since 26.0. Any suggestions welcome.
1
0
82
5d
String Catalog Symbols: No Reference-Language Fallback for Partially Translated Locales
I'm having troubles converting my string catalog to symbols because for partly translated languages there is no fallback to the reference language. Let me give you an example. Example Assume an app that supports two languages: English and Japanese. The app is very simple and has only two strings, using symbols in a String Catalog: Key: .helloWorld → “Hello World!” Key: .info → “Information” Case 1: No Japanese translations If I launch the app in Japanese and neither string is translated, English is used as a fallback. The UI shows: “Hello World!” “Information” This is exactly what I would expect. Case 2: Only one string translated Now assume I translate only one string into Japanese: .helloWorld → “こんにちは世界” When I launch the app in Japanese now: .helloWorld correctly shows “こんにちは世界” .info shows info, not “Information” So instead of falling back to English, the key is displayed. This issue does not pop up when I don't use symbols. Because then, my SwiftUI Text elements contain the English ideal text as a (kind of) key. I assume for commercial apps all strings are always translated into all supported languages. But this is not the case for apps where translations happens through crowd translations. Check the following link. There you will see that only English (reference language) and German (my native language) are 100% translated. Others will follow over time. https://poeditor.com/join/project/J2Qq2SUzYr For now, I guess I'll have to avoid symbols. Or is there a better way to handle this?
1
0
37
5d
Xcode 26.3 Claude Agent can't access Desktop folder
I am using the Xcode 26.3 Claude Agent feature. Claude Agent can’t access on my Desktop folder when they are specified as chat attachments because I accidentally denied access to that folder when it was first requested. I had earlier read the Xcode 26.3 release notes, so I was somewhat aware of this known issue, but I didn't make the connection when the Desktop access prompt appeared. I wasn't expecting the permissions prompt, because the regular (non-agent) Xcode Claude is able to freely access Desktop files when they are specified as Xcode coding assistant chat session attachments. Claude Agent isn’t listed in macOS Settings > Privacy & Security > Files and Folders, so I can’t fix the permissions there. The TCC database contains these rows: % sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \ "SELECT service, client, datetime(last_modified, 'unixepoch', 'localtime') as last_modified FROM access ORDER BY last_modified DESC" | head -2 kTCCServiceSystemPolicyDownloadsFolder|/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude|2026-02-07 15:19:25 kTCCServiceSystemPolicyDesktopFolder|/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude|2026-02-07 13:38:07 but I can’t seem to reset them using tccutil, apparently because /Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude is not a valid bundle identifier: % tccutil reset all '/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude' tccutil: No such bundle identifier "/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude": The operation couldn’t be completed. (OSStatus error -10814.) I would like for Claude Agent to be able to access my Desktop folder. What is an appropriate next step? Thank you for any help you can provide.
1
0
72
1w
Cannot preview in Xcode
My computer setup is I work from an account with regular (non-admin) privileges. I login into the admin account to install apps, update the OS, that kind of stuff, but work is from the reduced privileges account. And, when in it, I cannot preview swiftUI views in Xcode. Incredibly frustrating, have tried everything including a complete wipeout of the disk and reinstall, but no luck. Don't have any iOS simulator targets installed, it's macOS target I am working on. If I fire up xcode from the admin account it's all good, previes work and so on. Not so in the non-admin account, consistenly getting the "Cannot preview in this file. Failed to launch xxxx" Also tried elevating the privileges of the account to Admin, rebooting, no luck. Tried creating a new account, non-admin or admin, no luck. The detailed error repeats something along the lines of: == PREVIEW UPDATE ERROR: GroupRecordingError Error encountered during update group #3 ================================== | FailedToLaunchAppError: Failed to launch GIIK.Mesh-One | | /Volumes/Glyph 2TB/Developer/M4Book/Mesh One/DerivedData/Mesh One/Build/Products/Debug/Mesh One.app | | ================================== | | | [Remote] JITError | | | | ================================== | | | | | [Remote] XOJITError | | | | | | XOJITError: Could not create code file directory for session: Permission denied Most telling is the double space between directory and for on the last error line, it sounds like a failed string interpolation because the directory name was nil or empty? This is very frustrating (I also filed FB21900410). Am I missing something obvious? I also dumped the build settings and diffed the admin and non-admin accounts and they are an exact match (save for the path names). There has to be something that's preventing the non-admin accounts from previewing, anyone know what it might be/where to look? Cheers,
0
0
134
1w