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
518
Jul ’25
Xcode Build System Crashes After Update to Xcode 16
Hi everyone, I've recently upgraded macOS to sequoia and Xcode 16 and am encountering an issue with the build system crashing. The error message I receive is: Unexpected service error: The Xcode build system has crashed. Build again to continue. I've already tried cleaning the build folder, resetting the Xcode preferences, and restarting Xcode, but the issue persists. My app previously built fine with Xcode 15, and nothing significant has changed in my project except for the Xcode upgrade. #Reactnative #Xcode #iOS #MacOs #sequoia
1
3
6.4k
Sep ’24
Stuck on loading screen
I'm trying to add a new dependency but I'm stuck on the loading screen where it loads the recently used dependencies. I've tried closing and restarting Xcode, my computer, derived data and also fully reinstalled Xcode without any luck.
1
0
351
Sep ’24
xxd script broken with ENABLE_USER_SCRIPT_SANDBOXING
Hey! I have a build script that uses "xxd" to embed some resources in my binary. With the ENABLE_USER_SCRIPT_SANDBOXING now basically mandated in Xcode 16 (without it, it now shows a warning), I'm trying to enable it in my build. I'm getting no errors, but the output from xxd specifically is totally empty, like it's being blocked. I tried adding /usr/bin/xxd to the list of input files, but that didn't work. Anyone know if there's a way to get this working – or, alternatively, to suppress the warning?
0
1
473
Sep ’24
Turning off WiFi on iPhone breaks connection to Xcode debugger
I have a bug in my app that happens when the app is "offline" without and internet connection. The app should still work as it stores content locally. However I am struggling to debug the issue because turning off WiFi breaks the connection to the Xcode debugger, even though it is plugged in via USB. Did I turn on some setting to debug over WiFi? How do I debug over USB so I can see the log output without a network connection to the iPhone?
2
0
815
Sep ’24
Xcode 16.0 got Assertion failed when build my project
After upgrading to Xcode 16.0, I encountered the following error when building my project. It compiled successfully on Xcode 15 or Xcode 16 with -ld64. I am not sure how to resolve this issue and would appreciate any help. Here is the error message Assertion failed: ((ct == Atom::ContentType::objcConst) || (ct == Atom::ContentType::objcData) || (ct == Atom::ContentType::constData) || (ct == Atom::ContentType::constText)), function ObjCClassReadOnlyDataRef, file Atom.cpp, line 3022.
5
6
2k
Sep ’24
Unable to debug app on phone
After updating macOS (macbook M2 Max) to Version 15.0 Beta (24A5298h) and running Xcode version 16.0 beta 4 (16A5211f), I am no longer able to debug apps on phones due to that I can not load them to the phone (even with cable connection). I had no issues in the past with these phones. The error message in Xcode is "Previous preparation error: Developer Mode disabled; To use iPhone for development, enable Developer Mode in Settings → Privacy & Security." But the phones are in Developer mode. Updating phones to a later iOS version does not help. Also, going back in Xcode does not help, as with macOS 15.0 Beta you need to have Xcode 16.0 Trying other phones that worked in the past does not help. Reinstalling Xcode does not help either. I see the phones in Finder, so there is a connection. Enabling/Disabling the Developer mode switch on the phone does not help either. Rebooting devices neither. Tried everything available on the internet, but no results. Need to test on phones, as I am using AR, which doesn't to run with the simulator.
13
3
1.6k
Sep ’24
'ExtensionFoundation/EXMacros.h' file not found
I have a project which will not build on with XCode 16. I get a bunch of build errors like the following: :1:9: note: in file included from :1: #import "Headers/ExtensionFoundation.h" ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/ExtensionFoundation.framework/Headers/ExtensionFoundation.h:9:9: error: 'ExtensionFoundation/EXMacros.h' file not found #import <ExtensionFoundation/EXMacros.h> ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/ExtensionFoundation.framework/Headers/ExtensionFoundation.h:9:9: note: did not find header 'EXMacros.h' in framework 'ExtensionFoundation' (loaded from '/System/Library/PrivateFrameworks') #import <ExtensionFoundation/EXMacros.h> ^ :0: error: could not build Objective-C module 'ExtensionFoundation' I'm stumped. Can anyone help? I'm running Sequoia 15.0.
2
0
363
Sep ’24
Renaming SwiftData model causing an error
I'm still working on version 1.0.0 of my app so don't yet need to migrate swiftdata versions. I renamed my data model(s) but I get this error when running the app after changing the name of the model from SectionsSD to HelpSection error: the replacement path doesn't exist: "/var/folders/fk/m2x_2qzj44508m9zzcll2j_w0000gn/T/swift-generated-sources/@__swiftmacro_11OpExShellV112FilteredListV11helpSection5QueryfMa_.swift" Despite cleaning the build, deleting the derived data and deleting the app and data on the simulator (and resetting it) I still get the replacement path error whenever I run the app in the simulator. When I run this code against the model I get the error: @Query var helpSection: [HelpSection] let searchString: String let isExpanded: Bool var filteredSections: [HelpSection] { helpSection.filter { section in section.toArticles?.contains { $0.search.contains(searchString) } == true } .sorted { $0.rank < $1.rank } } deleting derived data, cleaning builds and restarts do not resolve the issue.
2
2
1.4k
Sep ’24
iOS app fails to run with Xcode 16, no issue with Xcode 15 (no build errors)
When I build and run my iOS app with Xcode 16.0 RC (16A242), it fails to run on both a physical iPhone (running iOS 18.0) and any iOS simulator (17.5, 18.0 RC tested). To be clear, this is an issue when running – there are zero build errors, and compilation always completes successfully. The same app, building and running from Xcode 15.4 (15F31d) runs on both a physical iPhone (same OS version) and an iOS simulator (same version) with no issues, and is currently deployed to TestFlight with no crashes at launch reported from users. Xcode 16's console logs the following: warning: (arm64) /Users/seb/Library/Developer/Xcode/DerivedData/Feed-bvzobcgzcnaibqbcwiasvpoxsetu/Build/Products/Debug-iphonesimulator/Feed.app/Feed empty dSYM file detected, dSYM was created with an executable with no debug info. No entry point found. Checked '(null)' I've so far tried a clean build, as well as clearing out my derived data folder entirely. Happy to provide any more info. Does anyone have any pointers as where I even start to debug this issue and narrow down on what's going on with Xcode 16?
12
3
12k
Sep ’24
Xcode 16 Crash when opening existing Project
HI, I've updated to Xcode 16 (via App Store Update). When opening my project, Xcode crashes during the "Resolving Package Graph" phase. When opening other projects without dependencies, there is no crash. The same project opens in Xcode 15 without a problem. What can I do to solve this? I'm using a M1 Mac mini. BR, Holger ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: Xcode [31068] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 16.0 (23051) Build Info: IDEApplication-23051000000000000~2 (16A242d) App Item ID: 497799835 App External ID: 869020508 Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2024-09-17 14:54:37.6473 +0200 OS Version: macOS 14.5 (23F5059e) Report Version: 12 Anonymous UUID: AF4F3464-F5C0-CFBD-4CDF-6D21A8B8CEDC Sleep/Wake UUID: 0688C7F5-AE00-4295-ADA6-7224A11963EA Time Awake Since Boot: 18000 seconds Time Since Wake: 211 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [31068] Application Specific Information: abort() called Application Specific Signatures: NSInvalidArgumentException Application Specific Backtrace 0: 0 CoreFoundation 0x000000018180b31c __exceptionPreprocess + 176 1 DVTFoundation 0x0000000104a945cc DVTFailureHintExceptionPreprocessor + 388 2 libobjc.A.dylib 0x00000001812f2788 objc_exception_throw + 60 3 CoreFoundation 0x00000001818fea0c -[__NSCFString characterAtIndex:].cold.1 + 0 4 CoreFoundation 0x00000001817f0f44 -[NSMutableArray insertObjects:atIndexes:] + 1020 5 IDEFoundation 0x000000010cfe6c84 __50-[IDEGroup insertGroupSubitems:atIndexes:context:]_block_invoke + 1084 6 DVTFoundation 0x0000000104ba3798 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] + 60 7 IDEFoundation 0x000000010cfe67a8 -[IDEGroup insertGroupSubitems:atIndexes:context:] + 248 8 DVTFoundation 0x0000000104b6267c -[NSMutableArray(DVTFoundationClassAdditions) dvt_sortedInsertOfObjects:withComparator:] + 184 9 IDESwiftPackageCore 0x0000000306ac8620 $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC32registerDependencyFileReferences33_033DB97E8C2A552F3158921835EE9F98LL_27modelGraphSynchronizerTokenySayAA0abgH9ReferenceO010dependencyU0_AC16RegistrationModeAELLO012registrationX0tG_AC05ModelrsT0AELLVtFTf4ndn_n + 760 10 IDESwiftPackageCore 0x0000000306acb728 $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC27dependencyPackagesDidUpdate33_033DB97E8C2A552F3158921835EE9F98LL8packages14graphHasErrors25revalidatedFilePathCaches27modelGraphSynchronizerTokenySay7SwiftPM10SPMPackageCG_Sb13DVTFoundation11AffirmativeOAC05ModelZ17SynchronizerTokenAELLVtFTf4nnndn_n + 356 11 IDESwiftPackageCore 0x0000000306ac3640 $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC27packageGraphDidFinishAction_8duration6resulty7SwiftPM12SPMWorkspaceC0bgJ0O_SdAG0oebgJ16ResolutionResultOtYaFyAC05ModelG17SynchronizerToken33_033DB97E8C2A552F3158921835EE9F98LLVXEfU_ + 484 12 IDESwiftPackageCore 0x0000000306ac70dc $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC38disableWorkspaceContentSynchronization33_033DB97E8C2A552F3158921835EE9F98LL6duringyyAC27ModelGraphSynchronizerTokenAELLVXE_tFyyXEfU_TA + 20 13 DVTFoundation 0x0000000104d75b50 $sSo19DVTModelObjectGraphC13DVTFoundationE34performBlockCoalescingModelChangesyxxyXElFyyXEfU_ + 104 14 DVTFoundation 0x0000000104d3ce00 $sSDySSSo8NSObjectCGIgo_ACIego_TR + 20 15 DVTFoundation 0x0000000104d75868 $sIeg_IyB_TR + 20 16 DVTFoundation 0x0000000104ba3878 __58-[DVTModelObjectGraph performBlockCoalescingModelChanges:]_block_invoke + 104 17 DVTFoundation 0x0000000104b9d324 -[DVTModelGraphTransactionScope performTransaction:] + 60 18 DVTFoundation 0x0000000104ba37f0 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] + 148 19 DVTFoundation 0x0000000104d76308 $sSo19DVTModelObjectGraphC13DVTFoundationE34performBlockCoalescingModelChangesyxxyXElF + 344 20 IDESwiftPackageCore 0x0000000306ab97f0 $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC38disableWorkspaceContentSynchronization33_033DB97E8C2A552F3158921835EE9F98LL6duringyyAC27ModelGraphSynchronizerTokenAELLVXE_tF + 444 21 IDESwiftPackageCore 0x0000000306ac265c $s19IDESwiftPackageCore23IDESPMWorkspaceDelegateC27packageGraphDidFinishAction_8duration6resulty7SwiftPM12SPMWorkspaceC0bgJ0O_SdAG0oebgJ16ResolutionResultOtYaFTY4_ + 164 22 IDESwiftPackageCore 0x0000000306a98191 $sIeAgH_ytIeAgHr_TRTATQ0_ + 1 23 SwiftPM 0x000000031c735571 $s7SwiftPM12SPMWorkspaceC26packageGraphActionFinished33_918CA8CFEB8D3E06D2EEA2771EA5EA00LLyyAC07PackageE16ResolutionResultAELLVYaFTQ1_ + 1 24 SwiftPM 0x000000031c734e8d $s7SwiftPM12SPMWorkspaceC46processPackageGraphActionsInBackgroundIfNeeded33_918CA8CFEB8D3E06D2EEA2771EA5EA00LL010canProcessefG0yAC11AffirmativeO_tFyyYaYbcfU1_yyYacfU0_TQ1_ + 1 25 SwiftPM 0x000000031c782dfd $s7SwiftPM33SPMWorkspaceOrchestrationDelegateP27packageGraphDidFinishAction_8duration6resultyAA0C0C07PackagegJ0O_SdAA0cemgJ16ResolutionResultOtYaFTjTQ0_ + 1 26 SwiftPM 0x000000031c7f7c79 $sxIeAgHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TQ0_ + 1 27 SwiftPM 0x000000031c77f571 $sxIeAgHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TATQ0_ + 1 28 libswift_Concurrency.dylib 0x00000002491de0f9 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1
4
2
1.6k
Sep ’24
Adding ObjC Files in Xcode Packages Requires a Clean Build
We’ve been encountering build failures when switching Git branches in Xcode (15 & 16), where the project fails to build due to missing symbols. Typically, running an Xcode clean resolves the issue, but this is disruptive—especially on large projects where a full rebuild after cleaning can be time-consuming. We’ve managed to reproduce this issue in a minimal setup: Create a new Xcode project. Include a local Swift Package in the project. The main project depends on the package. Add a new Objective-C class to the package. Use that new class in the main project. Build (FAILS). Clean the project. Build (SUCCEEDS). This issue tends to arise when switching Git branches that introduce new files, such as Objective-C files that don’t exist on the main branch. If a new file is introduced in a feature branch, switching between main and feature requires a clean before the project will build successfully again. We plan to file a feedback report, but in the meantime, we’re wondering if anyone has found effective workarounds for this problem when switching branches. The only reasonable work-around we have found is to create an umbrella header manually and include the new header. It would be nice to not have to resort to maintaining umbrella headers in packages but this is ok.
0
0
365
Sep ’24
Unable to Vertify App/ Preview only on iPhone
Choose the real iPhone device on my Xcode and build for running. Xcode warn me to vertify the Developer App certification in VPN & Device Management. When I get through it as vertify. The setting page still ask me to vertify the app. I press the "Vertify App" Button and press "Vertify" but it can't work. And it also cannot preview when I choose my device in the previewer. But both work well on my iPad Air. I can pass the vertify app and also can preview through Xcode. I searched the problem in forum.i found someone who has the same problem. https://developer.apple.com/forums/thread/744579 I try to change my network environment, reboot the device, reboot the develop laptop, but still cannot work. I'm using Xcode Version 16.0 (16A242d) iPhone 14 Pro with iOS 18.0 (22A3354) iPad Air 3 with iPad OS 17.6.1
0
0
337
Sep ’24
Could not build module 'UIKit' - XCode 16 Beta 3
I have an old project that combines Objective-C with Swift and it is compiling just fine in XCode 15 but is not compiling on XCode 16 Beta 3. There are multiple errors such as: "could not build module 'UIKit'" "could not build module 'CoreMedia'" "could not build module 'CoreLocation'" Among the errors there is this one about failing to emit precompiled header in the Bridging header file of the project. I've tried re-installing XCode 16 Beta 3, re-installing the simulator, restarting the computer and I've also created a sample project that also combines swift and Ojb-c and that one compiles just fine. Any clues? Thanks!
11
3
5.1k
Sep ’24
Xcode 16.0 Simulator not showing autofill/password sheet
I am currently experiencing issues with the simulator in Xcode 16.0 when running Simulator Devices. When tapping any password field, the sheet presenting autofill/password suggestions does not appear properly. It is stuck at the bottom of the screen. I am facing this issue both in my own app and in the Safari app on the simulator, as shown in the screenshots. Is anyone else experiencing this issue?
2
0
408
Sep ’24
App crashing in MacOs 10.15, xcode 16, but working in Sonoma's xcode16
Hello. I don't even know where to start. We have a React Native application with some native modules that have never been an issue. The app was working under Sonoma Xcode16, yesterday I autoupdated my MacOS to Squoia, and the application won't build using the newest Xcode16 and Xcode command line tools. The builds system crashes in the middle of building the app and throws a really vague description: unexpected service error: The Xcode build system has crashed. Build again to continue. I Post the report summary (without the kernel triage), since I can't find what's wrong after updating most of my libraries... ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: XCBBuildService [95423] Path: /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/MacOS/XCBBuildService Identifier: com.apple.dt.XCBBuildService Version: 1.0 (23000.1.226) Build Info: XCBuild-23000001226000000~21 (16A242d) Code Type: ARM-64 (Native) Parent Process: Xcode [73582] Responsible: Xcode [73582] User ID: 501 Date/Time: 2024-09-19 18:13:24.6355 -0600 OS Version: macOS 15.0 (24A335) Report Version: 12 Anonymous UUID: 43B52D98-515B-9112-EEEB-8F7C77E1126D Sleep/Wake UUID: 95C65D73-8F98-45C7-BF7A-5799C9E1CAA4 Time Awake Since Boot: 130000 seconds Time Since Wake: 27974 seconds System Integrity Protection: enabled Crashed Thread: 11 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: XCBBuildService [95423] Application Specific Information: abort() called Thanks in advance. Edit: already tried with this, which is indeed a library I am using, but still keeps crashing: Stack Overflow Solution based on some library update
0
1
417
Sep ’24