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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

devicectl copy directory recursively
I can use devicectl to copy single files from a device fine using: xcrun devicectl --verbose device copy from --user mobile --domain-identifier <BUNDLE_ID> --domain-type appDataContainer --device <DEVICE_ID> --source Documents/Screenshots/0001.png --destination Screeshots/0001.png but when there are many files this can get pretty slow. Is there a way of recursively copying an entire directory? I've tried this: xcrun devicectl --verbose device copy from --user mobile --domain-identifier <BUNDLE_ID> --domain-type appDataContainer --device <DEVICE_ID> --source Documents/Screenshots --destination Screeshots but nothing is transferred and it times out eventually with the error: ERROR: The specified file could not be transferred. (com.apple.dt.CoreDeviceError error 7000 (0x1B58)) ERROR: The operation couldn’t be completed. The file service client failed to read data from the network socket because we timed out when waiting for data to become available. (NSPOSIXErrorDomain error 60 (0x3C)) NSLocalizedFailureReason = The file service client failed to read data from the network socket because we timed out when waiting for data to become available. Xcode itself can do it with the "download container..." option, but I'd like to be able to automate it.
0
0
76
20h
Content Blocker Disappears from Mac Safari Settings
I have had content blockers in the Mac App Store for years. Ever since moving to Sonoma, doing a clean build or archive in XCode deletes the extension from Safari settings since it never gets into the built app. The only way for me to get it back is to remove the DerivedData and target, reboot, and create a target with a different name. That works and stays around in Safari settings as long as I only build and don't clean. However, a clean or an archive removes it again. Restoring a version of the project from Time Machine that was posted to the App Store weeks or months ago doesn't work. However I can download the version of the app in the App Store, and it works, but I can't build it now from the source code that was used to build that version without going through the above process. Moving from Sonoma 14.7.1 to 14.7.2 didn't work. I would move to Sequoia if I had reason to believe that would work, but I don't. Safari 18.2, Sonoma 14.7.2, 32GB, 2.2 GHz 6-Core Intel Core i7
0
0
111
22h
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
86
23h
Previews due to SwiftData Predicates in Xcode 16.3
My preview crashes whenever I compare my model's value to a constant's stored value. I use struct constants with a stored value as alternatives to enums, (IIRC ever since the beginning) enums never worked at all with .rawValue or computed properties. This crashes when it runs on Xcode 16.3 beta and iOS 18.4 in previews. It doesn't appear to crash in simulator. @Model class Media { @Attribute(.unique) var id: UUID = UUID() @Attribute var type: MediaType init(type: MediaType) { self.type = type } static var predicate: (Predicate<Media>) { let image = MediaType.image.value let predicate = #Predicate<Media> { media in media.type.value == image } return predicate } } struct MediaType: Codable, Equatable, Hashable { static let image: MediaType = .init(value: 0) static let video: MediaType = .init(value: 1) static let audio: MediaType = .init(value: 2) var value: Int } My application crashes with "Application crashed due to fatalError in Schema.swift at line 320." KeyPath \Media.<computed 0x000000034082a33c (MediaType)>.value points to a field (<computed 0x000000034082a33c (MediaType)>) that is unknown to Media and cannot be used. This appears to also occur if I am using a generic/any func and use protocols to access a property which is a simple String, such as id or name, despite it being a stored SwiftData attribute. I filed a bug report, but looking to hear workarounds.
3
0
73
1d
Xcode 16 „forgetting“ package in subfolder to root package
Xcode 16 seems to „forget“ a swift package within a subfolder of a root package after restart or shut-down. I have the following project structure, which also resembles the directory structure on disc: MyPackage - Package.swift - README.md - Sources - MyPackage - Tests - MyPackageTests - Tools - MyGenerator // <- after restart this folder is not visible in the Xcode project navigator - Package.swift - Sources - main.swift - Tests MyGenerator is a standalone package which is used during development of MyPackage to generate source code files for MyPackage based on text file input. Essentially an executable target script which I can run within its folder with: swift run MyGenerator someInputFile.txt MyPackage does NOT use MyGenerator as a dependency, nor do I want this tool listed as a dependency in MyPackage Package.swift file. Yet MyGenerator is part of the same Git repo, as it documents the changes to the tool on how to generate source code for MyPackage. Both packages are developed in tandem. MyGenerator itself defines dependencies in its Package.swift file, which are unrelated to the functionality of MyPackage. After restart of Xcode or even just a longer shut-down period the MyGenerator subfolder is not visible in the Xcode project navigator, the /Tools folder is empty. I have to manually add the sub package via Add files to "MyPackage" -> Move files to destination every time. How can I solve that Xcode remembers the sub package unter /Tools? Edit: I am using Xcode 16.2
0
0
86
1d
ccache in xcode 16
I have a xcode project generated by unity 6 my mac: my x-code: It's a simple project but the building time lasted over 10 minutes and I found a page https://discussions.unity.com/t/optimizing-ios-and-macos-build-times-using-ccache/809570 I tried to run ccache in my mac and hope to accelerate the building. I installed ccache in my MAC by brew I made two script with +x mode I created a testc folder to verify the script and it did work. Then I opened the xcode and added CC and CXX to the “Build Settings” I triggered the building But it didn’t work, the building used the default compiler. I had repeated to ask AI about it and cleaned building cache many times, but the problem still exists. Even without any probing executing of the ccache-clang script ( I configured the log file position, so if it has been executed once, there will be some logs) Could someone help me check if there’s something wrong?
0
0
81
1d
Can't archive app due to icon error.
I'm developing a companion watch app for an already existing iOS app, and everything seems to be working fine compiling it for the simulator, however when I try to archive it so I can make it available on TestFlight XCode throws the error "The stickers icon set or app icon set named "AppIcon" did not have any applicable content" even though the app icon is in the assets. The icon works and appears fine under the Simulator but I can't seem to archive it, even after renaming it to something else.
2
0
143
3d
Debug Failed in Xcode Simulator
I can‘t use breakpoints on the simulator after updating Xcode and the simulator. I can use breakpoints on a physical iPhone. I tired to download other iOS simulator version, but still not working. Both SwiftUI and UIKit not working. Xcode version: 16.2 SDK version: 18.2 (22C146) Simulator version: 18.3.1 (22D8075) Mac OS version: 15.4 Beta Couldn't find the Objective-C runtime library in loaded images. Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
3
0
207
3d
Can't install any apps on my new iPhone 16 Pro with iOS 18 from XCode
Error message: Previous preparation error: The developer disk image could not be mounted on this device.; Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) I had no issues previously with my iPhone 13 Pro running iOS 18 and my XCode 15. Now, after switching to the iPhone 16 Pro, it won't work. I've tried restarting my phone several times, quitting XCode, removing and readding developer mode—nothing quite works.
24
29
20k
Sep ’24
Question with Message Filter Extension
Hi. I created a Message Filter Extension target to filter spam sms messages, deferring the request to my backend. The extension makes the call and send this payload: POST /server-endpoint HTTP/1.1 Accept: */* Content-Type: application/json; charset=utf-8 Content-Length: 148 { "_version": 1, "query": { "sender": "14085550001", "message": { "text": "This is a message" } }, "app": { "version": "1.1" } } My question is, is possible modify this payload to send the "receiver" number (is possible get the receiver number in this extension?), or use an identifier, to let my backend know which user number the filter was applied to. I think is impossible because the extension makes the call and create the payload, and I don't see anything in docs to add other prop, but there's other way to know the "receiver" number of the sms? Thanks:)
1
0
271
Oct ’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
0
135
2d
Error Simulator Download Simulator IOS 18.2 22C5142a
I can't install Simulator 18.2 I reinstalled sometimes Xcode y always return this erro Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2025-02-15 15:41:39 +0000"; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.appleTVOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22K5148a; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.appleTVOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } System Information macOS Version 15.2 (Build 24C101) Xcode 16.2 (23504) (Build 16C5023f) Timestamp: 2025-02-15T09:41:39-06:00
4
0
366
2w
Another provisioning issue, with Xcode 15
As of this morning, I get the following error message when trying to build on any of my Macs (including my desktop, as well as my CI/CD systems): Provisioning profile "Mac Team Provisioning Profile: com.stairwell.Inception.Forwarder" doesn't support the App Groups capability. When I check the identifier in the developer portal, it does show the "App Groups" capability, and the same group is selected as has been there before. We have to build this project with Xcode 15, because we have another issue with provisioning profiles on Xcode 16, that I haven't gotten resolved yet. To be clear - I built, notarized, and released a Developer ID build of this same project last night, and today it just fails to build. I should have never switched to "Xcode managed Profile", I guess. Manually configuring all of this was annoying, but at least it worked. I assume at this point, I'm just going to be regenerating provisioning profiles until the issue randomly goes away...
1
0
132
3d
Settings.bundle
Hello everyone, I have added a Settings.bundle to my Xcode project, but it does not appear in the iOS app settings. The file is correctly copied into the target, but nothing shows up in the settings. I have already checked and tried several things, but without success. What I've tried so far: Ensuring that Settings.bundle is included in the project: Settings.bundle is listed under Build Phases → Copy Bundle Resources. Checking the structure of Root.plist: The file exists and has the following structure: Checking the structure of Root.plist -it has Checking if the file is included in the app -it is Restarting the simulator and reinstalling the app I reset the simulator and reinstalled the app completely, but the issue persists.
3
0
143
3d