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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Updated Deeplink is not working
Hello, We are facing deeplink related issue for our production app. In our finding, we got to know that issue is related to apple CDN caching, We have did the changes at our server level but still it is navigating to previous URL. Earlier deeplink was "https://bobcard.bobfinancial.com/dl" now it is changed to "https://linkdeep.bobcard.co.in/mapp". Please check and update this new one in apple cdn cache. For the new link it is redirecting to App store instead of App. Below are the link through which we have tested deeplink scenario: "https://app-site-association.cdn-apple.com/a/v1/bobcard.bobfinancial.com" working fine. "https://app-site-association.cdn-apple.com/a/v1/linkdeep.bobcard.co.in" it is throwing not found error.
1
0
83
Apr ’25
Xcode 16 simulator slow to load - unusable
I'm on version 16 of simulator and Xcode. Last Friday, starting the simulator would take 10 seconds at the most. Now, it takes at least 10 minutes. My app target is the same and nothing in my app itself has changed. There's no new software installed and it has plenty of RAM and disk. When I target my phone, it is instant. So I'm testing / debugging everything on my phone now. When I use the simulator, the initial load is about 10 minutes, then it's fine (using the app itself). But something is causing it to hang when loading. And like I said - last week it was fine. If it was slow when running on my phone, I'd think it was something with me/the app. But it's not. This is the only messages I get in the system log. Feb 24 12:54:46 MacBookAir bootlog[0]: BOOT_TIME 1740423286 329039 Feb 24 13:06:42 MacBookAir syslogd[2095]: Configuration Notice: ASL Module "com.apple.contacts.ContactsAutocomplete" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Feb 24 15:10:13 MacBookAir syslogd[8045]: --- syslogd restarted --- Feb 24 15:10:13 MacBookAir syslogd[8045]: Configuration Notice: ASL Module "com.apple.contacts.ContactsAutocomplete" claims selected messages. Those messages may not appear in standard system log files or in the ASL database.
2
0
441
Mar ’25
Xcode file liveness regression?
A while ago, perhaps early in v16, Xcode stopped tracking file liveness. I'd hoped the regression would be fixed, but... not yet. Is there some setting I'm missing? Is this from underlying filesystem limits? or from working with swift packages? Conversely, if/since this is a regression, is this the new normal, and not to be fixed (e.g., because the modern build system cannot be retrofitted to detect and update stale resources)? Assuming I create a Swift package and open it in Xcode... 1. New files I expect to get errors when I create a new swift file, add bad code, and build. Instead, the file doesn't seem to be added to the build. If I try to use Add Files to "{project}".. menu, the file is disabled for selection. A workaround is to close and re-open the project 2. Files updated extrinsically If outside Xcode I format the files in the package or edit them, I expect Xcode to notice and either 1) update with the new contents if there were no changes, or 2) ask what to do if there were changes. Instead, Xcode proceeds oblivious to the underlying changes. It is not a workaround to use Integrate/Refresh file status menu for SCM status. Again, a workaround is to close and re-open the project. Possible factors Swift package projects, if resource tracking is tied to metadata unused in package projects? External filesystem: these are on APFS volumes mounted via TB-4 and USB-3 Pilot error? Impact This leads me to re-open projects 10's of times a day, to create test files or maintain lint. Also, because I have to drop out of Xcode to process files before checking in, I end up using an external git workflow/UI. Also, because Xcode is not particularly extensible, I've written external tools for analyzing and generating Swift, hosted via CLI or eclipse (which support resource markers for UI navigation). I use Swift LSP in Eclipse for analysis and git-driven changes, and end up coding there because well, I'm already there. I'd take slower builds over this continuous hassle and context-switching in a heartbeat.
1
0
254
Feb ’25
Help! Golang os.Executable() panic on Xcode16 for iOS app
I have a iOS app using a gobind xcframework library. All went well when using Xcode 15.0 (15A240d), but failed on Xcode 16.2 (16C5032a). It’s confirmed the failure is from only Xcode version difference, all others like source code, lib binary, physical test iPhone all keeping the exact same. After digging, the root comes from golang os.Executable() call (https://pkg.go.dev/os#Executable), which is used in xcframework library. Using Xcode 15.0, os.Executable() returns “/var/containers/Bundle/Application/E80602C7-EFFB-4F1B-9FF8-FBA0E7E3DA76/Runner.app/Runner” as normal. But with Xcode 16.2, os.Executable() panic with err “cannot find executable path”. I’ve checked Xcode&SDK version change history, couldn’t find any clue like relevant permissions restrictions stuff. Could someone please share a hint? Thanks .
2
0
296
Mar ’25
SwiftUI Preview Fails to Load While Project Builds and Runs Fine: Alamofire Module Map Issue
I'm having an issue specifically with SwiftUI previews in my iOS project. The project builds and runs fine on devices and simulators (in Rosetta mode), but SwiftUI previews fail to load in both Rosetta and native arm64 simulator environments. The main error in the preview is related to the Alamofire dependency in my SiriKit Intents extension: Module map file '[DerivedData path]/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.modulemap' not found This error repeats for multiple Swift files within my SiriKit Intents extension. Additionally, I'm seeing: Cannot load underlying module for 'Alamofire Environment Xcode version: 16.2 macOS version: Sonoma 14.7 Swift version: 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) Dependency management: CocoaPods Alamofire version: 5.8 My project is a large, older codebase that contains a mix of UIKit, Objective-C and Swift Architecture Issue: The project only builds successfully in Rosetta mode for simulators. SwiftUI previews are failing in both Rosetta and native arm64 environments. This suggests there may be a fundamental issue with how the preview system interacts with the project's architecture configuration. What I've Tried I've attempted several solutions without success: Cleaning the build folder (⇧⌘K and Option+⇧⌘K) Deleting derived data Reinstalling dependencies Restarting Xcode Removing and re-adding Alamofire
1
0
150
Mar ’25
NWPathMonitor : Lost connection to the debugger
I tried to monitor the device's network status with Network framework code below. let networkMonitor = NWPathMonitor(requiredInterfaceType: .cellular) networkMonitor.pathUpdateHandler = { [weak self] path in     if path.status == .satisfied {         print("Cellular Satisfied")     } else {         print("Cellular Unsatisfied")     } } When I run the app in my iPhone(iOS 15.5) and turn cellular on/off, iPhone suddenly loses connection with XCode. Lost connection to the debugger on “...'s iPhone”. Domain: IDEDebugSessionErrorDomain Code: 12 Recovery Suggestion: Restore the connection to “...'s iPhone” and run “...” again, or if “...” is still running, you can attach to it by selecting Debug > Attach to Process > .... User Info: {     DVTErrorCreationDateKey = "2022-06-23 02:16:30 +0000";     IDERunOperationFailingWorker = DBGLLDBLauncher; } Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {     "device_model" = "iPhone13,2";     "device_osBuild" = "15.5 (19F77)";     "device_platform" = "com.apple.platform.iphoneos";     "launchSession_schemeCommand" = Run;     "launchSession_state" = 2;     "launchSession_targetArch" = arm64;     "operation_duration_ms" = 5861;     "operation_errorCode" = 12;     "operation_errorDomain" = IDEDebugSessionErrorDomain;     "operation_errorWorker" = DBGLLDBLauncher;     "operation_name" = IDEiPhoneRunOperationWorkerGroup;     "param_consoleMode" = 0;     "param_debugger_attachToExtensions" = 0;     "param_debugger_attachToXPC" = 1;     "param_debugger_type" = 5;     "param_destination_isProxy" = 0;     "param_destination_platform" = "com.apple.platform.iphoneos";     "param_diag_MainThreadChecker_stopOnIssue" = 0;     "param_diag_MallocStackLogging_enableDuringAttach" = 0;     "param_diag_MallocStackLogging_enableForXPC" = 1;     "param_diag_allowLocationSimulation" = 1;     "param_diag_gpu_frameCapture_enable" = 0;     "param_diag_gpu_shaderValidation_enable" = 0;     "param_diag_gpu_validation_enable" = 0;     "param_diag_memoryGraphOnResourceException" = 0;     "param_diag_queueDebugging_enable" = 1;     "param_diag_runtimeProfile_generate" = 0;     "param_diag_sanitizer_asan_enable" = 0;     "param_diag_sanitizer_tsan_enable" = 0;     "param_diag_sanitizer_tsan_stopOnIssue" = 0;     "param_diag_sanitizer_ubsan_stopOnIssue" = 0;     "param_diag_showNonLocalizedStrings" = 0;     "param_diag_viewDebugging_enabled" = 1;     "param_diag_viewDebugging_insertDylibOnLaunch" = 1;     "param_install_style" = 0;     "param_launcher_UID" = 2;     "param_launcher_allowDeviceSensorReplayData" = 0;     "param_launcher_kind" = 0;     "param_launcher_style" = 0;     "param_launcher_substyle" = 0;     "param_runnable_appExtensionHostRunMode" = 0;     "param_runnable_productType" = "com.apple.product-type.application";     "param_runnable_swiftVersion" = "5.6";     "param_runnable_type" = 2;     "param_testing_launchedForTesting" = 0;     "param_testing_suppressSimulatorApp" = 0;     "param_testing_usingCLI" = 0;     "sdk_canonicalName" = "iphoneos15.4";     "sdk_osVersion" = "15.4";     "sdk_variant" = iphoneos; } In my opinion, it seems like an error of XCode. Plz let me know if there's any solution. Also, there's a similar issue here : https://developer.apple.com/forums/thread/681459
7
0
1.4k
Feb ’25
Xcode crash reports from TestFlight
My application is in flightTest mode. I received my first two crash reports in XCODE /Organizer. The context is well described, and I was able to isolate the locations where very serious errors occurred. My application is connected. I'm missing one piece of data in this crash report: the time of the crash. This will help me see what (in my case) static data was being read on the data server at that time. This will help me investigate. Is it possible to obtain this information?
0
0
91
Mar ’25
I have a bone to pick with Xcode
Despite Xcode being the one and most used IDE for iOS, it is far from perfect. I have used many tools in my career and here are some features, that would make it much better or what I miss from other IDEs. I encourage others to chip in discussion and lets all hope, Apple starts to improve Xcode. Will put each issue in separate comment below. Slow debugger: not sure what bloat Xcode has or what it is doing, but sometimes it can take more than 10 seconds from breakpoint firing to actually see values. Moreover when debugging SwiftUI or something objC I have to drill down to see value of property or use po and p command and hope it works. SwiftUI views and states are a big pain to debug, to see what is changing a value I have to always use didSet trick or some other black magic. Is it too hard to make it easier? Breakpoints with condition can take up to 1 minute to load and I have M1 Max MBP. Just tried cursor IDE few days ago and breakpoints are much faster and without too much bloat in variable inspector.
7
0
361
Feb ’25
Is Image rendering allowed inside ActivityReportExtension
Versions XCode version: 16.2 iOS version: 17.0 Background I am trying to generate a QR code inside the ActivityReportExtention which encoded the FamilyActivitySelection information. The code is roughly: Question Can I create Image inside the ActivityReportExtension? I cannot even render a simple image (not QR code) inside the extension. How can I debug inside the extension? Logs of the extension are not shown in the console. Code A function to generate QR Code import CoreImage import UIKit func generateQRCode(from string: String) -> UIImage? { let data = string.data(using: .ascii) guard let filter = CIFilter(name: "CIQRCodeGenerator") else { return nil } filter.setValue(data, forKey: "inputMessage") filter.setValue("Q", forKey: "inputCorrectionLevel") // Q for medium quality guard let outputImage = filter.outputImage else { return nil } // Scale the QR code image so it looks clear on screen let transform = CGAffineTransform(scaleX: 10, y: 10) let scaledImage = outputImage.transformed(by: transform) // Create a CIContext and generate a CGImage from the CIImage let context = CIContext() if let cgImage = context.createCGImage(scaledImage, from: scaledImage.extent) { return UIImage(cgImage: cgImage) } else { return nil } } Inside ActivityReportExtension sandbox: struct LineChartView: View { var body: some View { VStack { if let qrImage = generateQRCode2(from: "this is a test") { Image(uiImage: qrImage) .resizable() .scaledToFit() .frame(width: 200, height: 200) } else { Text("QR Code generation failed") } } } }
4
0
259
Mar ’25
How to make RealityKit both parent and child entities accessible to UI tests?
I have a SwiftUI RealityKit app, and I am writing UI tests for it. The app has entities that have children. All entities have an accessibilityComponent so that they can be found by UI tests. If I set isAccessibilityElement = true for the parent, the UI tests find the parent. If I set isAccessibilityElement = false for the parent, and isAccessibilityElement = true for the child, the UI tests find the child. If I set isAccessibilityElement = true for the parent as well as for the child, the UI tests find only the parent. How can I make parent and child entities both be accessible by the UI tests?
0
0
285
Feb ’25
Rare EXC_BAD_ACCESS (SIGBUS) KERN_PROTECTION_FAILURE crash when running function?
The following function could run several hundred times with no problem but will occasionally cause a EXC_BAD_ACCESS (SIGBUS). The last time it was a KERN_PROTECTION_FAILURE perhaps meaning it is trying to write to a read only memory but previously it was KERN_INVALID_ADDRESS. I have tried debugging tools to no avail. Can anyone see any reason why the following function could be causing this. Just in case the function is a red herring the only other thing that was running is a AVQueuePlayer that contains 11 tracks, but the crash happens mid song making it unlikely. The function includes running other functions so below is all related functions that happen as a result of a swipe gesture. func completeLeft() { let add1 = Int(tiles[Square - (squares2move + 2)].name ?? "0") ?? 0 let add2 = Int(currentNode.name ?? "0") ?? 0 let add = add1 + add2 if add.isMultiple(of: 9) == false { if squares2move == 0 { self.moveinprogress = 0 return } moveLeft1() } if add.isMultiple(of: 9) { squares2move += 1 moveLeft2() } func moveLeft1() { var duration = TimeInterval(0.1) duration = Double(squares2move) * duration self.soundEffect = "swipe" self.playEffects(Volume: self.effectsVolume) let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration) currentNode.run(move, completion: { self.tiles[Square - (squares2move + 1)].name = self.currentNode.name self.tiles[Square - 1].name = "" self.currentNode.position = self.positions[Square - (squares2move + 1)] self.newNumber() }) } func moveLeft2() { var duration = TimeInterval(0.1) duration = Double(squares2move) * duration self.soundEffect = "swipe" self.playEffects(Volume: self.effectsVolume) let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration) currentNode.zPosition = currentNode.zPosition - 1 currentNode.run(move, completion: { self.currentNode.position = self.positions[Square - (squares2move + 1)] self.tiles[Square - 1].name = "" self.currentNode.name = "\(add)" self.tiles[Square - (squares2move + 1)].name = "\(add)" if add > self.score { self.score = add } if add > self.currentgoal { self.levelComplete()} else { self.playEffects2(soundEffect: "Tink", Volume: self.effectsVolume, Type: "caf")} if self.currentNode.childNode(withName: "Label") == nil { self.currentNode.texture = SKTexture(imageNamed: "0.png") let Label = SKLabelNode(fontNamed: "CHALKBOARDSE-BOLD") Label.text = "\(add)" Label.name = "Label" let numberofdigits = Label.text!.count if numberofdigits == 1 { Label.fontSize = 45 * self.hR} if numberofdigits == 2 { Label.fontSize = 40 * self.hR} if numberofdigits == 3 { Label.fontSize = 32 * self.hR} if numberofdigits == 4 { Label.fontSize = 25 * self.hR} Label.horizontalAlignmentMode = .center Label.verticalAlignmentMode = .center Label.fontColor = .systemBlue Label.zPosition = 2 self.currentNode.addChild(Label) self.currentNode.zPosition = self.currentNode.zPosition + 1 var nodes = self.nodes(at: self.positions[Square - (squares2move + 1)]) nodes = nodes.filter { $0.name != "Tile" } nodes = nodes.filter { $0 != self.currentNode } nodes = nodes.filter { $0 != self.currentNode.childNode(withName: "Label") } for v in nodes { v.removeFromParent()} } else { let Lbl = self.currentNode.childNode(withName: "Label") as? SKLabelNode Lbl!.text = "\(add)" let numberofdigits = Lbl!.text!.count if numberofdigits == 1 { Lbl!.fontSize = 45 * self.hR} if numberofdigits == 2 { Lbl!.fontSize = 40 * self.hR} if numberofdigits == 3 { Lbl!.fontSize = 32 * self.hR} if numberofdigits == 4 { Lbl!.fontSize = 25 * self.hR} self.currentNode.zPosition = self.currentNode.zPosition + 1 var nodes = self.nodes(at: self.positions[Square - (squares2move + 1)]) nodes = nodes.filter { $0.name != "Tile" } nodes = nodes.filter { $0 != self.currentNode } nodes = nodes.filter { $0 != self.currentNode.childNode(withName: "Label") } for v in nodes { v.removeFromParent()} } self.moveinprogress = 0 }) } } func moveLeft() { var duration = TimeInterval(0.1) duration = Double(squares2move) * duration self.soundEffect = "swipe" self.playEffects(Volume: self.effectsVolume) let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration) currentNode.run(move, completion: { self.tiles[Square - (squares2move + 1)].name = self.currentNode.name self.tiles[Square - 1].name = "" self.currentNode.position = self.positions[Square - (squares2move + 1)] self.newNumber() }) }
0
0
212
Mar ’25
Error Missing required module 'RxCocoaRuntime' in xcframeworks
Hi. I have a xcframework that has a dependency on 'RxSwift' and 'RxCocoa'. I deployed it using SPM by embedding it in a Swift Package. However when I import swift package into another project, I keep getting the following error: "Missing required module 'RxCocoaRuntime" How can I fix this? Below are the steps to reproduce the error. Steps Create Xcode proejct, make a dependency on 'RxSwift' and 'RxCocoa' (no matter doing it through tuist or cocoapods) Create XCFramework from that proejct. (I used commands below) xcodebuild archive \ -workspace SimpleFramework.xcworkspace \ -scheme "SimpleFramework" \ -destination "generic/platform=iOS" \ -archivePath "./SimpleFramework-iphoneos.xcarchive" \ -sdk iphoneos \ SKIP_INSTALL=NO \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES xcodebuild archive \ -workspace SimpleFramework.xcworkspace \ -scheme "SimpleFramework" \ -archivePath "./SimpleFramework-iphonesimulator.xcarchive" \ -sdk "iphonesimulator" \ SKIP_INSTALL=NO \ BUILD_LIBRARY_FOR_DISTRIBUTION=YES xcodebuild -create-xcframework \ -framework "./SimpleFramework-iphoneos.xcarchive/Products/Library/Frameworks/SimpleFramework.framework" \ -framework "./SimpleFramework-iphonesimulator.xcarchive/Products/Library/Frameworks/SimpleFramework.framework" \ -output "./SimpleFramework.xcframework" Embed in Swift Package, and deploy. // swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "SimplePackage", platforms: [.iOS(.v16)], products: [ .library( name: "SimplePackage", targets: ["SimplePackage"]), ], dependencies: [ .package(url: "https://github.com/ReactiveX/RxSwift", from: "6.8.0") ], targets: [ .binaryTarget( name: "SimpleFramework", path: "Sources/SimpleFramework.xcframework" ), .target( name: "SimplePackage", dependencies: [ "SimpleFramework", "RxSwift", .product(name: "RxCocoa", package: "RxSwift") ] ) ] ) Download Swift Package in another project and import module. I resolved this by removing dependencies from the Swift Package, downloading package in another project, and fetching dependencies by cocoapods. Thist works, but I don't want to use another dependency manager while using SPM. Development Environment CPU : Apple M4 Max MacOS : Sequoia 15.3 Xcode : 16.2
0
0
272
Mar ’25
Are umbrella frameworks possible/discouraged?
I want to release a Framework F, containing several other frameworks (such as Realm, Appetitive, Cocoalumberjack, PhoneNumberKit) for use by app A. According to this article: https://medium.com/@bittudavis/how-to-create-an-umbrella-framework-in-swift-ca964d0a2345 They write, without referencing a source: "Although Apple discourage creating umbrella framework". Is that true, do Apple discourage umbrella frameworks, if so why and is it a very strong discourage or a mild one? If not discouraged, then how can this be achieved with Xcode 16? I've been attempting to follow a few tutorial to achieve this, such as https://medium.com/john-lewis-software-engineering/adding-a-third-party-framework-inside-a-first-party-framework-in-xcode-3ba58cfd08da however so far without any success. This last article mentions the Link Binary With Libraries section, which doesn't exist in Xcode 16. There's the Frameworks, Libraries, and Embedded Content section where I have been attempting to add the frameworks into my Framework F (choosing Embed without Signing). I'm able to successfully build Framework F, but when app A attempts to use it (adding F to the Frameworks, Libraries, and Embedded Content section with option embed and sign, or embed and don't sign, makes no difference) then I get run time errors about the umbrellaed frameworks not being able to be found.
3
0
805
Mar ’25
CoreBluetooth Scan not working when OS upgraded to 18.3.1
Hi, I currently have an app that connect to an arduno via CoreBluetooth. However, the app no longer discovers the arduino when the operating system was upgraded to iOS 18.3.1, however on iOS version 17.6.1 the ardiuno was discoverable I was able to test this theory on two different phones each with different iOS versions. Why are my peripherals no longer being discovered with this update? and what is the solution?
0
0
218
Mar ’25