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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

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
810
Jul ’25
dyld: Symbol not found ... certain MeshResource APIs on iOS 17.x
I submitted feedback as FB16463501 -- posting here for others to see, or maybe for Apple to share any help if there are workarounds, etc.: Targets below iOS 18.x fail to launch app due to dyld[xxxxx]: Symbol not found: errors when referencing: MeshResource.init(from:) async - https://developer.apple.com/documentation/realitykit/meshresource/init(from:)-b7hb i.e. dyld[61511]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE4fromACSayAD0C10DescriptorVG_tYaKcfC MeshResource.replace(with:) async - https://developer.apple.com/documentation/realitykit/meshresource/replace(with:)-8uvri i.e. dyld[78830]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE7replace4withyAcDE8ContentsV_tYaKF Targets tested that exhibit issue: (DYLD errors) Device: iOS 17.7.2, iPhone 14 Pro Max Simulator: iOS 17.5 (21F79), iPhone 15 System Information: macOS Version 15.3 (Build 24D60) Xcode 16.2 (23507) (Build 16C5032a) MRE -- include this code in your app: (no need to invoke, just reference) static func addOrUpdateEntityModel_MRE(_ entity: ModelEntity) async { let descriptor = MeshDescriptor(name: "MyDescriptor") do { if let modelComponent = entity.model { // update existing ModelComponent if let model = try? MeshResource.Model(id: "MyModelId", descriptors: [descriptor]) { var contents = MeshResource.Contents() contents.models = .init([model]) try await modelComponent.mesh.replace(with: contents) /// `dyld[78830]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE7replace4withyAcDE8ContentsV_tYaKF` } } else { //create new ModelComponent /// Comment-out the 2 lines below == dyld error for above `MeshResource.replace(with:)` let meshRes = try await MeshResource(from: [descriptor]) /// `dyld[61511]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE4fromACSayAD0C10DescriptorVG_tYaKcfC` entity.model = .init(mesh: meshRes, materials: [SimpleMaterial()]) } } catch { fatalError() } }
0
0
503
Feb ’25
Assistance Required for Accessing Non-Secure HTTP API in Ionic Build App
Dear Team, I was previously able to access a non-secure HTTP API in my Ionic-built app. However, I am now encountering an error where the API requests are being rejected. Interestingly, this API works perfectly on Android and web platforms without any issues. As part of my troubleshooting, I have already added the following lines to my Info.plist file: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> Could you kindly suggest any alternative solutions or additional settings required to access this HTTP API? Your help would be greatly appreciated. Thank you, Mozib
0
0
165
Jan ’25
Swift, kevent, and wth?!?!?
I have this code: var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16((EV_ADD | EV_ENABLE)), fflags: 0, data: 0, udata: nil ) I looked at it and thought why do I have those extra parentheses? So I changed it to var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16(EV_ADD | EV_ENABLE), // changed line! fflags: 0, data: 0, udata: nil ) and then kevent gave me EBADF. Does this make sense to anyone?
0
0
230
Feb ’25
iOS xcode app, During "Distribute app" get error The archive contains nothing that can be signed
I had successfully distributed my app months ago and trying same today and get "The archive contains nothing that can be signed. Verify that your build process has compiled binaries and copied in bundled resources." message when I click the "Distribute app" button. My project is a simple iOS xcode project that I had success in same operation back on Feb 8, 2024, same project code and settings. Verbose log: 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodWatchOSAdHoc: 0x600004700d70> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodWatchOSEnterprise: 0x600004700c30> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodTVOSEnterprise: 0x600004700c90> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Accepted distribution method <IDEDistributionMethodiOSEnterprise: 0x600004700c70> 2025-01-22 00:49:43 +0000 [MT] Accepted distribution method <IDEDistributionMethodDevelopmentSigned: 0x600004700c80> 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodTVOSDevelopmentSigned: 0x600004700d30> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodWatchOSDevelopmentSigned: 0x600004700d90> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodDeveloperIDNotarizedApp: 0x600004700d40> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodDeveloperID: 0x600004700cf0> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodSaveBuiltProducts: 0x600004700ca0> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodDevelopmentSignedMac: 0x600004700d60> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodExportArchive: 0x600004700c60> because it doesn't support distributing archive 2025-01-22 00:49:43 +0000 [MT] Rejected distribution method <IDEDistributionMethodMacApplication: 0x600004700d80> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodTVOSAppStoreDistribution: 0x600004700cd0> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Accepted distribution method <IDEDistributionMethodiOSAppStoreDistribution: 0x600004700d10> 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodiOSAppStoreValidation: 0x600004700d20> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodTVOSAppStoreValidation: 0x600004700cc0> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodMacAppStoreDistribution: 0x600004700c40> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodMacAppStoreValidation: 0x600004700c50> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodInAppPurchaseContentPackage: 0x600004700d50> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodMacAdHoc: 0x600004700d00> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Accepted distribution method <IDEDistributionMethodiOSAdHoc: 0x600004700cb0> 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodTVOSAdHoc: 0x600004700ce0> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodWatchOSAdHoc: 0x600004700d70> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodWatchOSEnterprise: 0x600004700c30> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodTVOSEnterprise: 0x600004700c90> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Accepted distribution method <IDEDistributionMethodiOSEnterprise: 0x600004700c70> 2025-01-22 00:49:45 +0000 Accepted distribution method <IDEDistributionMethodDevelopmentSigned: 0x600004700c80> 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodTVOSDevelopmentSigned: 0x600004700d30> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodWatchOSDevelopmentSigned: 0x600004700d90> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodDeveloperIDNotarizedApp: 0x600004700d40> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodDeveloperID: 0x600004700cf0> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodSaveBuiltProducts: 0x600004700ca0> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodDevelopmentSignedMac: 0x600004700d60> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodExportArchive: 0x600004700c60> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Rejected distribution method <IDEDistributionMethodMacApplication: 0x600004700d80> because it doesn't support distributing archive 2025-01-22 00:49:45 +0000 Available distribution methods: {( <IDEDistributionMethodiOSAppStoreDistribution: 0x600004700d10>, <IDEDistributionMethodiOSAdHoc: 0x600004700cb0>, <IDEDistributionMethodiOSEnterprise: 0x600004700c70>, <IDEDistributionMethodDevelopmentSigned: 0x600004700c80> )} 2025-01-22 00:49:45 +0000 Step failed: <IDEDistributionAnalyzeArchiveStep: 0x6000084ddd40>: Error Domain=IDEDistributionErrorDomain Code=5 "The archive contains nothing that can be signed." UserInfo={NSLocalizedDescription=The archive contains nothing that can be signed., NSLocalizedRecoverySuggestion=Verify that your build process has compiled binaries and copied in bundled resources.}
0
0
285
Jan ’25
Why can't Xcode find symbols in scope, but still compiles?
My swiftUI project has started to constantly display "Cannot find 'symbol' in scope" errors in code i haven't touched, and the project still compiles fine. Neither cleaning build folder or compiling fix the errors, but if I right click the symbol, select "jump to definition" it will find it without problem and then when I return to the original file the error will be cleared. What can I do to stop these from happening?
0
1
179
Feb ’25
Shared dependencies between test and production code creates library duplication
When test support code relies on production code, a diamond can occur. If this occurs across packages, it can lead to duplicated symbols and incorrect behavior at runtime despite no warnings at build time. This only occurs in Xcode and top-level application testing. This doesn't occur when the code being tested is in a separate package. I'm trying to understand how to correctly manage shared test support code which needs to access production code, or if this is the correct way and it is an Xcode bug. For a minimized example project, see https://github.com/rnapier/SupportCode. The setup includes three packages: Dependencies, which manages all the dependencies for the app and tests; Core which contains core logic and test support; and Feature, which relies on Core an contains feature-related logic and test support. Building this system causes Core.framework to show up three times in DerivedData: ./App.app/PlugIns/AppTests.xctest/Frameworks/Core_59974D35D_PackageProduct.framework ./App.app/Frameworks/Core_59974D35D_PackageProduct.framework ./PackageFrameworks/Core_59974D35D_PackageProduct.framework When unit tests are run, there is a collision on the symbol for Keychain: objc[48914]: Class _TtC8Keychain8Keychain is implemented in both /Users/ornapier/Library/Developer/Xcode/DerivedData/App-grdjljgevqofhqgflgtrqvhvbtej/Build/Products/Debug-iphonesimulator/PackageFrameworks/Core_59974D35D_PackageProduct.framework/Core_59974D35D_PackageProduct (0x100a98118) and /Users/ornapier/Library/Developer/CoreSimulator/Devices/216C441E-4AE5-45EC-8E52-FA42D8562365/data/Containers/Bundle/Application/7197F2F2-EB26-42FF-B7DB-67116159897D/App.app/PlugIns/AppTests.xctest/AppTests (0x1011002c0). One of the two will be used. Which one is undefined. This is not a benign warning. There are two distinct copies of _TtC8Keychain8Keychain and test cases will access one and the app will access a different one. This leads to mismatches when accessing static instances such as .shared. I believe this dependency graph should work, and it does work as long as the top-level testing system is a Swift module. But if it is the application, it builds successfully, but behaves incorrectly in subtle ways.
0
5
515
Feb ’25
Deep link to a file in Xcode
Hi, is there documentation on how to write a deep link that will open Xcode on a given file, and optionally a line number? I know about xed, and I would like exactly that functionality, but in link form, so that I can link to a certain file from an app such as Obsidian or from a README.md file. I checked Xcode's Info.plist and it understands several URL schemes, the most promising of which is xcode://, which successfully launches the app, but no matter what I tried, I get an error dialog telling me that Xcode did not understand the URL. Any help on this topic would be greatly appreciated. Victor
0
0
293
Mar ’25
XCode 16.2 - error: unable to open dependencies file
Hello, I am encountering "unable to open dependencies file" error in XCode that started after updating to Xcode version 16.2 and macOS version 15.2. The error message I receive is as follows: error: unable to open dependencies file (/Users/user/Library/Developer/Xcode/DerivedData/MyProject-cwpcmnebzjpgkzcuoauxlaeiqrsg/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/arm64/MyProject-master.d) (in target 'MyProject' from project 'MyProject') This problem didn’t occur with XCode 16.1; the project was building successfully before the update. Now, even reverting to XCode 16.1 doesn’t resolve the issue anymore. Here’s what I’ve tried so far without success: Switched the compilation mode to “Whole Module” Cleaned the build folder Cleared Derived Data Thank you in advance for any suggestions!
0
4
912
Dec ’24
How to Handle Identically Named Files in Different Folders in Xcode 16
Hello everyone =) I'm working at the moment on a project in Xcode 16 where I need to have multiple files with the exact same name, stored in different folders (for example, separate quest data files). When I compile, Xcode seems to treat these identically named files as duplicates, causing build errors. How can I properly organize (or configure) Xcode so that it recognizes these files as distinct? Any advice or best practices would be greatly appreciated. Thank you! ;)
0
0
244
Dec ’24
Broken Xcode 16 autocomplete using Tab
I've recently upgraded to Xcode 16 and noticed a change in how the Tab key functions during autocomplete. (not-replied-but-closed post: https://discussions.apple.com/thread/255762888) Previously, pressing Tab would extend the typed text up to the first point of choice. For example, we have two classes: NSViewController and NSViewCoordinator BEFORE, typing: "NSV" + Tab used to complete to NSViewCo Now, in Xcode 16, pressing Tab selects the first suggestion by default, instead of completing up to the choice point. That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually. Seems there is no way to restore the previous behavior and that looks very very sad. I have reverse engineered Xcode 16...and what I get? They just install new CodeCompletion handler instead of old one without any chance to configure this behaviour by settings or UserDefaults =\ Hope this thread would raise votes and attract Xcode devs here
0
1
309
Feb ’25
Test Plans: application data for macOS apps
In the test plan settings, it's possible to select an .xcappdata bundle for a set of tests: I failed to find any documentation about it in the context of macOS apps testing. What I'm trying to achieve is having a sandboxed app container (/Users/{user}/Library/Containers/{bundle-id)/Data/) replaced before running a test suite. Is it something possible to achieve using the latest Xcode? What should be the .xcappdata structure to make it work on macOS?
0
1
282
Feb ’25
Xcconfig variables doesn't get loaded automatically in project settings
Hi, I am using xcode build that receive it's configuration using xcconfig files, those add some new definitions to the project, like the location of openssl library. If xcode environment variable include prefix that matches one of the fields in the project settings, it is automatically referred to as if you added it to that field. for example : the var HEADER_SEARCH_PATHS_openssl_libopenssl has value (openssl headers' path) that should be automatically added to the field Headers Search Paths under project settings. For some reason it stopped working for me and i'm not sure why (i've tried to release the xcconfig files). any idea why ? Thanks !
0
1
342
Jan ’25
Build Libraries For Distribution flag usage
I want to build an ios .xcframework (for external delivery) and .framework(for internal debugging) in order to package some code to a customer for incorporation into their app. My framework has a dependency upon RealmSwift, which I've added using SPM. There is a warning saying Module RealmSwift was not compiled with library evolution support. And when building SwiftVerifyEmittedModuleInterface fails with an error saying "missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'" By default, Build Libraries For Distribution was set to YES, however if I turn it off then the warning and error go away and I can cleanly build the framework. I've been attempting to get a good understanding of this flag and if it should be used or not, most material says yes but doesn't go a good job of explaining why. However anyway I can't get the framework to build with RealmSwift as a dependency without turning off this flag. Therefore is that ok to proceed down that route? Does the fact the xcframework will only ever be distributed to one consumer affect decisions (i.e. binary compatibility etc.) Thanks
0
0
115
Mar ’25
Preview broken
Hello, I am doing the SwiftUI tutorial with Xcode 16.2 For the watch app the simulator working fine but the preview keep saying “This app cannot run on the selected target device.” while the preview is working …… For the macOS part the simulator working fine but the preview is totally broken with -> ”ContentView.swift” not found in any targets. While it is correctly added to the target … Please fix or make tutorial clear.
0
0
150
Feb ’25