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
839
Jul ’25
iOS Simulator fails to boot (18.6 / 26.1 / 26.2) – launchd_sim could not bind to session
Hi, I’m facing a consistent simulator boot issue that appears to start after iOS 18.2 simulator runtimes and persists in 18.6, 26.1, and 26.2. Observed behavior iOS 18.2 simulator works fine iOS 18.6 simulator does NOT boot iOS 26.1 / 26.2 simulators do NOT boot Tried everything reinstall/clear cache and all and event formatted the system Unable to boot the Simulator NSPOSIXErrorDomain Code: 4 Failure Reason: Interrupted system call Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding macOS: Sequoia Xcode: 26.1, 26.2 Machine: Apple Silicon Unable to boot the Simulator. Domain: NSPOSIXErrorDomain Code: 4 Failure Reason: Interrupted system call User Info: { DVTErrorCreationDateKey = "2025-12-26 02:19:27 +0000"; IDERunOperationFailingWorker = "_IDEInstalliP.honeSimulatorWorker", Session = "com apple CoreSimulator.SimDevice CCDECA56-4A59-491B-A830-0F3928FCD957"; } Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding Domain: com.apple.SimLaunchHostService.RequestError Code: 4 Event Metadata: com.apple. dt. DERunOperationWorkerFinished : { "device_identifier" = "CCDECAE6-4A59-491B-A830-0E3928FCD957"; "device_model" = "iPhone18, 1"; "device_osBuild" = "26.1 (23B86)"; "device_osBuild_monotonic" = 2301008600; "device_os_variant" = 1; "device_platform" = "com apple.platform.iohonesimulator"; "device_platform_family" = 2; "device_reality" = 2; "device_thinningType" = "iPhone18,1"; "device_transport" = 4; "launchSession_schemeCommand" = Run; "launchSession_schemeCommand_enum" = 1; "launchSession_targetArch" = arm64; "launchSession_targetArch_enum" = 6; "operation_duration_ms" = 1183; "operation_errorCode" = 4; "operation_errorDomain" = NSPOSIXErrorDomain; "operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker"; "operation_error_reportable" = 1; "operation_name" = IDERunOperationWorkerGroup; "param_consoleMode" = 1; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com apple platform Please help on this as it got stuck. Thanks
0
0
29
7h
Debugger breakpoints not hitting since updating to macOS 26.1
Hi, I have started facing an issue with Xcode since updating to macOS 26.1. The debugger is not stopping at breakpoints in Objective-C code, however breakpoints in Swift file are working fine. I am using Xcode 16.4. For breakpoints in Objective-C files I have started to get this message since the OS update - 'Xcode won't pause at this breakpoint because it has not been resolved.' I have already tried cleaning derived data and build folder. I do not want to upgrade to Xcode 26. Could someone help with the fix? Thanks
0
0
57
13h
Xcode debugger stops at dyld after upgrading to Xcode 26
After upgrading to Xcode 26, started getting an issue where Xcode debugger is stopping at dyld`lldb_image_notifier Does not happen on device. Tried cleaning derived data folder, clean build but no success. what could be the cause? this is from the stack. #0 0x0000000207e0ffa1 in lldb_image_notifier () #1 0x0000000207e11c49 in dyld4::ExternallyViewableState::triggerNotifications () #2 0x0000000207e13a2f in invocation function for block in dyld4::ExternallyViewableState::notifyMonitorOfImageListChangesSim(bool, unsigned int, mach_header const**, char const**) () #3 0x0000000207e10c3b in dyld4::ExternallyViewableState::notifyMonitorOfImageListChangesSim () #4 0x00000001102b9195 in dyld4::ExternallyViewableState::triggerNotifications () #5 0x00000001102b9465 in dyld4::ExternallyViewableState::addImages () #6 0x000000011029dcec in dyld4::RuntimeState::notifyDebuggerLoad () #7 0x00000001102b8065 in dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()() const::'lambda'()::operator()() const () #8 0x00000001102b71fd in dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()() const () #9 0x00000001102b30e3 in dyld4::APIs::dlopen_from () #10 0x00000001199b4c5e in _CFBundleDlfcnLoadFramework () #11 0x0000000119982a1e in _CFBundleLoadExecutableAndReturnError () #12 0x0000000115f081c4 in -[NSBundle loadAndReturnError:] () #13 0x00000001a3c42866 in -[NSBundleAccessibility loadAndReturnError:] () #14 0x000000013cd67fa7 in __50-[AXCodeItem loadWithStrategy:onQueue:completion:]_block_invoke_2 ()
2
0
194
15h
App Widget NSExtensionPrincipalClass found in extension Info.plist
My app is built in flutter and has a native Widget in it. The widget's Info.plist file has the NSExtensionPrincipalClass key that links to the VerseOfTheDayWidgetBundle as string. However the Transport app throws an error: Validation failed (409) Unexpected Info.plist key. Unexpected key NSExtensionPrincipalClass found in extension Info.plist for Payload/Runner.app/PlugIns/VerseOfTheDayWidgetExtension.appex. (ID: 266e2dd8-44b9-4d67-97d9-d7d47013cff9) Now I tried removing the NSExtensionPrincipalClass and but the simulator throws an error asking for the NSExtensionPrincipalClass or Storyboard class but my widget is completely written in SwiftUI and does not have a storyboard which is why I am using the NSExtensionPrincipalClass. I tried to bypass this by creating two info.plist files for my widget (debug and release) this bypassed the security check on Transporter but then the app wouldn't install in TestFlight confirming the same issue as the simulator. I can confirm that my app's info.plist does not have any mention of NSExtensionPrincipalClass. so that isn't what is causing this error. I tried a lot of things but it just wouldn't work, at this point I feel maybe its something wrong with the checks Transporter app. I'm not sure, please guide me. The widget and the app work completely fine on the simulator with the NSExtensionPrincipalClass, its just the Transporter that does not like it being there.
2
2
179
22h
Building with Xcode on macOS Tahoe does not launch in iOS 12
When trying to launch an app built with Xcode in iOS12, differences occur depending on the macOS version on which Xcode is installed. When building with Xcode 26.2 (or Xcode 16.4) installed on macOS Sequoia, installing it on iOS 12 and tapping the app icon launches the app. When building with Xcode 26.2 (or Xcode 16.4) installed on macOS Tahoe, installing it on iOS 12 and tapping the app icon does not launch the app. The following log was displayed upon launch: Dec 15 11:46:35 xxx assertiond[58] <Notice>: Submitting new job for "com.xxx.sample" on behalf of <BKProcess: 0x10151a710; SpringBoard; com.apple.springboard; pid: 48; agency: SystemShell; visibility: foreground; task: running> Dec 15 11:46:35 xxx assertiond[58] <Notice>: Submitted job with label: UIKitApplication:com.xxx.sample[0x2dfd][58] Dec 15 11:46:35 xxx assertiond[58] <Notice>: Unable to get pid for 'UIKitApplication:com.xxx.sample[0x2dfd][58]': No such process (3) The same issue occurs with both .app and .ipa. I would like to know the technical reason behind this, if anyone knows, please let me know.
0
0
49
1d
Xcode Intelligence AI feature seems to fail on slow networks
Intelligence AI powered feature fails on complex project with network error when “Reasoning” is set higher then “Low”. The visual feedback shows sending some context and answer being generated, but eventually stops with network error. Retries with “Reasoning” set higher than “Low”. won’t help, but retries or same queries with “Low” or "Minimal" reasoning always succeed. It is obvious that connectivity is not lost but looks like some kind of timeout expires and cancels the response, even not the request. Visual feedback shows the context being successfully uploaded and even shows the indicator of the answer being generated.
0
1
84
1d
No output appears on tvOS simulator when creating a new game project Xcode 26.2
When I create a new tvOS game and run the default project the simulator window appears but nothing is shown. When I create a MultiPlatform Game project and run the demo project for AppleTV the simulator work correctly. I do not get any errors just a blank screen. Also clicking on the Home icon in the simulator or the actual AppleTV does nothing. Drew
0
0
107
2d
Xcode 16 and iOS 18 project not compiling
I updated Xcode and MacOS recently and haven't been able to compile my Flutter app on iOS devices/simulators since then. The error keeps changing every time I run it but here's one of the output in the terminal after running flutter run: Uncategorized (Xcode): Command SwiftGeneratePch emitted errors but did not return a nonzero exit code to indicate failure Error (Xcode): no such file or directory: '/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation' Error (Xcode): stat cache file '/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.0-22A3362- db63dc9361471f152f572502bdbfe70a.sdkstatcache' not found Error (Xcode): unable to rename temporary '/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/3F9VRK3CXAUUD/UIKit-1KHQ7M05IF VXC-56601391.pcm.tmp' to output file '/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/3F9VRK3CXAUUD/UIKit-1KHQ7M05IF VXC.pcm': 'No such file or directory' Error (Xcode): could not build module 'UIKit' /Users/chiragbhansali/Chirag/Coding/Projects/app/test/build/ios/Debug-iphonesimulator/Flutter.framewo rk/Headers/FlutterAppDelegate.h:7:8 Error (Xcode): could not build module 'Flutter' /Users/chiragbhansali/Chirag/Coding/Projects/app/test/ios/Runner/GeneratedPluginRegistrant.h:9:8 Error (Xcode): failed to emit precompiled header '/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/Runner-eifcguceazlwumgsyzegclqdrbqt/Build/Intermed iates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_PB6A5GFLTNPC-clang_3F9VRK3CXAUUD.pch' for bridging header '/Users/chiragbhansali/Chirag/Coding/Projects/app/test/ios/Runner/Runner-Bridging-Header.h' Uncategorized (Xcode): Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit code to indicate failure Uncategorized (Xcode): Command SwiftEmitModule failed with a nonzero exit code Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code Could not build the application for the simulator. Error launching application on iPhone 16 Pro. What I have tried so far: Deleting iOS SDK and simulators Cleaning Xcode build cache using cmd+shift+k Creating a new Flutter project and trying to compile it (it failed so that reduces the chances of it being a Flutter issue) Clearing the DerivedData folder Clearing settings and cache of simulators Restarting laptop Versions: Xcode: 16.0 iOS: 18.0 MacOS: 15.1 (didn't work with 15.0 either) Flutter: 3.24
23
3
17k
3d
Xcode Playgrounds crashes upon microphone access
Sorry if this is a dumb question. I’m still a beginner. I created an Xcode Playground app with Microphone and Speech Recognition capabilities enabled, along with a backup Info.plist. However, when running the app on Mac Catalyst, a real device, or the iOS and iPadOS simulators, it crashes right after the Speech Recognition permission popup and again after the Microphone permission popup. For extra context, the app initially worked fine in the Swift Playgrounds app, but that environment uses an outdated SDK, so it no longer supports some of the features I’ve implemented. I’m also struggling to find clear, beginner-friendly documentation that explains how AVAudioEngine works, which is making it hard to understand what’s going wrong and how to debug it.
0
1
95
3d
FileProvider fails to trigger re-enumeration
I'm working on a FileProvider which allows access to encrypted files in Dropbox; I can successfully read and present the decrypted files, so I know it's basically working. But I'm having problems getting FileProvider to re-enumerate a folder when its encryption status changes. When the FileProvider receives an update notification saying a folder is now encrypted, I use signalEnumerator to re-enumerate the folder: FileProviderExtension.manager?.signalEnumerator(for: existingItem.itemIdentifier, completionHandler: { (ourError : Error?) -> Void in       if let ourError = ourError {           log("notifyCallback: mount / unmount failed re-enumeration: \(ourError)")       } else {           log("notifyCallback: mount / unmount signalled re-enumeration; pending")       } }) The log reports that the re-enumeration is pending... but as far as I can tell, neither enumerateItems nor enumerateChanges is called on the folder's item unless a Finder window is actually open for that folder. This means that, when an app other than Finder tries to access the files through the filesystem, it doesn't see the updated set of filenames. (For further reference: I've added code to both enumerateItems and enumerateChanges, so that if the call has been triggered by a recent folder-encryption notification, it retrieves a complete set of items from the Dropbox folder. If a retrieved file has an encrypted filename, it reports it as a modified item and returns its filename in-clear; if the filename isn't encrypted, it doesn't return the item (for enumerateItems) or returns it as a deleted item (for enumerateChanges). This approach seems to work successfully for listing folders with a constant state; it's only if the user encrypts / decrypts a folder without currently having a Finder window open inside that folder that I'm not seeing a refresh.) Any advice on how I can force a re-enumeration without a Finder window currently being displayed?
2
2
1.1k
3d
Finding method definition
Hi, I have a recurrent problem with an Xcode workspace that I cannot figure out how to solve: When I command-click a symbol (or press ctrl-cmd-J) to find its definition, and when that definition is in a header file belonging to a custom static library, Xcode opens a header located in the derivedData folder rather than in the project's source codes. The exact location of this file is not in the main 'Build' folder but rather in a folder that seems dedicated to indexing: derivedData/myProject/Index.noIndex/Build/Products/Debug/Include/theHeader.h Consequently the file opened by Xcode is uneditable, I have to close it and reopen the source using another method. Even when the correct header is already opened, and I try again, Xcode reopens the wrong file so that it's opened twice with different paths. In the config file of the main application project, I reference the sources of these static libraries like this: HEADER_SEARCH_PATHS = ${SRCROOT}/myLibrary1/Sources ${SRCROOT}/myLibrary2/Sources ${SRCROOT}/myLibrary3/Sources However, removing this doesn't fix the issue and I don't see any other related-settings. Any idea to fix this annoying issue would be greatly appreciated, thanks!
0
0
45
5d
Strange execution results running program in Xcode
Hi; Here is a simple program that reads a file and counts number of 1s bits in it. The file it reads, simple.txt, is a static text file, resides in the file system, and nothing is touching it during the program execution. The file's length is 436 bytes. When the program is run in the terminal it produces consistent results. Each run counts 1329 1s bits. It behaves differently when run in Xcode. A simple command-line tool project having a single file. Running the program multiple times, via Command-R, produces something strange. That is each execution randomly produces one of two results. One is expected 1329 1s bits, another one shows 1333 1s bits. That is it counts four bits more. Again, each run randomly produces one of those two results. And it happens only when I run the program in Xcode. I tried a different sample text file and experienced the same behavior, but the difference in 1s bits count was five bits. Any idea of how this behavior can be explained? func countOnes(in byte: UInt8) -> Int { var nOnes = 0 var mask: UInt8 = 0x1 while mask != 0 { if (byte & mask) > 1 { nOnes += 1 } mask <<= 1 } return nOnes } func countOnes(in buffer: UnsafeMutableRawBufferPointer, length: Int) -> Int { var nOnes = 0 for byte in buffer[0...length] { nOnes += countOnes(in: byte) } return nOnes } var fd = try FileDescriptor.open("sample.txt", .readOnly) var buffer = UnsafeMutableRawBufferPointer.allocate(byteCount: 4096, alignment: 4) var nBytes = try fd.read(into: buffer) var nOnes = 0 while nBytes > 0 { nOnes += countOnes(in: buffer, length: nBytes) nBytes = try fd.read(into: buffer) } buffer.deallocate() try fd.close() print(nOnes) My machine Darwin MacBookPro 24.6.0 Darwin Kernel Version 24.6.0: Wed Oct 15 21:08:19 PDT 2025; root:xnu-11417.140.69.703.14~1/RELEASE_ARM64_T8103 arm64 macOS Sequoia 15.7.2 Xcode 26.1.1 (17B100) Thanks, Igor
0
0
123
5d
Xcode Crashes when viewing XCUITest Result
I've been working on UI Tests for a month or two and things have been great. But I believe there was a recent update to Xcode [running Version 26.2 (17C52)] and since then about 80% of the time when I try to view the test results so I can see the screenshots and video, Xcode crashes hard and I have to open it again. I've tried cleaning the Build folder and Derived Data and all sorts of stuff like that. Restarted Xcode, restarted my computer, etc. Any idea of how I can avoid these crashes?
0
0
96
6d
Using a local model for Xcode Assist
Hi, I'm interested in trying out Xcode Assist to help with things like complicated refactors or writing tests cases. The ChatGPT and Claude options both share your code with third parties, which is not acceptable for my use case. Has anyone used a fully local model for Xcode Assist? I see that you can select one in the Apple Intelligence section of Xcode's Preferences screen, but don't really know where to start. Are there local models that work well with Xcode Assist and that truly keep your source code private?
1
0
209
6d
(Xcode 26.0 → 26.2) Constant UI flickering in split view mode
Hello, I’ve been experiencing a persistent issue in Xcode since version 26.0, and it is still present in 26.2. When using the split view to display two files side by side, the area in the top‑right corner of the window (the inspector / options panel) starts flickering continuously. This happens regardless of whether I’m using the light or dark theme, and even with the Liquid Glass effect disabled in macOS settings. None of these changes have any impact on the issue. I have already submitted a bug report through Xcode (Feedback Assistant), but the issue is still present as of today. The flickering makes the interface difficult to use and visually very distracting. I’ve attached a video to clearly show the issue. I will review the attachment at the time I publish this post. Thanks in advance for any help or feedback. Video 1 https://www.icloud.com/iclouddrive/077l-R7Ybvxz89NI-B7DliEuA#xcode_bug1 Video 2 https://www.icloud.com/iclouddrive/0f6bJp48ioGRdkYiA2U4sI-cg#xcode-bug2
2
0
102
6d