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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Broken Xcode 16 autocomplete using Tab
I've recently upgraded to Xcode 16 and noticed a change in how the Tab key functions during autocomplete. (not-replied-but-closed post: https://discussions.apple.com/thread/255762888) Previously, pressing Tab would extend the typed text up to the first point of choice. For example, we have two classes: NSViewController and NSViewCoordinator BEFORE, typing: "NSV" + Tab used to complete to NSViewCo Now, in Xcode 16, pressing Tab selects the first suggestion by default, instead of completing up to the choice point. That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually. Seems there is no way to restore the previous behavior and that looks very very sad. I have reverse engineered Xcode 16...and what I get? They just install new CodeCompletion handler instead of old one without any chance to configure this behaviour by settings or UserDefaults =\ Hope this thread would raise votes and attract Xcode devs here
0
1
309
Feb ’25
Xcode 16.3 beta: Unable to specify package traits for testing
Swift 6.1 introduces package traits, which are great. But sometimes one might want to have a trait that is not enabled by default, and in such cases you will still want to be able to unit test them. Can we get an option, perhaps in the test plan configuration, that would allow us to specify traits that should be enabled when compiling for testing, even if those traits are not enabled by default? Bonus points if we could have multiple test plans that each build with a different set of traits, and running all the tests would cause the package to be built multiple times, so that all possible combinations of traits could be properly unit tested.
0
2
338
Feb ’25
Issue with GitHub Copilot in Xcode 16 on macOS 14.6 with Netskope Enabled
Hello everyone, I am using Xcode 16 on macOS 14.6 and have integrated GitHub Copilot for Xcode. However, GitHub Copilot stops functioning when Netskope is enabled on my Mac. I have the necessary SSL certificate in my Mac’s Keychain and have trusted it. When I check, GitHub Copilot successfully connects to the server. However, I can’t find an option to set the certificate in Xcode. Since Netskope is required by my organization, I cannot disable it. Has anyone encountered this issue or know how to resolve it? Thank you in advance for your help!
0
0
310
Jan ’25
Followed docs for "Local Package", how to add to 2nd project?
I have a couple apps in one git repository. I'd like to have a Swift package in that repo as well, shared by apps. In other words, I don't want a separate repo for the Swift package. I followed the instructions here: https://developer.apple.com/documentation/xcode/organizing-your-code-with-local-packages It seems to work. I can write code like this in my app: import MyLocalPackage func foo() { myLocalPackageFunc() } I notice that the package is not listed under Project > MyApp > Package Dependencies. I don't really care, as long as I can reuse code between apps. But when I try to add this package code to a 2nd app, I'm at a loss. I tried "Add Package Dependencies" and "Add Local", but that creates a different looking setup than the 1st app. The code is browsable in the project navigator. And when I try to build it says "Missing package product 'MyLocalPackage'. The documentation linked above, which I used for the 1st app, does a "New > Package". I don't want a new package. How can I connect the existing one?
0
0
70
May ’25
NSE Filtering Entitlement Rejected Repeatedly – Seeking Advice & Possible Solutions
Hi everyone, I’m facing a major roadblock with my family location tracking app, and I need some advice or guidance from the community. Background Back in 2021, I implemented NSE filtering entitlement to send location-based notifications and retrieve the device's location in return (as suggested by Apple’s technical code support). Over time, I built my app around this entitlement, adding many features that depend on it. When Location Push Service Extension was introduced for iOS 15+, I adapted accordingly: NSE filtering was used for devices below iOS 15 Location Push Service Extension was used for iOS 15+ NSE filtering also played a crucial role in: ✅ Accepting/rejecting location-based notifications ✅ Checking device settings & location permissions (since location push won’t work without proper permissions) The Issue In November 2024, I created a new developer account to change my business entity. Since then, I’ve been requesting the NSE entitlement repeatedly for four months, but Apple keeps rejecting it. Meanwhile, they approved the Location Push Entitlement, but without NSE filtering, I’m forced to rewrite a huge part of my app’s core functionality. I’ve sent multiple emails explaining my use case, but I keep getting rejected without any clear explanation or workaround. My Ask Has anyone faced a similar issue with NSE entitlement? Are there any alternative approaches to achieve the same functionality? Any advice on how to escalate this to Apple or get proper feedback on why it's being rejected? I’ve invested years into this app, and a forced rewrite would take months. Any help, insights, or contacts who could assist would be greatly appreciated! Thanks in advance! 🙏
0
0
58
Mar ’25
Is debugging with App Data broken?
Trying to use App Data on Xcode 16.2, and failing I'm running the app with the debugger. When I run the app, I need to do a handful of things, which affects my app's cache files, and UserDefaults. What I'd like to do is store all of these settings, then have them loaded in when the app launches, so I don't need to do same, tedious work of changing settings by hand in the UI. So, I discovered that I can provide an xcappdata directory in the Run options. This seems like exactly what I'm looking for. But I can't seem to get it to work. Like, when the app runs, it looks like none of those settings are brought in. I ran the app on a device, and pulled down the application data, and then put that in the project. And you can see in the screenshot, that the value is set. So, either I'm missing something (which is totally possible) or this feature is broken. Documentation on this is not great, so maybe I'm doing something wrong. If the feature is known to be broken, I'll give up on this. But if it should work, it would be great to get some tips here.
0
0
226
Jan ’25
The behavior of the app using the Promises library changes between Xcode 15.4 and Xcode 16.2.
I’m creating code that performs asynchronous processing using the Promises library (https://github.com/google/promises). In this context, when building the app in Xcode 15.4 and Xcode 16.2, the behavior differs between the two. I’m using version 2.1.1 of the library. Also, I’ve tried using the latest version, 2.4.0, but the result was the same. Has anyone encountered the same issue or know an effective solution? Here's a simple code that reproduces this issue. @IBAction func tapButton(_: UIButton) { _ = getInfo() } func getInfo() -> Promise<Void> { Promise(on: .global(qos: .background)) { fulfill, _ in self.callApi() .then { apiResult -> Promise<ApiResult> in print("\(#function), first apiResult: \(apiResult)") return self.callApi() // #1 } .then { apiResult in print("\(#function), second apiResult: \(apiResult)") // #2 fulfill(()) } } } func callApi() -> Promise<ApiResult> { Promise(on: .global(qos: .background)) { fulfill, _ in print("\(#function), start") self.wait(3) .then { _ in let apiResult = ApiResult(message: "success") print("\(#function), end") fulfill(apiResult) } } } struct ApiResult: Codable { var message: String enum CodingKeys: String, CodingKey { case message } } The Swift Language version in the build settings is 5.0. The console output when running the above code is as follows: When built with Xcode 15.4: 2025/03/21 10:10:46.248 callApi(), start 2025/03/21 10:10:46.248 wait 3.0 sec 2025/03/21 10:10:49.515 callApi(), end 2025/03/21 10:10:49.535 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:10:49.535 callApi(), start 2025/03/21 10:10:49.536 wait 3.0 sec 2025/03/21 10:10:52.831 callApi(), end 2025/03/21 10:10:52.832 getDeviceInfo(), second apiResult: ApiResult(message: "success") The process proceeds from #1 to #2 after completing the code comment in #1. When built with Xcode 16.2: 2025/03/21 09:45:33.399 callApi(), start 2025/03/21 09:45:33.400 wait 3.0 sec 2025/03/21 09:45:36.648 callApi(), end 2025/03/21 09:45:36.666 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 09:45:36.666 callApi(), start 2025/03/21 09:45:36.666 wait 3.0 sec 2025/03/21 09:45:36.677 getDeviceInfo(), second apiResult: Pending: ApiResult 2025/03/21 09:45:39.933 callApi(), end The process does not wait for the code comment in #1 to finish and outputs the #2 print statement first. Additionally, even with Xcode 16.2, when changing the #2 line to "print("(#function), second apiResult: (apiResult.message)")", the output becomes as follows. From this, it seems that referencing the ApiResult type, which is not a String, might have some effect on the behavior. 2025/03/21 10:05:42.129 callApi(), start 2025/03/21 10:05:42.131 wait 3.0 sec 2025/03/21 10:05:45.419 callApi(), end 2025/03/21 10:05:45.437 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:05:45.437 callApi(), start 2025/03/21 10:05:45.437 wait 3.0 sec 2025/03/21 10:05:48.706 callApi(), end 2025/03/21 10:05:48.707 getDeviceInfo(), second apiResult: success Thank you in advance
0
0
155
Mar ’25
Can I use ARGeoAnchor with simulated locations
I'm trying to evaluate if we can support AR navigation with MapKit. The feature is supposed to be available for users in US. I tried to run the sample on my iPhone: https://developer.apple.com/documentation/arkit/tracking-geographic-locations-in-ar?language=objc But I'm in a location that ARGeoTrackingConfiguration.checkAvailabilityWithCompletionHandler: always return false. I think ARGeoAnchor isn't supported in my location. I tried to use simulated locations by Adding a gpx file when launching the app. Enabling Xcode -> Debug -> Simulate Location -> New York, NY, US But the availability for ARGeoAnchor is still false. Is that possible for me to develop the ARGeoAnchor feature outside of the covered areas?
0
0
75
Mar ’25
XCode 16 run Fastlane fail when called get_version_number function after convert project from groups to folders
My project is using Fastlane 2.226.0. After converted groups to folders on XCode 16, I got an error when executed below function in Fastfile: get_version_number(xcodeproj: "MyProject.xcodeproj", target: "MyProject") Below is the error message output after I ran fastlane: Unable to find XCode build setting: MARKETING_VERSION
0
0
100
Mar ’25
Xcode 16 Automatically Builds & Runs Simulator While Editing Storyboard
I’m experiencing an issue in Xcode 16 where the app randomly builds and runs in the simulator while I’m designing items in the storyboard. Here’s what I’ve tried so far to stop this behavior: Disabled "Show Live Issues" in the General settings Removed all key bindings related to Build & Run in the Key Bindings settings Checked for unintentional shortcut triggers, but nothing seems to be causing it Update XCode from 16.1 to 16.2 Delete Derived Data Despite these actions, Xcode still automatically builds and launches the simulator at unexpected times, disrupting my workflow. Is there any setting or hidden configuration that could be causing this? How can I completely prevent Xcode from running the simulator automatically while editing UI in the storyboard? Would really appreciate any guidance on this!
0
0
99
Mar ’25
Network Instability in TestFlight Builds When Using Xcode 16+
We are experiencing networking issues in our iOS application when it is built with Xcode 16 or later. Our app includes a video conferencing feature that works reliably when built with Xcode 15 or earlier — we can sustain hour-long video sessions without interruption. However, when the app is built using Xcode 16 or higher, network connections drop after 2–3 minutes during a session. This triggers an auto-reconnect, which succeeds, but the connection drops again after another 2–3 minutes. This loop continues indefinitely. Key Details: The issue only occurs in TestFlight builds. When running the app via Xcode debugger, the issue does not occur. The issue is consistently reproducible in TestFlight builds created with Xcode 16 or later. TestFlight builds created with Xcode 15 do not exhibit this issue. All the videoconferencing runs on C and C++ code What We’ve Tried: Reviewed Xcode 16+ release notes but found no relevant changes or deprecations. Verified app configuration and entitlements. Confirmed that no app-side changes occurred between the working and broken builds. Request: We’re seeking guidance on what changes in Xcode 16+ could be affecting networking behavior in release/TestFlight builds. Any insight into relevant build settings, compiler changes, or runtime behavior differences would be greatly appreciated. Thank you in advance for your assistance.
0
0
74
May ’25
Xcode 16 Build & Archive Error - SPM
Since upgrading from Xcode 15 to 16, we have been experiencing a build error during compilation. Building on Xcode 15 still works with no issues. The error happens only on the first build after a clean. Subsequent builds succeed. This is an issue because our CI process archives the project from a clean slate, and this causes it to fail every time. I will attempt to describe the issue and include information I believe is relevant in this document. The error occurs on this import line within an Objective-C file during the Scan Dependencies step of compiling. This line imports our custom Objective-C to Swift bridging header file - "Swift2Objc.h". Our custom Objective-C to Swift bridging header file is simply wrapping the project’s auto-generated Objective-C to Swift bridging header file - "KWISwift.h". The error is specific to the import of the OfflineServices Swift Package. Specifically, the OfflineServices-Swift.h file - the Swift Package’s auto-generated Objective-C to Swift bridging file. Module JRE not found - the exact error (Also included as text on the bottom of the post) JRE is a third-party library provided to us as an xcframework. It is placed directly into our Swift Package as a binary target. The xcframework itself is composed of .a file and a Headers folder which includes header files and a module.modulemap. The module.modulemap file looks like this.
0
0
185
Mar ’25
Random "<unknown>:0: warning: default will never be executed" Xcode warning
Hello! I'm experiencing a persistent SwiftCompile warning that I haven't been able to resolve for several months: <unknown>:0: warning: default will never be executed Observations: Appears randomly across different files during the build. No source location or line highlighting is provided. Persists across clean builds and project reopenings. Occurs in both Xcode Cloud and local builds. What I’ve tried: Ensuring all switch statements on enums explicitly handle every case. Removing default cases from fully covered enum switches. Refactoring optional enum handling (e.g., using if let instead of switch). None of these resolved the issue. Any guidance would be greatly appreciated! Project details: Xcode: 16.2 Swift: 6 iOS Target: 17.0+ UI: SwiftUI-only (no UIKit) Dependencies: SwiftPM
0
1
293
Mar ’25
XCFrameworks deploying .a / include to output target directory
Hello Friends, We have a strange bug that Xcode is deploying static binaries from within .XCFramework into the CONFIGURATION_BUILD_DIR An example of our xcframeworks structure is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>AvailableLibraries</key> <array> <dict> <key>BinaryPath</key> <string>libglfw3.a</string> <key>HeadersPath</key> <string>Headers</string> <key>LibraryIdentifier</key> <string>macos-arm64_x86_64</string> <key>LibraryPath</key> <string>libglfw3.a</string> <key>SupportedArchitectures</key> <array> <string>arm64</string> <string>x86_64</string> </array> <key>SupportedPlatform</key> <string>macos</string> </dict> </array> <key>CFBundlePackageType</key> <string>XFWK</string> <key>XCFrameworkFormatVersion</key> <string>1.0</string> </dict> </plist> for open source creative coding toolkit https://github.com/openframeworks/openFrameworks Can you see any issues in the above. Some ideas for me is to generate xcarchive instead of deploying the .a in the xcframeworks, however that does not explain the include being packaged there, so I think this might be a Xcode issue
0
0
171
Mar ’25
Issue with Module Import and Archiving a Mixed Swift/C Library Using Swift Package Manager
Hello everyone, I’m encountering an issue when trying to build and archive my library BleeckerCodesLib using Swift Package Manager. My project is structured with two targets: CBleeckerLib: A C target that contains my image processing code (C source files and public headers). BleeckerCodesLib: A Swift target that depends on CBleeckerLib and performs an import CBleeckerLib. Below is the relevant portion of my Package.swift: // swift-tools-version:5.7 import PackageDescription let package = Package( name: "BleeckerCodesLib", platforms: [.iOS(.v16)], products: [ .library(name: "BleeckerCodesLib", targets: ["BleeckerCodesLib"]) ], targets: [ .target( name: "CBleeckerLib", publicHeadersPath: "include" ), .target( name: "BleeckerCodesLib", dependencies: ["CBleeckerLib"] ) ] ) Directory Structure My project directory looks like this: BleeckerCodesLib/ ├── BleeckerCodesLib.xcodeproj/ │ └── xcuserdata/ │ └── robertopitarch.xcuserdatad/ │ └── xcschemes/ │ └── xcschememanagement.plist ├── BleeckerCodesLib.h ├── Package.swift └── Sources/ ├── CBleeckerLib/ │ ├── bleecker-lib.c │ └── include/ │ ├── bleecker-lib.h │ └── CBleeckerLib.h └── BleeckerCodesLib/ ├── UIImage+Extensions.swift ├── ImageProcessingUtility.swift ├── APIManager.swift ├── BleeckerCodesLib.swift ├── CameraView.swift ├── RealTimeCameraView.swift └── BleeckerCameraWrapper.swift Code Example In my Swift code (for example, in BleeckerCodesLib.swift), I import the C module as follows: import SwiftUI import UIKit import CBleeckerLib // Import the C module public struct BleeckerCodes { public struct DetectedCode { public let code: String public let corners: [CGPoint] public init(code: String, corners: [CGPoint]) { self.code = code self.corners = corners } } // Initialization function public static func initializeLibrary() -> String { bleecker_init() // Call the C module function return "BleeckerCodesLibrary initialized!" } // ... other functions } The Problem When I try to compile or archive the project using commands such as: xcodebuild archive -project BleeckerCodesLib.xcodeproj -scheme BleeckerCodesLib -destination "generic/platform=iOS" -archivePath "archives/BleeckerCodesLib" I receive the error: "no such module 'CBleeckerLib'" Any assistance or step-by-step guidance on resolving this integration issue would be greatly appreciated. Thank you in advance!
0
0
242
Feb ’25
Firebase Phone Auth OTP not working on TestFlight
Hi, I'm working in unity and I've implemented Firebase Phone Number Authentication in it. Everything works fine when I directly install build from xCode. App Attest screen shows up, user receives OTP on their phone and login works. But when I download the same build from TestFlight, it gets stuck after the user sends OTP request. I've added Push Notifications and App Attest in capabilities. I've also additionally added Remote Notifications. In device log I see an error about mobile provisioning file but I've added that to my account also. Is this expected behavior that phone number authentication does not work on TestFlight? If yes, how can I get this approved from apple since they need to test it before approving it. Thanks!
0
0
223
Feb ’25
Xcode - Command "Find Selected Symbol in Workspace" gives no result
Example: I have a state var curHighScore declared in ContentView. I select it, right click and select "Find Selected Symbol in Workspace" The result is : 1 resul in 1 file, i.e. the line of declaration of the var But obviously, the same var is used at line #102: How come this occurence is not found by the search command. Such happens every now and then. Is there something I am missing ? What is causing this ? Thanks for your help.
0
1
224
Feb ’25