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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

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
38
2w
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
55
2w
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
118
2w
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
66
2w
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
106
3w
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
154
3w
Xcode Intelligence Font Size
Dear Friends, Is there a way to increase font size of xcode intelligence window? So the text i write, and the AI response. Why do i need this? I am using 4K monitor and i dont want to make Display setting bigger and lose all screen space.
1
1
93
3w
MCP servers don’t start in Codex (Xcode 26.3)
I’m trying to use MCP servers with Xcode 26.3 Coding Intelligence (Codex agent). With a project-scoped config file at /.codex/config.toml, MCP servers are not reliably loaded. /.codex/config.toml Example: [mcp_servers.Notion] url = "https://mcp.notion.com/mcp" enabled = true [mcp_servers.XcodeBuildMCP] command = "/bin/zsh" args = ["-lc", "/opt/homebrew/bin/npx -y xcodebuildmcp@beta mcp"] enabled = true tool_timeout_sec = 10000 Expected: Xcode consistently loads MCP servers defined in /.codex/config.toml across restarts. Actual: Xcode often only exposes xcode-tools. In some sessions MCP servers appear, but after restarting Xcode they may disappear. The global file at ~/Library/Developer/Xcode/CodingAssistant/codex/config.toml also seems managed/rewritten by Xcode and isn’t reliable for custom MCP servers. Questions Is /.codex/config.toml the official/supported way to configure MCP servers for Codex in Xcode right now? Are there any requirements for Xcode to load it (e.g. workspace must be Trusted, open .xcworkspace vs .xcodeproj, full restart/force quit, etc.)? Is there any logging/diagnostics to understand why the MCP server is not starting or not being picked up?
0
2
132
3w
Broken autocomplete in Xcode 26
Xcode 16 and 26 changes in painful way how the Tab key works during autocomplete. Previously, pressing Tab would extend the typed text up to the word match. For example, we have two classes: NSViewController and NSViewCoordinator BEFORE, typing: "NSV" + Tab used to complete to NSViewCo Now, in Xcode 26, pressing Tab just use the first suggestion. Stupidly. Especially when you want DispatchQueue and it gaves you DispatchSemaphore… That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually. How to restore the previous behavior? How to do autocomplete word-by-word?
6
0
165
3w
Xcode 26.3 unlocks the power of agentic coding!
Hello, developers! Xcode 26.3 unlocks the power of agentic coding! Get ready to explore new features that released last Tuesday. If you haven't already, you can download Xcode 26.3 from the Apple Developer Downloads page Check out the official documentation for getting started and how to configure agents in Xcode: ‎ Writing code with intelligence in Xcode Generate code, fix bugs fast, and learn as you go with intelligence built directly into Xcode https://developer.apple.com/documentation/xcode/writing-code-with-intelligence-in-xcode/ ‎ Setting up coding intelligence Enable third-party coding tools that you want to use in the coding assistant https://developer.apple.com/documentation/xcode/setting-up-coding-intelligence ‎ Giving external agentic coding tools access to Xcode Let agentic coding tools access your project and Xcode capabilities using the Model Context Protocol https://developer.apple.com/documentation/xcode/giving-agentic-coding-tools-access-to-xcode ‎ Code-along: Experiment with coding intelligence in Xcode 26 Presented live at a Meet with Apple event: Learn how coding intelligence features can help you write code and fix errors with example prompts and resources. ‎ ‎We are also introducing a new tag to the forums Coding intelligence ✨. Use this tag when discussing these new features to increase visibility on the forums to help others chime in.
1
0
189
3w
Annoying popup window in Xcode Previews when the initial controller of the main storyboard is a macOS window
I started a project targeting macOS and used Storyboard app lifecycle. I also used Xcode Previews in this project. If I: Keep the entry point of the main storyboard to a window controller. (as default setup in macOS), Turn the Xcode window into full-screen, That window controller would pop up its window every time Xcode Previews refreshes. I tested in Xcode 26.3 RC and many versions before.
5
0
168
3w
How does Xcode26.3 Agent know about the API Documentation for non Apple Intelligence
Lets say I use a SDK that has some custom components .ie. Liquid Glass but with neon background (just for fun) . This SDK has comprehensive API Docs . Currently Xcode provides DocumentationSearch mcp tool only for Apple APIs . Is there a way to enhance api search beyond Apple SDKs , for examples seeing the definitions in xcframwork. If not can Xcode connect to local/hosted mcp-servers . Or do these have to be modified in Claude settings.
2
0
475
3w
Are there workarounds for these bugs in Xcode?
Are there workarounds for the following bugs in Xcode 16.3? I'm looking for workarounds instead of trying newer versions of Xcode because, from what I read, the Xcode release notes do not mention these issues being fixed. First bug: Resizing a NSSplitView in the UI Editor is buggy. When you try to use the divider, it just does not work as expected. In the case of a vertical split, the bottom view gets shrunk whatever you try to do. Second bug: When you type: (IBAction) in the source editor, you get the following buggy template (extra ')' on the right): - (IBAction)<#selector#>:(id)sender)
3
0
93
3w
xcode 26.3 claude agent not login
I've connected my Claude account into Coding Intelligence and working properly (opening a web browsing and connecting my account), but when I press Claude Agent it sayes that I have to login againt. When I press the Account login with Claude.ai account, a web browser is opened, but it never finished the flow and I have an infinite spinner. Apple M2 Pro with macOS 26.2 (25C56)
0
3
91
3w