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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

App icon produced by Xcode 26 is 1 MB bigger than Xcode 16
When comparing the Assets.car file of the previous and current versions of my app, compiled with Xcode 16 and 26, respectively, with the Terminal command assetutil --info MyApp.app/Contents/Resources/Assets.car I see that the new version contains many more app icons at different sizes, increasing my app's size by 1 MB (not much, but considering that the app is only 6 MB in total...): { "AssetType" : "MultiSized Image", "Name" : "AppIcon", "NameIdentifier" : 6849, "Scale" : 1, "SHA1Digest" : "9D75F76992E9E9E5531A214A4AE282EBD381F7EB903024E00FB25EB42381CC45", "SizeOnDisk" : 308, "Sizes" : [ "16x16 index:1 idiom:universal", "32x32 index:2 idiom:universal", "64x64 index:3 idiom:universal", "128x128 index:4 idiom:universal", "256x256 index:5 idiom:universal", "512x512 index:6 idiom:universal", "1024x1024 index:7 idiom:universal" ] } The previous one allowed me to add only two sizes: { "AssetType" : "MultiSized Image", "Name" : "AppIcon", "NameIdentifier" : 6849, "Scale" : 1, "SHA1Digest" : "AC782A2FFF9A4B2D563EF64DF41A179583440560F8732A176A8376B31000368E", "SizeOnDisk" : 248, "Sizes" : [ "256x256 index:1 idiom:universal", "512x512 index:2 idiom:universal" ] } Is there a way to only ship the strictly necessary app icons sizes while using Xcode 26 Icon Composer, or will all the sizes be required going forward?
0
0
120
Oct ’25
macOS 26.0 Tahoe + Xcode 26.0.1 Simulator causes system-wide audio distortion
After upgrading to macOS 26.0 Tahoe and Xcode 26.0.1, I’ve noticed an issue with audio playback whenever the iOS Simulator is running. Device: MacBook Pro 13" (2020, Intel, 16GB RAM, 500GB SSD) Issue: Any sound played on the Mac (system sounds, music, videos) begins to break/distort once the Simulator is active. App Sounds: If the app running inside the Simulator plays audio, that audio also breaks/distorts. Previous Version: This issue did not occur on macOS Sequoia 15 or with Xcode 16. Everything was working fine before the upgrade.
2
4
458
Oct ’25
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
193
Oct ’25
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
98
Oct ’25
tvOS 26 - AVPlayer.preventsDisplaySleepDuringVideoPlayback not working
Hi guys, after updating to tvOS 26 it is not possible to disable screensaver using AVPlayer.preventsDisplaySleepDuringVideoPlayback. We are streaming TV programs continuously and when player is in full creen we disable screensaver by setting preventsDisplaySleepDuringVideoPlayback = true When leaving player screen and navigating to Home or EPG where player continues to play in the background we set preventsDisplaySleepDuringVideoPlayback = false to enable screen saver in which case after set time screensaver activates. Disabling screensaver appears to be working only when starting the app for the first time, but when making the first transition out of the player and calling preventsDisplaySleepDuringVideoPlayback = false for the first time, then any subsequent change of preventsDisplaySleepDuringVideoPlayback to true has no effect. Result is that player is playing in full screen, but after set period (e.g. 2 minutes) screen saver activates, which is very bad user experience making TV app unusable. I tried using Xcode 26 and targetting tvOS 17 and higher. I installed Xcode 16.4 and rebuilt the app, but I see the same problem with screensaver. Xcode 16.4 and tvOS 17 target worked before. It appears to be related to tvOS 26 not to SDK itself. Is there perhaps a new API to disable screensaver? Is preventsDisplaySleepDuringVideoPlayback obsolete or could it be intention to disallow developers disabling screensaver? Do we need to notify all users to set screensaver time to higher value or Never if they want to watch TV for all day without touching remote? Not sure if it is a bug in tvOS 26 or purposely changed behavior. Does anybody know? Thanks.
3
0
115
Oct ’25
XCode 26: is it possible to remove the preinstalled iOS Platform via xcodebuild?
Hi, as described by the subject, I'm trying to find a way to remove the preinstalled iOS support via command line tool. I need to do that because I need to use the universal architectureVariant in order to build on old Intel-based iOS Simulators, but on iOS 26. As described in this page, I can use this command to download the architecture I need xcodebuild -downloadPlatform iOS -architectureVariant universal however, launching this command I receive this error iOS is already downloaded as arm64Only. To replace with universal, first delete the existing one. Is there any way to remove the current installed iOS platform via command line? In particular I'm serching for a way to do what the button "Delete" in the attached screen does. Thank you
1
1
132
Oct ’25
XCode app testing on iPhone fills in iPhone storage
I run some tests for an iOS app, connecting the iPhone to my mac where the code resides. I notice that it fills the iPhone from system data, until the iPhone is full. I tried everything to remove the system data (I assume some logs from the XCode testing): reset network, restart the iPhone, remove the tested app, etc. Nothing works. I am stuck with having to erase all data on the iPhone and reinstall from scratch, which is very tedious. Any suggestions ? Thanks!
0
0
70
Oct ’25
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
94
Oct ’25
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
109
Oct ’25
Xcode 26, Pull Requests support
Does anyone have problems with the Pull Request functionality in Xcode 26 RC? I can’t create a new pull request inside Xcode (it always redirects me to the web page). I can’t see changes within an existing pull request (I only see the PR name; I can’t even approve it or request changes). I’ve had this problem since beta 1 of Xcode 26. Does anyone know how to fix this?
1
1
123
Oct ’25
Does Xcode 26 Still Support Pull Requests?
Does Xcode 26 still support creating pull requests and/or viewing comments from GitHub pull requests associated with the current branch? This used to be possible, but I cannot get it to work with the current version of Xcode (26.0.1). The "Create Pull Request" menu item takes me to github.com directly, instead of presenting a nice UI menu; hence I'm wondering.
1
2
80
Oct ’25
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
68
Oct ’25
AppIntents don't show up in Shortcuts app when in SPM package
Hi there, I successfully created an AppIntent for our app, and when I had it in the same target as our main app it showed up fine in the shortcuts app. Then I realized that many of the new System Control widgets introduced in iOS 18 (e.g. lockscreen, control center) live in the widget extension target, but they also need to reference that same AppIntent. So to fix this, I thought I'd migrate out the code into it's own SPM package that both the WidgetExtension and the Main App processes can reference. However, after doing that and rebuilding, the intent no longer shows up in the Shortcuts app. Furthermore, my AppShortcutsProvider class now has this error when trying to define the list of appShortcuts: App Intent <name> should be in the same target as AppShortcutsProvider Is this intended, and if so, how do we reference the same AppIntent across multiple targets?
16
2
3.9k
Oct ’25
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
66
Oct ’25
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
30
Oct ’25
"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
64
Oct ’25