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
719
Jul ’25
SwiftUI Canvas
Hi everyone, I think this is a simple issue. I got the following error message" "PreviewDevice is ignored in a #Preview macro. Use the device picker at the bottom of the Canvas to change which device type is used for the preview. (from macro 'Preview')" after this line: ".previewDevice(PreviewDevice(rawValue: "iPhone 17 Pro"))" But in my Canvas I do not see the device picker. Thank you.
0
0
17
2h
Attributes inspector in Xcode 26
It has been two years since I wrote my a SwiftUI app, and I wanted to start again in Xcode 26. I can no longer see the attributes inspector when I select an element in the canvas. This was an Xcode feature that was very helpful as I am still a novice. Has this feature been deprecated in Xcode 26? And if not, please help explain how I can find and use it.
1
0
86
11h
Assets duplicating on Xcode 26.1 Beta 3
I've recently installed 26.1 Beta 3 alongside stable 26.0.1 When building my app with 26.0.1 the final .ipa size is ~17mb, however after building my app with 26.1 Beta 3 the size has increased up to ~22mb The main difference is Assets.car blowing from 1.1mb to 5.6mb (or 8.6mb if I include all icons settings). Upon examining I've found new liquid glass .icon file duplicating itself multiple times as png variants (any, dark, tinted, etc). Is anyone else experiencing this issue?
8
1
388
14h
Unity build error in Xcode - Undefined Symbols - Swift
This is using: **Unity 6000.2.7f - latest ARKit etc Xcode 26.1 ** This is going to iPad/iPhone/iOS and I have succesfully built to the iPad before, but updates to the software seem to have added these errors in. Basically all updated as much as possible. Originally I got 5 errors, but updates brought it down. On build I now get 3 undefined symbols: Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility51 Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility56 Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityConcurrency This appears to be a bug, or issue, that is in some way known, but I'm not sure how best to get past it. ld: warning: search path '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.1.324.0.kGuqPt/Metal.xctoolchain/usr/lib/swift/iphoneos' not found ld: warning: search path '/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.1.324.0.kGuqPt/Metal.xctoolchain/usr/lib/swift-5.0/iphoneos' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibility51': library 'swiftCompatibility51' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibility56': library 'swiftCompatibility56' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityConcurrency': library 'swiftCompatibilityConcurrency' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityPacks': library 'swiftCompatibilityPacks' not found ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found ld: warning: Could not find or use auto-linked framework 'UIUtilities': framework 'UIUtilities' not found ld: warning: Could not parse or use implicit file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it Undefined symbols for architecture arm64: "_swift_FORCE_LOAD$_swiftCompatibility51", referenced from: _swift_FORCE_LOAD$swiftCompatibility51$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o) "_swift_FORCE_LOAD$_swiftCompatibility56", referenced from: _swift_FORCE_LOAD$swiftCompatibility56$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o) "_swift_FORCE_LOAD$_swiftCompatibilityConcurrency", referenced from: _swift_FORCE_LOAD$swiftCompatibilityConcurrency$_UnityARKit in libUnityARKit.a[49](RoomCaptureSessionWrapper. o) ld: symbol(s) not found for architecture arm64 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
0
0
120
1d
CoreNFC / NFCTagReaderSession Availability on iPad
Hello, I am currently working on a project that requires the use of the NFCTagReaderSession API to perform read and write operations on NFC tags (ISO15693 and other standard NFC tag types). According to the Apple documentation, CoreNFC and NFCTagReaderSession are fully supported on iPhone devices. However, the behavior and availability on iPad devices are not clearly documented. I would like to request clarification on the following points: Is NFCTagReaderSession officially supported on iPad devices? We have verified that some iPad models equipped with NFC hardware still do not expose support for this API. Is there an up-to-date list of iPad models that support CoreNFC? The documentation currently mentions only “iPhone 7 or later,” with no reference to iPad models. Does Apple plan to enable NFCTagReaderSession on iPad in the future? This information is important for our product roadmap, as several of our deployments rely on tablets. Our goal is to determine whether NFC tag read/write operations are intended to be available exclusively on iPhone, or whether there are existing or upcoming iPad models that will support CoreNFC as well. Thank you in advance for your support and for any clarification you can provide. Kind regards,
0
0
43
1d
Mergeable Library Bundle Hooking Does Not Work When Frameworks Is Merged Into Container Framework
Problem When we merge FeatureModuleA.framework into IntegrationContainer.framework instead of HostApp_Main.app, the magic method Bundle(for: FeatureAProvider.self) does not work and this will trigger crash. When FeatureModuleA is merged into HostApp, Bundle(for: FeatureAProvider.self) will return: HostApp_Main.App/Frameworks/DomainFeatureA.framework instead of HostApp_Main.App/, although the FeatureAProvider class is actually in the merged main app binary So we can use the returned FeatureModuleA bundle get the nested resource. If we merge the frameworks into our IntegrationContainer.framework, the result will be: for release: PrototypeApp.app for debug: PrototypeApp.app/Frameworks/IntegrationContainer.framework/ReexportedBinaries/DomainFeatureA.framework Apple has not considered the case that frameworks are merged into independent framework. And other methods like bundle(for: identifier) does not work for both destination cases: merge into main app or a container framework.
0
0
18
1d
Icon Composer: Any way to add icons to the app bundle for older macOS versions?
Several app developers are struggling with the inability to provide a separate app icons that looks nice on older macOS versions while at the same time provide Icon Composer icons that look great on macOS Tahoe 26. An ability to provide separate icons is super important to those who have app icons that follow the curvature of the default icon borders (as the corner rounding radius is different for Sequia and Tahoe). Take a look at this for example: https://github.com/ghostty-org/ghostty/issues/7564#issuecomment-3042061547 Question: Is there a definitive/recommended way to address this issue? How can a developer add a glass icon variant that looks good on Tahoe and provide a bitmap icon for older macOS versions? Some background info: Prior to Xcode 26 beta 4, one could add an App Icon to Assets to be used as app icon for legacy macOS versions (Sequia and older) and use a new Icon Composer icon (placed in the project root) for macOS Tahoe 26. Enabling "Include all app icon assets" under target settings ensured that older macOS versions would use the old app icons while Tahoe the new Icon Composer glass one. Since Xcode beta 4 this technique no longer works. Xcode instead insists on populating Assets.car with Icon Composer generated variants, disregarding the App Icon provided in Assets. Although the App Icon in Assets makes its way to a .incs file in the app bundle's Contents/Resources folder, but that is not used by macOS anymore and is there for some compatibility purposes. The Assets.car file (which matters) only contains the variants generated by Icon Composer and does not contain the png icons provided in the Assets.
14
12
1.2k
2d
Shared Library constructor in XCode 16.4 and 26 linker/runtime
GCC's shared library constructor technique has ceased working with the tool chain provided with XCode 16.4 and XCode 26. This is the GCC attribute: __attribute__((constructor)) Example use: void aConstructor(void) __attribute__((constructor)); void aConstructor(void) { printf("Called aConstructor\n"); } In our case aConstructor() was not called.
0
0
143
2d
Unable to Generate .ipa for .NET MAUI iOS App – Codesign Fails With “unable to build chain to self-signed root”
Hi everyone, I am trying to generate an .ipa file for my .NET MAUI (net9.0-ios) application, but every attempt fails with the same codesigning error. I have tried multiple approaches, including building from Windows paired to macOS, and directly building through the macOS terminal, but nothing is working. Below are the exact steps I followed: Steps I Performed Generated the Apple Development certificate using Keychain Access on macOS. Added that certificate into my developer account and created the corresponding provisioning profile. Created an App ID, attached the App ID to the provisioning profile, and downloaded it. Added the provisioning profile into Xcode. Verified that the certificate is correctly visible in Keychain Access (private key available). Attempted to build/publish the MAUI app to generate the .ipa file. Issue Whenever I run the publish command or build via Windows/macOS, codesigning fails with the following error: /usr/bin/codesign exited with code 1: Frameworks/libSkiaSharp.framework: replacing existing signature Warning: unable to build chain to self-signed root for signer "Apple Development: Created via API (8388XAA3RT)" Frameworks/libSkiaSharp.framework: errSecInternalComponent Failed to codesign 'PCS_EmpApp.app/Frameworks/libSkiaSharp.framework': Warning: unable to build chain to self-signed root for signer "Apple Development: Created via API (8388XAA3RT)" PCS_EmpApp.app: errSecInternalComponent Build eventually fails with: Build failed with 4 error(s) and 509 warning(s) Environment .NET: 9.0 MAUI: latest tools Xcode: 26.0.1 macOS: 26.0.1 Building for ios-arm64 (device) What I suspect It looks like the signer certificate might not be trusted, or the certificate chain cannot connect to an Apple root CA. But the certificate was created using the Developer website and appears valid. Need Help With Why is codesign unable to build the certificate chain? Do I need a different type of certificate? (App Store / Distribution vs Development?) Is there any special configuration required for MAUI apps using native frameworks like libSkiaSharp.framework? How can I successfully generate the .ipa file? Any guidance will be greatly appreciated. Thank you!
0
0
87
2d
How to stop Xcode for sending me reminders about Coding Intelligence?
Once in a while I get from Xcode a reminder to test Coding Intelligence. I am today not interested in Coding Intelligence and it's unlikely that I will be in the future. Therefore, I would like to get rid of these for me useless reminders to activate Coding Intelligence. I have not found anywhere anything for doing so. Or do I get rid of the reminders when activating it and deactivating it immediately again (if this is possible)?
0
0
96
3d
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
1
3
139
3d
Unable to Download iOS Simulator Runtime 26.1 on Xcode — Bad URL Error (Code 49)
Hi everyone, I’m experiencing a persistent issue when trying to download the iOS Simulator Runtime 26.1 on Xcode (version 26.1). The download always fails with the following error Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 I’m located in Brazil, so I initially thought it might be region-related, but I’ve already tried several attempts to fix it, including: Using VPNs for the US and Europe Installing the Xcode 26.2 beta Downgrading Xcode to earlier versions Reinstalling the same version of Xcode Restarting Xcode and my Mac Switching networks Clearing simulator support/device files Unfortunately, nothing has resolved the issue. Is anyone else facing this problem? Does anyone know a workaround or a manual way to download/install the iOS 26.1 simulator runtime? Thanks in advance!
2
0
173
3d
Side-by-side comparison in source code changes view
I am trying to move over from AppCode/Intellij to Xcode. I am however having a hard time with the version control tools. I know that you can choose side-by-side when you activate "code review" and select single files. However, if you go into changes and view the list of files that have changed, i can only get inline-view to work. This is really frustrating to me, is there any way to get side-by-side also when you select a file from the changes list? Cheers
1
0
103
3d
How to find the call site for incomplete completions in a stopped app?
I am fixing bugs / extending a macOS app written by somebody else in Swift. I’ve made changes to it and debugging it, so breakpoints/rebuilding/debug print/change/rerun it isn’t a problem. But it is a multi-threaded, async app, and when I pause the running app, it will not display source code location in each thread where it is. I only get assembly. [and, yes, "Always Show Assembly" in OFF] It is inherent to async apps and threading that they spend most of their time waiting for the user to do something. Hence if you stop an app, you’ll almost always be in system code somewhere. But I think wanting to see the origin of completions that are pending is a legitimate question for somebody debugging (and trying to understand how the app works). Am I not aware some feature in Xcode / LLDB to reveal this?
0
0
78
4d
Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
I’m building a React Native 0.72.10 iOS app and hitting build errors. Environment: macOS: Apple M4, Sequoia 15.7.2 Xcode: 26.1.1 React Native: 0.72.10 Errors: Could not delete /Users/.../ios/build because it was not created by the build system Unable to write file '/Users/.../ios/build/Pods.build/Debug-iphonesimulator/...': Operation not permitted (Multiple Pods / React Native framework headers affected) What I’ve tried: bash rm -rf ios/build rm -rf ~/Library/Developer/Xcode/DerivedData xattr -w com.apple.xcode.CreatedByBuildSystem true ios/build pod deintegrate && pod install sudo chown -R $(whoami) ios/build Observations: ios/build is recreated automatically. Some files have com.apple.xcode.CreatedByBuildSystem: true. 3.Xcode have Full disk access authorisation. Why does Xcode fail to delete / write to ios/build even though it’s recreated automatically by the build system? Is this caused by Xcode itself, macOS permissions? Any recommended fix or workaround for these “Operation not permitted” errors?
1
0
54
4d
Setting Installation Directory correctly is a mystery
Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library ending up in file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects. If I put under Deployment Deployment Location: YES Installation Build Products Location: / Installation Directory: /usr/local/lib Skip Install: NO I get errors like warning: Stale file '/usr/local/usr/local/include/xxx.h' is located outside of the allowed root paths. and things like error: Cycle inside a single target; building could produce unreliable results. Installation Build Products Location: /usr/local/lib Installation Directory: / I get warning: Stale file '/usr/local/include/xxx.h' is located outside of the allowed root paths. but the library file is not put into /usr/local/lib (note /usr/local/lib and /usr/local/include are owned by my user and writeable) I could write an old style Makefile and have xcode call the makefile but there must be an easier way to do this. This is for a cross platform development so having it packaged into a Framework would not solve it neither.
1
0
32
4d