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
518
Jul ’25
"Bad URL" when signing in to XCode
The other day the XCode account had some error that I so that I decided to log out and in again. But when trying to log in to my apple account I get this "Bad URL" with the description "Try signing in again or contact Apple Developer Support to resolve account access". This only happens on the XCode on my work computer. I can log in to XCode on other computers with the same account. This happens only on this computer and with any account that I try to log in to. Obviously there is some cache file somewhere that I need to delete. But I am not finding it.
0
0
23
10h
Integrated AI just destroys code?!
So I asked the integrated AI a question and the answer was just some hallucination. Now that's nothing new. But the AI then proceeded to apply those hallucinated changes to my code base. Luckily I had no uncommited changes and could use git to revert those multi file changes. But it could have easily been different. So what did I do wrong? Did I click something? Pressed the wrong key? Don't want to happen this again and possibly destroy work.
2
0
50
11h
Xcode26 doesn't install
I have Xcode 16.4 and want to upgrade to Xcode26 on a MacBookPro with Intel and macOS 26.0. However I keep getting the error message (in German), that the download of the App is not possible, Xcode could not be installed and I should try later. I tried to restart the Mac, close all Apps etc. I tried it meanwhile several times, but still no success. Any Idea what I could try or do to solve the problem? Thx in advance
1
0
64
13h
iOS 26 tabViewBottomAccessory doesn't work with tabViewSidebarBottomBar
The code is shown as follows. Once the tabViewBottomAccessory is enabled, the tabViewSidebarBottomBar disappears. TabView { Text("tab a") .tabItem { Image(systemName: "a.square") Text("Tab A") } .ignoresSafeArea(edges: [.all]) Text("tab b") .tabItem { Image(systemName: "b.square") Text("Tab B") } .ignoresSafeArea(edges: [.all]) } //.tabViewBottomAccessory { // Text("tabViewBottomAccessory") //} .tabBarMinimizeBehavior(.onScrollDown) .tabViewStyle(.sidebarAdaptable) .tabViewSidebarBottomBar { Text("tabViewSidebarBottomBar") }
0
0
35
20h
Critical notifications crashing in Xcode 26 simulator
I am scheduling critical user notifications with a custom sound. This worked for years both on devices and in the simulator. Since Xcode 26 it crashes in simulator. Example let content = UNMutableNotificationContent() content.title = "Critical" content.body = "Example" content.sound = UNNotificationSound.criticalSoundNamed(UNNotificationSoundName("notification.aiff"), withAudioVolume: 0.5) content.interruptionLevel = .critical let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false) let request = UNNotificationRequest(identifier: "exampleCriticalNotification", content: content, trigger: trigger) UNUserNotificationCenter.current().add(request) It seems that simpler variants such as just content.interuptionLevel = .critical or just content.sound = UNNotificationSound.defaultCritical also crash. I assume that critical notifications is a small niche use case but i still hope this gets fixed. This is filed as FB20272392 with a full crash log.
0
0
36
1d
Issues updating to Xcode 26 -- can no longer successfully build project
I recently updated to macOS sequoia 15.6 Afterward, I updated to Xcode 26 The project I've been running for the last couple years no longer compiles on existing simulators and doesn't build to a physical device. I'm getting an error I'm not familiar with and have no idea how to directly resolve it: The specific error is 'Command SwiftGeneratePch failed with a nonzero exit code' Looking up this issue via Google, there wasn't really a lot of information on this particular build failure. Most suggestions were to change the location of the Derived Data folder (Xcode -> File -> Project Settings -> update location of derived data from default to relative) This was one of the only actionable solutions I found online but this doesn't fully address the issue for me, it just creates a new issue: "Command PhaseScriptExecution failed with a nonzero exit code" I feel like with enough digging around I should be able to find a solution to the "PhaseScriptExecution" issue; there seems to be a decent amount of information online about that particular problem. I would prefer if I could solve the original 'SwiftGeneratePch" failure without needing to address other issues, though. Is this possible?
0
0
44
1d
Xcode 26 on Tahoe crashing
I've instilled Tahoe and Xcode 26(17A324) and the combination is virtually unusable, particularly the latter I'm no longer able to build projects reliably. My workflow is completely disrupted by a spinning beach ball so just a warning that you might want to delay until taking the plunge as I should have done. Fortunately, I have a back sequoia machine I can use instead.
1
1
58
1d
iOS26 Restoration Identifier NULL
Hi everyone - I'm seeing an issue specifically on iOS26 where we instantiate a few storyboard items programmatically and pull their restoration identifier. On iOS26, these identifiers are null and cause a crash, but the assignments are on the storyboard and there has been no change to that logic. On iOS 18, for example, there is no crash and the identifiers are pulled properly. Anybody else seeing this?
1
0
38
1d
Unable to install “My App” after installing iOS 26, macOS 26, Xcode 26.
Error: Unable to install “My App” Failed to install embedded profile for com.apple.myapp : 0xe800801a (This provisioning profile does not have a valid signature (or it has a valid, but untrusted signature).) I've tried almost everything, but I keep getting the same message on a Mac Mini M1 and several physical iPhones (11 and 16, both Pro). On a MacBook Air (Sequoia 15.7) with the same account, the same profiles work without any problems; and on simulators with iOS 26, it also works without any problems. This clearly tells us that the provisioning profile is not the problem, which is what the message mentions. It obviously has to do with the 26 update. P.S All of this worked fine before installing iOS, macOS, and Xcode 26.
2
2
160
1d
Provisioning problem
Totally noob programmer here, forgive me if this is a basic user error. But there seems to be a mismatch between my apple id identifier and my team identifier. It has been automatically configured, and worked until today, but while trying to run a new app on my iphone i all of a sudden got "Failed to install embedded profile for com.kylland.formattingtest : 0xe800801a (This provisioning profile does not have a valid signature (or it has a valid, but untrusted signature).)". Now it does not work on any apps. Went through what chatgpt had to give me, trying to log in and out, made sure automatic signing is enabled and tried to delete the key from keychain. Still comes up with two different keys.
49
39
6k
1d
Full Xcode on iPad Pro with M-series processors
The iPad Pro on iPadOS 26 now operates on the same class of silicon as Apple’s entry-level Macs. It ships with M-series processors, 8GB of unified memory, support for multiple resizable windows, a menu bar, and proper external display connections. The device already has the foundation required for professional software development. The only gap is the absence of Xcode. Making the full version of Xcode available on iPad Pro would not take away from the Mac. Large and resource-intensive projects will still require the power of MacBook Pro and Mac Studio. What it would do is allow smaller and mid-sized projects to be developed directly on iPad Pro, which the hardware is fully capable of handling. That dynamic is complementary, not cannibalizing. Developers would continue to buy Macs but would also buy iPad Pros for portability and flexibility. The revenue upside is clear. Lowering the entry barrier means more developers enrolling in the Apple Developer Program at $99 per year, creating predictable recurring subscription income. A wider developer base leads to more apps reaching the App Store. Even if many are small, Apple benefits from every transaction through its revenue share. This strengthens the services business, which already delivers the company’s highest margins. There is also a direct hardware impact. Once Xcode is available, iPad Pro will be recognized as a legitimate professional development device. That drives more unit sales of a high-margin product line and increases attachment rates for accessories like the Magic Keyboard, Apple Pencil, and external monitors. Instead of eroding Mac sales, the effect is expansion. Developers will own both devices. The case is straightforward. The hardware is ready. The operating system is ready. Enabling full Xcode on iPad Pro would expand the developer funnel, grow recurring subscription revenue, increase App Store volume, and boost high-margin hardware and accessory sales. It is a decision that benefits developers, strengthens the ecosystem, and maximizes profit.
2
0
98
2d
editing Makefile in Xcode editor
I want to edit a Makefile using the Xcode editor (part of my project). I can create and edit the file, but Xcode seems to assume it’s a Swift file — it applies Swift syntax highlighting, and I get incorrect suggestions while editing. I tried changing the “Open As” option from “Source Code,” but there’s no “Plain Text” option available. I’m using Xcode 16.4. I’ve seen suggestions like: • Using an external editor (which works, but feels clunky), • Renaming the file to something like Makefile.txt (but that breaks standard CLI use, e.g. make expects Makefile). Not too happy with either workaround — did I overlook a proper way to just edit a Makefile in Xcode without confusion? Any suggestions appreciated! Thanks, Lourens
3
0
81
2d
Xcode trying to load a static library at run-time.
dyld[3198]: Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype Referenced from: <6BFD5FE8-3CE3-3AA9-8264-432DA092F1B1> /Users/danielmarcus/Desktop/SFML-2.6.2/lib/libsfml-graphics.2.6.2.dylib Reason: tried: '/Users/danielmarcus/Library/Developer/Xcode/DerivedData/github_demo-eotoolowecsaypbbvkfzcwzkyosw/Build/Products/Debug/freetype.framework/Versions/A/freetype' (no such file), '/Library/Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/System/Library/Frameworks/freetype.framework/Versions/A/freetype' (no such file, not in dyld cache) Messa
4
0
74
2d
StoreKit2: appAccountToken in purchase() always returns first value instead of updated UUID
Hello, I’m experiencing an issue with StoreKit 2 when passing a new appAccountToken for each purchase request. Case-ID: 15948169 (for DTS reference) Description of the Problem When initiating a purchase, I generate a new UUID to use as the appAccountToken: let serverTransactionId = UUID() let options: Set<Product.PurchaseOption> = [ .appAccountToken(serverTransactionId) ] let result = try await product.purchase(options: options) Expected Behavior: Each new purchase should return the updated appAccountToken that I pass into the purchase options. Actual Behavior: The payload response after success always contains the same appAccountToken from the very first transaction. It ignores subsequent UUIDs I pass and keeps reusing the original one. This causes issues because the same identifier is being reused across multiple transactions, making it difficult to map purchases to the correct user session. Steps to Reproduce Generate a fresh UUID using UUID(). Pass it as .appAccountToken when calling purchase(). Complete the transaction in the sandbox environment. Inspect the payload response → The appAccountToken value is always the same as the first one used, not the newly provided one. Additional Info I do have a focused test project that reproduces this issue. The issue appears specific to appAccountToken persistence across multiple transactions. Has anyone else experienced this behavior with StoreKit 2? Is this expected (Apple caching the first token) or could this be a bug?
2
0
65
2d
Xcode 26 RC doesn't properly use build configurations
We have several build configurations in our project, yet Xcode seems to ignore them when changing the run configuration in the scheme. There are several OTHER_SWIFT_FLAGS set like this but all code paths using conditionals like #if APPSTORE_BUILD etc. that worked previously with Xcode 16 just all default to the Debug (RETAIL_BUILD) configuration now.
1
0
102
2d
Tapping tab item in Xcode UI test doesn't always work
While preparing automated screenshots with Xcode UI tests for the iOS 26 release, I noticed that this simple line of code app.buttons["myTabItem"].tap() doesn't always work, both on iPhone and iPad Simulator. In fact, it rarely works. Even when repeating the same test, mostly it fails on that line, but a few times it works and I can see the tab item change in the simulator. My main view looks like this: TabView { MyTab1() .tag(tag1) .tabItem { Label("label1", systemImage: "image1") } MyTab2() .tag(tag2) .tabItem { Label("label2", systemImage: "image2") .accessibilityIdentifier("myTabItem") } The error I get is Failed to tap "myTabItem" Button: No matches found for Elements matching predicate '"myTabItem" IN identifiers' from input In the given list of buttons, I see the tab items with their labels, but none of them seem to have an identifier, while other buttons have the correct identifier. I wonder how this can only sometimes work. I tried isolating the issue by iteratively commenting out parts of the SwiftUI code, but unfortunately the behaviour seems erratic. When a change results in the issue not happening anymore, undoing the last X changes often causes the issue to stay away, even with configurations that previously had the issue. I've already spent almost a whole day trying to find the root cause, but with such apparently random behaviour it has proven impossible. Of course, I cannot reproduce the issue with a fresh test project, so the only way to reproduce it with 95% probability is running my original project. Has anyone had the same issue, or does anyone know how I could debug this to find out what causes my UI test to not be able to tap another tab item?
0
0
50
2d