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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

XLSXWriter Help
Hello, I am brand new to development in Xcode. I have created a Mac app that I need to use XLSXWriter to export a workbook and sheet. Is GitHub the only place for this download or is there an apple developer specific area to get the library? Thanks
0
0
124
Jan ’25
Deep link to a file in Xcode
Hi, is there documentation on how to write a deep link that will open Xcode on a given file, and optionally a line number? I know about xed, and I would like exactly that functionality, but in link form, so that I can link to a certain file from an app such as Obsidian or from a README.md file. I checked Xcode's Info.plist and it understands several URL schemes, the most promising of which is xcode://, which successfully launches the app, but no matter what I tried, I get an error dialog telling me that Xcode did not understand the URL. Any help on this topic would be greatly appreciated. Victor
0
0
282
Mar ’25
Download & replace app container
I used to download and replace the app container when I was testing, essentially downloading the container from the live app, and restoring it into the test app in order to not affect the live app, but to test major changes on "live" data. it seems the option for downloading and replacing in Xcode no longer works, I will sometimes get a container downloaded, other times it only part downloads. I can never seem to get it to replace. No errors, but it doesn't work on the new device. It used to be that devices & simulators showed when it was downloading and replacing but it no longer does that. Is there another way of doing this? Currently I'm having to take a backup of the live phone, restore on the test device, then delete all the unneeded apps, otherwise the restore takes ages, then backup the test device and restore every time I need to restart.
0
1
255
Nov ’24
Run on multiple simulators
I am developing a game that has 3 team members. I can manually start up 3 simulators and run the game for developing/testing but seem like there should be a simple way to click build/run and have it launch on all three automatically. Does anyone know how to do this or if its even possible without writing some scripts?
0
0
61
Mar ’25
Build input file cannot be found
Hi! When I run my project on a real device (iPhone 15 Pro), I encounter the following error: Build input file cannot be found: '/Users/Interexy/Library/Developer/Xcode/DerivedData/SinglePhotoBook-geecnphrjebsisdmhcyzlsefvphm/Build/Products/Debug-iphoneos/SinglePhotoBook.app/SinglePhotoBook'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? How can I solve this? I've already reinstalled Pods and cleaned DerivedData a million times, but the issue persists. Xcode: Version 15.4
0
0
242
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
162
Mar ’25
How to run Catalyst xctest bundle with xcrun
I'm trying to run an xctest bundle, built for catalyst, with xcrun. i.e. xcrun xctest path_to_my_test.xctest It fails, complaining that: The bundle "MyBundle" couldn't be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.....but incompatible platform (have 'MacCatalyst', need 'macOS') So it seems like because I'm not executing it in a sim it wants the bundle to be a macOS bundle. But I would have thought it would be possible to run a Mac Catalyst target directly on a macOS host the same as a native macOS test target. Is this not possible?
0
0
404
Nov ’24
Weather Authentication Failed
I'm pretty new on this platform and also developing IOS mobile apps. I've been struggling for using the data of the api weather kit apple. I have an acount of apple developer, downloaded the certificate... i follow all the necessaries steps in the portal and also in my project and i keep having this error message when i try to use it. I don't know what else should i do for having working it. I would absolutely appreciate that someone could help me with this. Thank you very much!!!!! Encountered an error when fetching weather data subset; location=<+41.38268070,+2.17702390> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/3/25, 22:54:03 Central European Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
0
0
208
Mar ’25
Moving files to local package not possible in Xcode 16?
Hi! Trying to move some code into a local package - with Xcode 16 I am unable to move my code to the new package as drag and drop will always result in a copy. This contradicts the demo in the original intro session at WWDC19, and also the current documentation.. Of course I can delete the original files but this feels somewhat wrong... Am I missing something? Did the behaviour of moving files in the Project navigator change in the recent Xcode releases?
0
0
308
Dec ’24
Build Libraries For Distribution flag usage
I want to build an ios .xcframework (for external delivery) and .framework(for internal debugging) in order to package some code to a customer for incorporation into their app. My framework has a dependency upon RealmSwift, which I've added using SPM. There is a warning saying Module RealmSwift was not compiled with library evolution support. And when building SwiftVerifyEmittedModuleInterface fails with an error saying "missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'" By default, Build Libraries For Distribution was set to YES, however if I turn it off then the warning and error go away and I can cleanly build the framework. I've been attempting to get a good understanding of this flag and if it should be used or not, most material says yes but doesn't go a good job of explaining why. However anyway I can't get the framework to build with RealmSwift as a dependency without turning off this flag. Therefore is that ok to proceed down that route? Does the fact the xcframework will only ever be distributed to one consumer affect decisions (i.e. binary compatibility etc.) Thanks
0
0
98
Mar ’25
The SwiftUI project will compile normally in xcode15.4, but will not compile in xcode16.2. The log is as follows:
SwiftCompile normal arm64 Compiling\ Checkmark.swift,\ SimpleClockView.swift,\ Constants.swift,\ CountDayHomeView.swift,\ ................ logs.txt eekfnzfsodwhcebuwavalipzmswp/Build/Intermediates.noindex/FocusPomoTimer.build/Debug-iphonesimulator/FocusPomoTimer.build/DerivedSources/IntentDefinitionGenerated/AppRunningIntents/AppRunningIntentIntent.swift /Users/wangzhenghong/Library/Developer/Xcode/DerivedData/FocusPomoTimer-eekfnzfsodwhcebuwavalipzmswp/Build/Intermediates.noindex/FocusPomoTimer.build/Debug-iphonesimulator/FocusPomoTimer.build/DerivedSources/IntentDefinitionGenerated/AppRunningIntents/AppStopIntentIntent.swift /Users/wangzhenghong/Library/Developer/Xcode/DerivedData/FocusPomoTimer-eekfnzfsodwhcebuwavalipzmswp/Build/Intermediates.noindex/FocusPomoTimer.build/Debug-iphonesimulator/FocusPomoTimer.build/DerivedSources/GeneratedAssetSymbols.swift While evaluating request TypeCheckSourceFileRequest(source_file "/Users/wangzhenghong/MyApp/NewPomoProject/FocusPomoTimer/FocusPomoTimer/Views/TimerViews/SimpleClockView.swift") While evaluating request TypeCheckFunctionBodyRequest(FocusPomoTimer.(file).SimpleClockView._@/Users/wangzhenghong/MyApp/NewPomoProject/FocusPomoTimer/FocusPomoTimer/Views/TimerViews/SimpleClockView.swift:27:25) While evaluating request PreCheckResultBuilderRequest(FocusPomoTimer.(file).SimpleClockView._@/Users/wangzhenghong/MyApp/NewPomoProject/FocusPomoTimer/FocusPomoTimer/Views/TimerViews/SimpleClockView.swift:27:25) Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 swift-frontend 0x0000000107ab2a9c llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) + 56 1 swift-frontend 0x0000000107ab0cf0 llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x0000000107ab3068 SignalHandler(int) + 292 3 libsystem_platform.dylib 0x000000019ee86de4 _sigtramp + 56 4 swift-frontend 0x0000000103d03758 swift::DiagnosticEngine::formatDiagnosticText(llvm::raw_ostream&amp;, llvm::StringRef, llvm::ArrayRefswift::DiagnosticArgument, swift::DiagnosticFormatOptions) + 432 5 swift-frontend 0x0000000103d042ac swift::DiagnosticEngine::formatDiagnosticText(llvm::raw_ostream&amp;, llvm::StringRef, llvm::ArrayRefswift::DiagnosticArgument, swift::DiagnosticFormatOptions) + 3332 6 swift-frontend 0x00000001028148d0 swift::AccumulatingFileDiagnosticConsumer::addDiagnostic(swift::SourceManager&amp;, swift::DiagnosticInfo const&amp;) + 944 7 swift-frontend 0x00000001028144e8 swift::AccumulatingFileDiagnosticConsumer::handleDiagnostic(swift::SourceManager&amp;, swift::DiagnosticInfo const&amp;) + 32 8 swift-frontend 0x0000000103d06960 swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&amp;) + 4276 9 swift-frontend 0x0000000102db4b10 swift::DiagnosticTransaction::~DiagnosticTransaction() + 184 10 swift-frontend 0x000000010350fbf0 (anonymous namespace)::PreCheckResultBuilderApplication::walkToExprPre(swift::Expr*) + 720 11 swift-frontend 0x0000000103bb9dac (anonymous namespace)::Traversal::visit(swift::Stmt*) + 2748 12 swift-frontend 0x00000001035093c8 swift::PreCheckResultBuilderRequest::evaluate(swift::Evaluator&amp;, swift::PreCheckResultBuilderDescriptor) const + 188 13 swift-frontend 0x00000001038bf294 swift::SimpleRequest&lt;swift::PreCheckResultBuilderRequest, swift::ResultBuilderBodyPreCheck (swift::PreCheckResultBuilderDescriptor), (swift::RequestFlags)2&gt;::evaluateRequest(swift::PreCheckResultBuilderRequest const&amp;, swift::Evaluator&amp;) + 36 14 swift-frontend 0x0000000103510568 swift::PreCheckResultBuilderRequest::OutputType swift::Evaluator::getResultCached&lt;swift::PreCheckResultBuilderRequest, swift::PreCheckResultBuilderRequest::OutputType swift::evaluateOrDefaultswift::PreCheckResultBuilderRequest(swift::Evaluator&amp;, swift::PreCheckResultBuilderRequest, swift::PreCheckResultBuilderRequest::OutputType)::'lambda'(), (void*)0&gt;(swift::PreCheckResultBuilderRequest const&amp;, swift::PreCheckResultBuilderRequest::OutputType swift::evaluateOrDefaultswift::PreCheckResultBuilderRequest(swift::Evaluator&amp;, swift::PreCheckResultBuilderRequest, swift::PreCheckResultBuilderRequest::OutputType)::'lambda'()) + 1256 15 swift-frontend 0x00000001035071f0 swift::TypeChecker::applyResultBuilderBodyTransform(swift::FuncDecl*, swift::Type) + 216 16 swift-frontend 0x00000001038c4d14 swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&amp;, swift::AbstractFunctionDecl*) const + 484 17 swift-frontend 0x0000000103cd5e80 swift::TypeCheckFunctionBodyRequest::OutputType swift::Evaluator::getResultUncached&lt;swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefaultswift::TypeCheckFunctionBodyRequest(swift::Evaluator&amp;, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()&gt;(swift::TypeCheckFunctionBodyRequest const&amp;, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefaultswift::TypeCheckFunctionBodyRequest(swift::Evaluator&amp;, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()) + 636 18 swift-frontend 0x0000000103c449f0 swift::AbstractFunctionDecl::getTypecheckedBody() const + 160 19 swift-frontend 0x00000001039130ec swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&amp;, swift::SourceFile*) const + 868 20 swift-frontend 0x000000010391a680 swift::TypeCheckSourceFileRequest::OutputType swift::Evaluator::getResultUncached&lt;swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefaultswift::TypeCheckSourceFileRequest(swift::Evaluator&amp;, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()&gt;(swift::TypeCheckSourceFileRequest const&amp;, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefaultswift::TypeCheckSourceFileRequest(swift::Evaluator&amp;, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()) + 620 21 swift-frontend 0x0000000103912d6c swift::performTypeChecking(swift::SourceFile&amp;) + 328 22 swift-frontend 0x000000010282fe00 swift::CompilerInstance::performSema() + 260 23 swift-frontend 0x000000010245cdf0 performCompile(swift::CompilerInstance&amp;, int&amp;, swift::FrontendObserver*) + 1532 24 swift-frontend 0x000000010245bbb4 swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 3572 25 swift-frontend 0x00000001023e2a5c swift::mainEntry(int, char const**) + 3680 26 dyld 0x000000019ead0274 start + 2840 Command SwiftCompile failed with a nonzero exit code
0
0
310
Feb ’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
223
Feb ’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
269
Feb ’25
Missing required modules when enabling Swift 6
Hi team, We're using CocoaPods in our project and we noticed the compiler fails to build certain targets saying it's "Missing required module 'x'" when trying to build them in Swift 6: We realized the modules the compiler is complaining about are pod dependencies required by the other target dependencies, and that this error will only appear when building with Swift 6 unless such dependencies are described on the Podfile as direct dependencies of the target, or we include them in the framework search paths. For example, the error in the image above will show if module 'X' import 'Y' and 'Y' imports 'CocoaLumberJack' and we don't specify a direct dependency between 'X' and 'CocoaLumberJack'. Regardless of the fact that we can manually add the missing module location to the target search paths, we'd like to understand why we're facing this issue in the first place, what changed between Swift 5 and Swift 6 that's requiring us now to explicitly describe these dependencies. I'd appreciate if someone could tell us more about this. We're particularly interested on knowing if this is an intentional change and how to handle it properly. Thanks
0
4
452
Nov ’24
Which extension use
Hi, I want to block incoming calls using my backend server, like the unwantend sms using message filter extension. I saw that Call Directory Extension can block numbers, but you need update the list, is not in real time. I was reading the Live Caller ID Look up extension documentation, and it seems that with this extension is possible send the number to backend and retrieve a value to know if the call should be block or not. Am I right? Or is not possible this feature with this extension? Thanks!
0
1
269
Mar ’25