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

Posts under Xcode tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Unstable behavior of xcodebuild -showdestinations
Hi, I am having an issue with xcodebuild -showdestinations command. Steps to reproduce: Create a new iOS application project in Xcode or use an existing one. Navigate to this project in a terminal. Run xcodebuild -project 'your-project-name.xcodeproj' -scheme 'your-scheme' -showdestinations What I expect: All destinations available in the Xcode UI should be listed. What I get: It depends. For new projects, I consistently get only generic platform destinations and my connected physical device. When I run the same command on an older project, I sometimes see all the expected destinations. It seems to be a roughly 50/50 chance between the two outcomes. Is there a way to get consistent results from xcodebuild -showdestinations? What can I do to ensure all destinations are listed reliably? Here is a more detailed log and a screenshot: ❯ xcodebuild -workspace 'WorkoutDiary.xcworkspace' -scheme 'WorkoutDiary' -showdestinations Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace WorkoutDiary.xcworkspace -scheme WorkoutDiary -showdestinations User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES 2025-06-17 19:13:50.261 xcodebuild[34753:6177985] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. 2025-06-17 19:13:50.342 xcodebuild[34753:6177959] [MT] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. Resolve Package Graph Resolved source packages: <REDACTED> Available destinations for the "WorkoutDiary" scheme: { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:<REDACTED>, name:My Mac } { platform:iOS, arch:arm64, id:<REDACTED>, name:<REDACTED> } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } ❯ xcodebuild -workspace 'WorkoutDiary.xcworkspace' -scheme 'WorkoutDiary' -showdestinations Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace WorkoutDiary.xcworkspace -scheme WorkoutDiary -showdestinations User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES 2025-06-17 19:13:52.393 xcodebuild[34757:6178035] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. 2025-06-17 19:13:52.472 xcodebuild[34757:6178020] [MT] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. Resolve Package Graph Resolved source packages: <REDACTED> Available destinations for the "WorkoutDiary" scheme: { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:<REDACTED>, name:My Mac } { platform:iOS, arch:arm64, id:<REDACTED>, name:<REDACTED> } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } { platform:iOS Simulator, id:DBFB9613-0261-4544-908A-335570F3C35F, OS:18.3.1, name:iPhone 11 } { platform:iOS Simulator, id:A48C309C-231A-4197-A295-900F89C94D86, OS:18.3.1, name:iPhone 16 Pro Max }
2
0
136
2w
New AVCam sample code hanging in XCode 26 debugger
I am wondering if new AVCam sample code was tested before release. It hangs on startup on iPhone 14 pro running iOS 26 beta with the following logs on console: <<<< FigAudioSession(AV) >>>> audioSessionAVAudioSession_CopyMXSessionProperty signalled err=-19224 (kFigAudioSessionError_UnsupportedOperation) (getMXSessionProperty unsupported) at FigAudioSession_AVAudioSession.m:606 <<<< FigAudioSession(AV) >>>> audioSessionAVAudioSession_CopyMXSessionProperty signalled err=-19224 (kFigAudioSessionError_UnsupportedOperation) (getMXSessionProperty unsupported) at FigAudioSession_AVAudioSession.m:606 App is being debugged, do not track this hang Hang detected: 8.04s (debugger attached, not reporting)```
1
0
49
2w
Price in a Xcode synced StoreKit configuration file is not updated when I change it on App Store Connect and always shows the starting price
Hello, I've noticed the prices of my products in my Xcode synced StoreKit configuration are not updated when I change the price in App Store Connect. I tried to manually sync the file, to remove and add it again to my project but old initial prices are still used. In the screenshot below, the price is currently $2.99 but the file still uses the initial price of $1.99. It makes testing a little bit painful because I'm never sure which product is being shown. Is this a bug? Is there a way to get the live production App Store prices be used instead of the starting prices? I filed a feedback for this: FB17798486 Regards, Axel
0
1
37
2w
Using alternate app icons with Icon Composer
I've been messing around with converting my app icons to use Icon Composer. My app has multiple app icons, but I've noticed that I cant seem to set .icon files using the alternate app icon api. I believe this is due to the requirement that alternate app icons live in the Assets Catalogue but .icon files go anywhere in your project. Is there any plan to support this? Or am i missing something? I was able to successfully set a .icon file for the primary app icon.
1
3
69
6d
Using AVAsynchronousKeyValueLoading.load() on an AVAssetTrack gives an error
I'm seeing this error while attempting to compile my VisionOS app under Xcode 26. My existing code looks like: let (naturalSize, formatDescriptions, mediaCharacteristics) = try? await videoTrack.load(.naturalSize, .formatDescriptions, .mediaCharacteristics) This is now giving a compiler error: Type of expression is ambiguous without a type annotation I don't see that anything that was changed or deprecated in the latest version. Also loading the properties individually seems to work fine i.e.: let naturalSize = try? await videoTrack.load(.naturalSize) let formatDescriptions = try? await videoTrack.load(.formatDescriptions) let mediaCharacteristics = try? await videoTrack.load(.mediaCharacteristics)
1
0
43
1w
Archiving a Swift SDK with SPM Dependencies for XCFramework Distribution
Hello, I’m building a Swift-based SDK (using SwiftUI) that will be distributed as a single .xcframework, and consumed by a React Native application. The SDK has multiple internal module dependencies (e.g., Essentials, CoreModels, CoreRepository), each of which is currently implemented as a local Swift Package (SPM). When I attempt to archive the main SDK framework using xcodebuild archive with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, the archive process fails during SwiftEmitModule for these SPMs. I understand this likely relates to module stability requirements for .xcframework distribution. My key question: Is it mandatory to convert all Swift Packages (SPMs) into Xcode framework targets in order to successfully archive and bundle them into a distributable .xcframework? Or alternatively, is there a recommended approach to make Swift Packages archive-compatible for use in a compiled, closed-source SDK, without converting them into Xcode framework targets? Awaiting your guidance.
0
0
37
2w
Xcode 16.4 on macOS Tahoe 26
I’m currently using the stable release of Xcode 16.4, and I’m considering installing macOS beta 26. Before I upgrade, I’d like to know: 👉 Is it generally possible to use Xcode 16.4 with macOS Tahoe beta? My goal is to continue building and submitting apps to the App Store using the non-beta Xcode version. I understand that Apple only officially supports each stable Xcode with the current public macOS release, but in practice, has anyone run into issues doing this? This would not be my primary development Mac, but I’d still like to be able to compile and test code on the machine running the macOS beta. I’d appreciate any experiences or official guidance — especially regarding app signing, archiving, or compatibility with Xcode Cloud. Thanks in advance!
4
0
390
3w
Xcode26 build app with iOS26, UISplitViewController UI issue
Our project using UISplitViewController as the root view controller for whole app. And when using the xocde26 to build app in iOS26, the layout of page is uncorrect. for iPhone, when launch app and in portrait mode, the app only show a blank page: and when rotate app to landscape, the first view controller of UISplitViewController's viewControllers will float on second view controller: and this float behavior also happens in iPad: below is the demo code: AppDelegate.swift: import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { let window: UIWindow = UIWindow() func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let vc = SplitViewController(primary: TabBarViewController(), secondary: ViewController()) window.rootViewController = vc window.makeKeyAndVisible() return true } } SplitViewController: import UIKit class SplitViewController: UISplitViewController { init(primary: UIViewController, secondary: UIViewController) { super.init(nibName: nil, bundle: nil) preferredDisplayMode = .oneBesideSecondary presentsWithGesture = false delegate = self viewControllers = [primary, secondary] } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() } } extension SplitViewController: UISplitViewControllerDelegate { } TabBarViewController.swift: import UIKit class FirstViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .red tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), tag: 0) } } class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .purple tabBarItem = UITabBarItem(title: "Setting", image: UIImage(systemName: "gear"), tag: 1) } } class TabBarViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() let firstVC = FirstViewController() let secondVC = SecondViewController() tabBar.backgroundColor = .orange viewControllers = [firstVC, secondVC] } } ViewController.swift: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemPink } } And I have post a feedback in Feedback Assistant(id: FB18004520), the demo project code can be found there.
1
1
149
3w
Precompile bridging header and compilation of any swift files that import that import my objective-c framework with modulemap runs every build
I have a project which is set up like so App.xcproject App target { Dependency on Bridges.framework } Bridges.xcproject Bridges.framework Bridges.framework has a bunch of Objective-c++ headers that import c++ headers/frameworks etc. It has a modulemap that allows it to generate bridging headers for the App target which is Swift only. I have noticed that every single build Planning Swift module App is run for 1 second, then Precompile bridging header is run for a moment, then every single swift file that imports Bridges recompiles regardless of if it had any edits taking about 2-3 seconds. It feels like since nothing has changed inside of Bridges that this bridging header precompile should not be necessary every single run. Bridges.framework is in General/Frameworks as "Do not embed" Bridges is in build phases "Target dependencies" and "Link binary with libraries" Is this just normal and I should let this slide or is there a way to avoid this?
2
0
52
3w
Making an xcode Run Script phase run when any file within a folder has changed
I have an Xcproject that I am using to define a .framework target that includes Objective-C++ bridges for a whole slew of C++ libraries. To bridge Objective-C++ to Swift code in a separate target, I am using a .modulemap file that I generate in a script. So we've essentially got App.xcproject App target { Dependency on Bridges.framework } Bridges.xcproject Bridges.framework { Dependency on generate-modulemap + a whole slough of c++ libraries } generate-modulemap It is VERY expensive for the Bridges framework to need to compile each build. The generation of the bridge static library takes 21 seconds, and the signing of it takes 32 seconds. I would like to get generate-module to have its RunScript phase run based on dependency analysis. This way a new modulemap is only made when there is a new header and I can avoid compiling the whole framework each build. Normally, I would just list all of the headers in the input list to the script, but in this case, the goal is more to have it be any file within that folder. However, it is very unclear how to do so. Is there a way to get the "based on dependency analysis" to go based on any file within a folder? A filelist does not work here because the filelist does not get updated automatically when you add a new header into that folder.
1
0
43
3w
Cannot load developer teams in Xcode.
Hi, The ui error says unable to login, but I'm able to login (because if I don't give the correct password it's a different error). When Xcode tries to fetch the available teams though it errors out. I can successfully login and access my teams on a different machine that's on the same network. So I know the account and network are fine. Here's what the ui shows .. and I'm also including the Xcode logs from Console. Any ideas? Thanks! xcode.log
1
0
49
3w
Xcode Beta 1 and FoundationsModel access
I downloaded Xcode Beta 1 on my mac (did not upgrade the OS). The target OS level of iOS26 and the device simulator for iOS26 is downloaded and selected as the target. When I try a simple Playground in Xcode ( #Playground ) I get a session error. #Playground { let avail = SystemLanguageModel.default.availability if avail != .available { print("SystemLanguageModel not available") return } let session = LanguageModelSession() do { let response = try await session.respond(to: "Create a recipe for apple pie") } catch { print(error) } } The error I get is: Asset com.apple.gm.safety_deny_input.foundation_models.framework.api not found in Model Catalog Is there a way to test drive the FoundationModel code without upgrading to macos26?
1
1
257
3w
Xcode 26.0 beta: Double-click in Navigator Doesn’t Open File in New Tab
Issue Report — Xcode 26.0 beta (17A5241e) In Xcode 26.0 beta, double-clicking a file in the project navigator does not open it in a new tab as it normally should. Instead, it opens the file in the current editor window. Interestingly, Option-clicking a file still opens it in a new tab as expected. I’ve confirmed that my Navigation preferences are properly set (see the attached screenshot), so this seems like a possible regression or bug in the current beta version.
1
1
81
3w
Losing connection to the debugger in Xcode when a new configuration is pushed through MDM.
I pushed a configuration to my iPhone through MDM to run the content filter. However, when I modify the configuration by adding some vendor-configuration , I lose connection to the debugger and can no longer see logs or the updated configuration in Xcode. I have to build the app again. Could this be an issue with Xcode, or is it related to MDM or the configuration itself?
2
0
60
3w
tvOS App Icon & Top Shelf Image
ISSUE: Warning: None of the input catalogs contained a matching App Icon & Top Shelf Image brand assets collection named "AppIcon" INFORMATION: So I currently have my app published and it works for iOS, and visionOS. (iPhone, iPad, Mac & Apple Vision Pro) There is one target for all OS versions. I have recently updated it to work with tvOS, however upon building I run into the warning listed at the top of this post. I have the following within the project: 'AppIcon.icon' (from the new icon composer for iOS, macOS and watchOS) And within .xcassets: 'AppIcon' (which contains the majority of the icons) 'Brand Assets' Folder (created by right click, tvOS, New tvOS App Icon and Top Shelf Image; which contains these icons in layers and the correct sizes) Brand Assets retains the names created by Xcode, App Icon - App Store, App Icon, Top Shelf Image Wide, Top Shelf Image In "General" in the target, I have AppIcon, still listed as the AppIcon name. Adding a second entry here for just tvOS does not resolve my issue, our could be that I do not what to call it so it can properly find it. QUESTION: What am I missing so that the build process detects these images properly and completes a successful build for tvOS? I am assuming I need to add options to the App Icons and Launch Screens area, but what is the name I place here for tvOS? SCREENSHOTS:
1
0
139
3w
Building macOS apps with Xcode 26 on macOS 26 VM
I'm trying to setup a macOS 26 build environment in a VM (using UTM and the virtualization framework Apple provides). I have Xcode 26 installed and have logged into my Apple ID and verified that the team and other configuration looks fine in Xcode settings. When trying to build the macOS app, I see errors saying the VM's device ID has not been registered. I have confirmed that the device ID is registered both in the Provisioning portal AND the downloaded .provisionprofiles (in Library > Developer > Xcode > UserData). This problem appears on multiple targets (e.g. the main app and extensions). If I try to manually provision the app, using the Provisioning portal, I can build the product, but it will not launch because of Gatekeeper issues. Finally, signing to run locally doesn't work either. As the app launches, frameworks refuse to load because Team IDs don't match. With ad hoc provisioning, there are no Team IDs. I've come to the conclusion that this just isn't possible. Which is a shame because I need to support products with a build environment on macOS 15 and cannot move over to macOS 26 yet. I suspect many developers outside of Apple are in a similar position.
10
7
1.2k
4d
Popping sound when running XCode simulator
Hello, im getting popping / crackling sounds from my Macbook Pro (M4 2024) speakers. This happens when you do many certain tasks like click buttons or toggling switches when xcode has a simulator open and any background audio is playing, like spotify. The speakers go crazy especially when starting the simulator in xcode with music in background. Ive tried: Using blackhole, and changing audio output in the simulator app Deleting both .plist files form preferences file. "coreaudiod" trick in terminal restarting many times different xcode versions and simulators and swift files Nothing has worked. Any help?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1
1
95
1w