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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

ChatGPT File ignore
I wanted to ask is there a possibility to have an ignore file for specific files on XCode 26 like all of the other AI IDE's have? It's somewhat impossible to use the feature without this type of functionality on the platform. If not possible, will it be available sometime in the future?
2
0
173
1w
Xcode 26 on macOS 26 with a Dark theme in Light Mode
Is anyone else using one of the "Dark" editor themes (such as "Default (Dark)" or "Classic (Dark)" in Xcode? And is anyone doing this with Xcode 26 on macOS 26? Here's the result while using the "Default (Dark)" theme while my Mac is in "light" mode: Note that the black background of the editor goes all the way to the far left edge of the Xcode window. The large gray area in the project tree is the black background bleeding through the sidebar. This is really distracting. Is there a way to fix this (besides not using a dark theme - I've been using dark themes for over 30 years)? This appears to be a poor design decision in macOS 26 to have split views show the background of the secondary column behind the primary column. iPadOS 26 has the same issue (see https://developer.apple.com/forums/thread/800073).
0
0
80
2w
Ensure that macOS-only SwiftPM project main & test source builds via swift, xcodebuild & Xcode
I want to ensure that the main & test source of my macOS-only SwiftPM project (on GitHub at mas) builds via swift, xcodebuild & Xcode. For builds of clean clones of the main branch (i.e. no locally edited files, no existing .build or .swiftpm folders, etc.): The swift command line below builds main & test fine: swift build --build-tests The xcodebuild command line below doesn't seem to run the SwiftPM MASBuildToolPlugin (which generates a Swift file necessary for the build), which is setup for the project in Package.swift, so neither main nor test build: xcodebuild -scheme MAS -destination "platform=macOS,arch=$(arch),variant=macos" How can I get xcodebuild to run my MASBuildToolPlugin, or to run an equivalent? In Xcode, building main works fine, so Xcode must run the SwiftPM MASBuildToolPlugin. Building test, however, fails with the following error: No such module 'MAS' If I capitalize the name of the executable in the following line in Package.swift from: products: [.executable(name: "mas", targets: ["MAS"])], to: products: [.executable(name: "MAS", targets: ["MAS"])], Then Xcode can compile the tests. That, however, sets the generated executable file's name to MAS, but I want it to be mas. How can I use MAS for the package/module/target/etc. names in the source, but generate an executable file named mas? I obviously can rename the executable after it has been generated by running mv MAS mas, but would the upper-case name be incorrectly used anywhere inside the executable? I assume not. Also, I'd prefer to setup my project properly, instead of using a file renaming hack.
0
1
100
2w
watchOS app with @Published properties fails to compile in Xcode 26.0.1 - "missing import of defining module 'Combine'
I'm developing a watchOS companion app for my iOS app in Xcode 26.0.1 on macOS Sequoia. The watch app uses a simple ObservableObject class with @Published properties for state management, which compiles fine for iOS but fails for the watchOS target. Error: Initializer 'init(wrappedValue:)' is not available due to missing import of defining module 'Combine' Code: swiftimport SwiftUI import WatchConnectivity import Combine // Added explicitly class WatchConnectivityProvider: NSObject, ObservableObject { @Published var distance: Double = 0 @Published var isActive: Bool = false // Additional @Published properties... } Environment: Xcode 26.0.1 (17A400) macOS Sequoia watchOS deployment target: 11.0 Apple Watch Series 11 running watchOS 11.6.1 What I've tried: Adding import Combine explicitly Cleaning build folder Verifying target membership This same code pattern works in the iOS target Is @Published / Combine supported differently in watchOS under Xcode 26? This code worked in previous Xcode versions. What's the recommended approach for observable state in watchOS apps with Xcode 26?
0
1
56
2w
App crashing on launch on Test Flight
My app is crashing on Launch in Test Flight and Console only gives me the information below which doesn’t tell me what I need to fix in my app for it to stop crashing. I’ve looked at the Documents available and I didn’t find them helpful. How can I find out what I need to fix in my app? Any help would be greatly appreciated! • Unhandled JS Exception: TypeError: undefined is not a function (Hermes) • *** Terminating app due to uncaught exception 'RCTFatalException' → SIGABRT • UIKit/setRootViewController: shows up in the native backtrace
0
0
62
2w
Xcode_26 not compiling Metal project
Hello Xcode 26.0.1 (17A400) Missing some Metal components When building a program using Metal, it induces an unexpected error : “error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain Command CompileMetalFile failed with a nonzero exit code” Which terminates the build The fix given “xcodebuild -downloadComponent MetalToolchain” using sudo does not work Did someone find a work around or could resolve the issue? Many thanks Jean MacBook Air M4; macOS 26.0.1; Xcode 26.0.1
1
1
147
2w
Xcode's Coverage is broken since 16.2
The coverage of a lot of modules inside our iOS App, not all of them. it appears to be broken since Xcode 16.2 There are some reports over internet without any fix https://www.reddit.com/r/iOSProgramming/comments/1jnzgxw/tests_coverage_not_visible_on_xcode_162/ there's an error message in the logs: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10 Xcode 26 didn't fix the issue as well
1
0
25
2w
Stage Manager app icon in Xcode 26 macOS apps
Adding icons to Xcode macOS apps using Icon Composer is easy, the icon shows up in the Dock and in the About dialog right away. Yet, after many years struggling with other ways to add icons, I was hoping the new method in macOS 26 and Xcode 26 would finally make the icons show up in Stage Manager as well. Alas, nothing I tried, including killing a lot of things, rebooting while holding my tongue at the right angle, etc, did not help. I do have some new macOS Xcode project apps that show the icon properly in Icon Manager, generated with Icon Composer, yet other apps never show their icon in Icon Composer, no matter what voodoo I try. Forums online yield no solutions to this common problem.
1
0
95
2w
XIB Files line seperator = none not be respected in iOS 26.1 ONLY
Hey All, Curious if you guys are seeing the same thing for those who are using Interface Builder Files (Xib) i set the line seperator to none and on my app (built against ios 18 on the app store, but doesnt matter if i build it against ios 26, or ios 26.1) when running on iOS 26.1 the line seperator will show even when i set it to None. Funny enough if i just play around with the XIB file and set it to single line and maybe RED color the IB file will show it but when running it its the same old default dark greyish color. BUT if i set the line seperator in CODE either to be none or with single line + red it looks good when running on sim / device. So it seems to be an issue with XIB files not being respected in iOS 26.1 (only) i have submitted a feed back FB20466783, hope this helps any xcode devs / uikit devs. thank you !
1
0
89
2w
"Build input file cannot be found" error occurs in Archive.
"Build input file cannot be found" error occurs in Archive. When running Archive to generate a build file, the build file generation fails with a "Build input file cannot be found: ..." error. When debugging, the build runs fine on the actual device without any errors. Comparing and modifying the Build Settings with other projects doesn't fix the issue. Deleting the Swift file and attempting to Archive results in a crash due to the missing file. Even after deleting and adding the Swift file, the same error persists when attempting to Archive. Even after deleting and re-adding the Swift file, the issue persists even after deleting all DerivedData file space on my Mac and restarting Xcode. Can you help me with this issue? It worked fine before the recent macOS update, and I successfully archived and published it to the App Store a few days ago. I believe this issue occurred after updating macOS to 26.0.1. My Xcode version is 26.0.1.
1
0
57
2w
Xcode 26.0 unknown type name 'sqlite3_context'
I have been using the Mixpanel-Swift SDK alongside the Salesforce Mobile SDK in my iOS project with Xcode 16.4 without any issues. However, after upgrading to Xcode 26, I started encountering a problem related to SQLite3. Here is the relevant portion of my Podfile setup: platform :ios, '17.0' def required_pods source 'https://cdn.cocoapods.org/' source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' use_frameworks! pod 'SalesforceAnalytics', '13.0.2' pod 'MobileSync', '13.0.2' pod 'SalesforceSDKCore', '13.0.2' pod 'SalesforceSDKCommon', '13.0.2' pod 'SmartStore', '13.0.2' pod 'Mixpanel-swift' end target 'Test' do required_pods end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.0' end end end Has anyone else encountered a similar issue or discovered a workaround? Any advice or solutions would be greatly appreciated. Thank you in advance!
3
0
210
6d
Made a new launch story board and removed old LaunchImages
Converted my app to use a Storyboard instead of a Launch Image. Everything was working fine until I removed all of the Launch Images within Image.xcassets. I kept the icons. Then I started getting an error that: "None of the input catalogs contained a matching image set named "LaunchImage". The storyboard imageview referenced an image not inside of LaunchImage catalog (but perhaps it did now that its causing this problem). I rebuilt, clean build, checked plist for entry and got the same error. I figured there was something wrong with the Storyboard so I completely removed it, rebuilt a new one, new name new image file, assigned the png file to the imageview and I get the same error. I've tried everything. There must be some deep metadata assignment that is looking for this catalog, so I put it back in, with the files assigned to universal 1x, 2x and 3x. I used LaunchImage as the image file and it recognized it but still get the same error during build. I can even remove the storyboard and I get the same error. We are not using Swift, but Objective C xcode.
2
0
96
4d
Xcode 26 gets stuck frequently
Hi, Ever since I updated to macOS Tahoe and started using Xcode 26 daily, I've run into an issue where it gets stuck very frequently when launching and running my app in the simulator. It happens with the main app target as well as when running unit tests. If I restart Xcode and the simulator app, it works fine again for a while, but after some use, it goes back to the same situation. In Activity Monitor, Xcode ends up at 1000% CPU utilization for a minute or more, basically rendering the simulator and the debugger stuck. If I untick the "Debug Executable" option in the scheme editor, it works fine as well. Anyone else run into the same situation, or are there any tips I can follow to fix this issue? It makes it really tedious to make changes and then be stalled for a minute or more to see the app run. I've restarted the Mac, erased the booted simulator as well. I'm on a MacBook Pro M4 Pro. Everything used to run fine before macOS Tahoe / Xcode 26 on my main device. In fact, I used to run macOS Tahoe / Xcode 26 beta versions on a separate partition without any problems.
0
2
250
2w
xcodebuild -exportLocalizations Fails Due to Cross-Platform Dependencies
I'm working on a large multi-platform iOS project (iOS, iPadOS, watchOS, tvOS, visionOS) and have successfully migrated from legacy .strings files to modern String Catalogs (.xcstrings). However, I'm unable to export localizations using xcodebuild -exportLocalizations due to cross-platform framework dependency issues. (Note: I did have AI help me write this question, so apologies in advance for any errors) Project Structure Main iOS/iPad app with multiple extensions watchOS companion app tvOS app visionOS app 49 .xcstrings files successfully migrated across all targets Uses Swift Package Manager for modularization The Problem When attempting to export localizations using xcodebuild -exportLocalizations, the build fails because it tries to build all targets across all platforms, including watchOS targets that depend on third-party xcframeworks that don't include watchOS slices: xcodebuild -exportLocalizations \ -project MyProject.xcodeproj \ -scheme MyApp \ -localizationPath ./export \ -configuration Debug Error: error: While building for watchOS, no library for this platform was found in 'Frameworks/<incompatible>.xcframework'. (in target 'Target') These frameworks cannot be modified to add watchOS support (third-party/legacy dependencies). What Works vs. What Doesn't Works: Building the iOS app through Xcode GUI Fails: Exporting localizations through Xcode GUI (Product → Export Localizations...) Fails: xcodebuild -exportLocalizations with any combination of flags Attempted Solutions (All Failed) Platform-specific destination: xcodebuild -exportLocalizations -destination "generic/platform=iOS" ... SDK constraint: xcodebuild -exportLocalizations -sdk iphoneos ... Excluding architectures: xcodebuild -exportLocalizations EXCLUDED_ARCHS="armv7k arm64_32" ... Build first, then export: xcodebuild build -scheme MyApp -sdk iphoneos && \ xcodebuild -exportLocalizations ... All approaches still attempt to build watchOS targets despite platform constraints. Observations The -exportLocalizations flag appears to ignore -destination and -sdk flags It seems to scan and build ALL schemes/targets in the project regardless of constraints Regular builds (xcodebuild build) work fine with platform constraints Current Workaround I created a Python script that parses .xcstrings JSON files directly and generates XLIFF output, which works but feels like it's bypassing Apple's intended workflow. Questions for Apple Is there a way to limit xcodebuild -exportLocalizations to specific platforms? The documentation doesn't mention any flags for this, and -destination/-sdk appear to be ignored. Why does -exportLocalizations require building ALL targets across ALL platforms? Both the Xcode GUI (Product → Export Localizations) and xcodebuild -exportLocalizations fail with identical build errors, suggesting this is by design. Is there a reason localization export can't be limited to buildable targets? Is the intended workflow to have ALL targets buildable across ALL platforms before exporting localizations? This seems impractical for multi-platform projects with platform-specific dependencies. Are there any build settings or configuration options that can exclude specific targets/platforms from the localization export scan? Is directly parsing .xcstrings files and generating XLIFF an acceptable alternative, or does this miss important metadata that -exportLocalizations would include? Environment Xcode 16.x / 26.x (reproduces on both) macOS Tahoe Project uses String Catalogs (.xcstrings) format Mixed SPM packages and traditional target structure Any guidance on the correct approach for multi-platform localization export would be greatly appreciated. Is this a known limitation, or is there a recommended pattern I'm missing?
5
0
178
2w
Error executing program on simulator
Hi Team, I am getting following error when executing a program on the simulator. Warning: CocoaPods is installed but broken. Skipping pod install. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. For re-installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation CocoaPods not installed or not in valid state. Error launching application on iPhone 17. I tried to install cocoapods using below command which gave me another error. gem install cocoapods This gave me below error. ERROR: Error installing cocoapods: The last version of securerandom (>= 0.3) to support your Ruby & RubyGems was 0.3.2. Try installing it with `gem install securerandom -v 0.3.2` and then running the current command again securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210. I tried to execute the suggested command gem install securerandom -v 0.3.2 This installed successfully. Then the installation of cocoapods is still not successful which gave me another error related to drb. what is the recommended approach, follow the suggestions? What is the recommended approach for upgrading ruby to latest version? I assumed that this will be taken care by upgrading Xcode which is latest on my system. Can anyone help!
0
0
36
2w
Build Failure - Missing Entitlement
I have a build failure problem in my project. The two messages read: Automatic signing failed Xcode failed to provision this target. Please file a bug report at https://feedbackassistant.apple.com and include the Update Signing report from the Report navigator. Provisioning profile "iOS Team Provisioning Profile: com.hodge.MeditateMD" doesn't include the com.apple.developer.activitykit entitlement. When I look at my entitlements in the signing and capability, I see that the com.apple.activitykit is missing. When I go to my app in the developer website, I can’t find live activities to add to the provisioning profile. I am really stuck and would appreciate any help!
0
0
43
2w
Xcode 26 app crashed
After switching from Xcode 16 to Xcode 26, the app crashes. It runs normally in Xcode 16 but crashes in Xcode 26. The stack trace is below. dyld[29371]: Library not loaded: /usr/lib/swift/libLiveExecutionResultsLogger.dylib Referenced from: /private/var/containers/Bundle/Application/306FCC79-E84A-4C54-ACBE-D1EC6A469560/BoxPlayer.app/BoxPlayer.debug.dylib Reason: tried: '/usr/lib/system/introspection/libLiveExecutionResultsLogger.dylib' (no such file, not in dyld cache), '/usr/lib/swift/libLiveExecutionResultsLogger.dylib' (no such file), '/private/preboot/Cryptexes/OS/usr/lib/swift/libLiveExecutionResultsLogger.dylib' (no such file), '/usr/lib/swift/libLiveExecutionResultsLogger.dylib' (no such file, not in dyld cache)
3
1
146
5d
Xcode shows alert about unknown com.apple.quicklook.preview extension point when running on Apple Vision Pro Simulator
I have an iOS app with a QuickLook extension. I also added Apple Vision Pro in the target's General > Supported Destinations section. About one year ago, I was able to run the app on iPhone, iPad and Apple Vision Pro Simulators. Today I tried running it again on Apple Vision Pro with Xcode 26.0.1, but Xcode shows this error: Try again later. Appex bundle at ~/Library/Developer/CoreSimulator/Devices/F6B3CCA8-82FA-485F-A306-CF85FF589096/data/Library/Caches/com.apple.mobile.installd.staging/temp.PWLT59/extracted/problem.app/PlugIns/problemQuickLook.appex with id org.example.problem.problemQuickLook specifies a value (com.apple.quicklook.preview) for the NSExtensionPointIdentifier key in the NSExtension dictionary in its Info.plist that does not correspond to a known extension point. I tried again later a couple times, even after running Clean Build Folder Immediately, without any change. I can reproduce this with a fresh Xcode project to which I add a Quick Look Preview Extension and Apple Vision Pro as a supported destination. The error doesn't happen when running on Apple Vision Pro (Designed for iPad) or iPad Pro 13-inch (M4) destinations. What is the problem? I created FB20448815.
4
0
198
4d
Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
I just install xcode 26.0.1 throungh app store, but when i 'xcodebuild -downloadComponent MetalToolchain', i get wrong Metal Toolchain 17A324, which is the wrong version. The correct version is 17A5241e i think. This issue i saw 26.1 release has fixed, https://developer.apple.com/documentation/xcode-release-notes/xcode-26_1-release-notes. How can i get update?
1
0
74
2w