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

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

Xcode Metal geometry inspector uses wrong NDC space?
When inspecting the geometry in Xcode's metal debugger, I noticed that the shown "frustrum box" didn't make sense. Since Metal uses depth range 0,1 in NDC space, I would expect a vertex that is projected to z:0 to be on the front clipping plane of the frustrum shown in the geometry inspector. This is however not the case. A vertex with ndc z:0 is shown halfway inside the frustrum. Vertices with ndc z less than 0 are correctly culled during rendering, while the geometry inspector's frustrum shows that the vertex is stil inside the frustrum. The image shows vertices that are visually in the middle of the frustrum on z axis, but at the same time the out position shows that they are projected to z:0. How is this possible, unless there's a bug in the geometry inspector?
1
0
500
Feb ’25
Xcode 16.2 cannot sign developer app (AppKit) after upgraded to macOS 15.3
After I upgraded to macOS 15.3, all of my current Xcode project have the signing issue, I spent half day and I didn't make any progress, I tried two projects, one is Swift AppKit App calling one C++ dylib, another one is a pure Swift AppKit app, when I build, there will be error: Warning: unable to build chain to self-signed root for signer "Apple Development: Steven Tang (XXXXX)" /Volumes/TwoTSSD/steventang/Library/Developer/Xcode/DerivedData/ImageEnhancement-ddbilgyraofrdyfeljyuknusunza/Build/Products/Release/ImageEnhancement.app: errSecInternalComponent I tried remove account, add account back in Xcode, none of it worked, also tried ChatGPT's WWDR updating and it won't help.
7
1
1.2k
Feb ’25
How to refresh local Swift Package after adding files in Xcode 16?
Since upgrading to Xcode 16, I've noticed that when I add new files to my local Swift packages, the "Update Package" option is no longer available when I right-click on my local package. In previous versions of Xcode, I used this feature to make Xcode recognize newly added files without any issues. Now, with Xcode 16, the only way I've found to get Xcode to recognize new files is to remove and re-add the entire package, which is obviously not ideal. I've tried cleaning the build folder and rebuilding the project, but it doesn't seem to help. Is there a new workflow or method in Xcode 16 to refresh or update local Swift packages without needing to remove and re-add them every time? Any suggestions or workarounds would be greatly appreciated! What I’ve tried so far: Cleaning and rebuilding the project Looking for any options under "File > Packages" menu Environment: Xcode 16 Local Swift Package Thanks in advance!
4
3
1.3k
Feb ’25
Xcode crash when recording UI test
I'm trying to use Xcode UI tests for the first time. I added a UI Tests target and set up the signing, then opened the default AppnameUITests.swift file. I added a new function named testAboutPage(), clicked inside the block and clicked the Record UI Test button (red circle) at the bottom of the editor window. If the app is already running when I do this, Xcode crashes immediately. If the app is not running, Xcode builds and runs the app, then crashes. I've seen reports of this going back years, but none of the posts have a solution. I do have a crash log to share. Does anyone know how to get past this? This forum won't let me upload the complete crash log because it exceeds the size limit, but here's the first part through the stack trace of the crashed thread: Process: Xcode [46652] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 16.2 (23507) Build Info: IDEApplication-23507000000000000~2 (16C5032a) App Item ID: 497799835 App External ID: 870964517 Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 503 Date/Time: 2025-02-04 12:58:05.5200 -0800 OS Version: macOS 15.3 (24D60) Report Version: 12 Anonymous UUID: 144B0B99-8D44-736B-0D9A-1F6FA6DF85F7 Time Awake Since Boot: 48000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [46652] Application Specific Information: abort() called Application Specific Signatures: ((result)) != nil Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18a3b3720 __pthread_kill + 8 1 libsystem_pthread.dylib 0x18a3ebf70 pthread_kill + 288 2 libsystem_c.dylib 0x18a2f8908 abort + 128 3 IDEKit 0x109e81554 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 964 4 IDEKit 0x109e819e4 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 876 5 DVTFoundation 0x10600d358 _DVTAssertionHandler + 424 6 DVTFoundation 0x10600d4d8 _DVTAssertionFailureHandler + 196 7 IDEKit 0x10a1f99e4 -[IDEUIRecordingManager _workspaceTabController] + 176 8 IDEKit 0x10a1fa528 __94-[IDEUIRecordingManager _startRecordingWithLaunchSession:alwaysAskForAPIAccess:reservedNames:]_block_invoke_3 + 252 9 DVTFoundation 0x10611fc9c __DVT_CALLING_CLIENT_BLOCK__ + 16 10 DVTFoundation 0x1061206c4 __DVTDispatchAsync_block_invoke + 152 11 libdispatch.dylib 0x18a237854 _dispatch_call_block_and_release + 32 12 libdispatch.dylib 0x18a2395b4 _dispatch_client_callout + 20 13 libdispatch.dylib 0x18a248040 _dispatch_main_queue_drain + 984 14 libdispatch.dylib 0x18a247c58 _dispatch_main_queue_callback_4CF + 44 15 CoreFoundation 0x18a5139d0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 16 CoreFoundation 0x18a4d35bc __CFRunLoopRun + 1996 17 CoreFoundation 0x18a4d2734 CFRunLoopRunSpecific + 588 18 HIToolbox 0x195a41530 RunCurrentEventLoopInMode + 292 19 HIToolbox 0x195a47348 ReceiveNextEventCommon + 676 20 HIToolbox 0x195a47508 _BlockUntilNextEventMatchingListInModeWithFilter + 76 21 AppKit 0x18e04a848 _DPSNextEvent + 660 22 AppKit 0x18e9b0c24 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 23 AppKit 0x18e03d874 -[NSApplication run] + 480 24 IDEKit 0x109e50f14 -[IDEApplication run] + 192 25 AppKit 0x18e014068 NSApplicationMain + 888 26 dyld 0x18a06c274 start + 2840
1
0
456
Feb ’25
FYI: Xcode and Disk Space
I discovered a disk space issue with Xcode on my 1TB hard disk. Xcode doesn’t delete old or unused Simulators, causing them to mix and consume valuable space. Deleting them from the Window > Devices & Simulators menu didn’t work, so I used Disk Utility to find and delete them. However, they persisted. To regain disk space, I completely removed Xcode and the Developer Folder. After reinstalling Xcode, I regained about 80% of my disk space. Despite unmounting the Simulators, they remained. For those unable or unwilling to do this, the Mac App Store offers DevCleaner, a utility that removes old Xcode Cache and Simulators. Thanks. I hope I've helped someone else. Dan Uff
3
0
444
Feb ’25
There is no longer a Frameworks and Libraries section for App Extensions with Xcode 16
I've got an existing app which is using some 3rd party xcframeworks within its app extensions (for example within a Notification Service Extension). Within the target for the app extensions there is a Frameworks and Libraries section where the xcframework was dragged and dropped into. However now I want to create a new project and do a similar thing, within the app's target there is a Frameworks and Libraries section, but when an app extension target is created, Xcode is not adding a Frameworks and Libraries section. There is a Link Library with Binary section, however this doesn't have an embed section (where you can select to embed, don't embed, embed without signing etc.) and I get build error trying to drag and drop the xcframework in here. Where id the Framewoks and Libraries section go for app extensions for projects created with Xcode 16? How can this section be added?
1
0
275
Feb ’25
About compiling code on another Apple Silicon Mac.
Hello everyone, I currently have a M1 Pro MacBook Pro (16gb) and a M1 Mac Mini (8gb), and I was searching a way to use the computing power of the Mac Mini to build my projects, even being a less powered machine, I think it can help since it will be doing just one thing. I wanted to normally write code on the MacBook, but instead of building it locally (including the previews), it will be done on the Mac Mini via network connection or even Thunderbolt Bridge (if possible). On a past Apple event (Oct. 30, 2018), was said that it was possible (31:00), but I was not able to find any kind of documentation or guidance on that. Event Video: https://youtu.be/bfHEnw6Rm-4?si=6wyoCLnWyyqG3Qm6
1
1
186
Feb ’25
Command line name "app-store" is deprecated. Use "app-store-connect" instead.
Hi, I've noticed a warning during export archive phase (xcrun xcodebuild -exportArchive) in our iOS CI/CD pipelines. Updating the export options info plist file to use <key>method</key> <string>app-store-connect</string> helps, but I am not sure if we should update it or not since I cannot find any references about this change in the docs. It'd be very helpful to get some guidelines. Thank you
1
0
1.2k
Feb ’25
Swift playgrounds and display orientation swift student challenge submission
I was developing my app on Xcode and I saw in requirements it says “your submission must be an app playground (.swiftpm) I reckon I can develop in Xcode and then copy those files in playgrounds app, make some changes, for it to work. also I made my project in landscape mode in Xcode, in playgrounds can I lock display orientation through package.swift file or I should continue making me app in landscape mode and ask players to change their viewing orientation via a popup?
2
1
363
Feb ’25
Xcode quit working
When I try to open Xcode, it tries to open the previous windows and load up the project I was last working on, but I can’t create a new project without opening Xcode, and I can’t do that; it just quits and gives me an Xcode quit unexpectedly, and it still happens when I download earlier versions of Xcode from the Apple developer website and the latest from the App Store, and I even when in Finder and tried to open my project that way, and it just does the same thing. I have tried everything, and I mean everything. I even reinstalled macOS, and it worked for a minute until it tried to open my project and then quit again and is doing the same thing.
1
0
267
Feb ’25
XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks
Hi, we are experiencing a strange issue with our Web App. Our web app runs entirely on the same domain , and we are making several AJAX requests to the same server. The Error occurs only on Iphones, the app works completely fine on androids and computers. Most of the requests work fine, but suddenly, one specific request always fails with the following error: XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks What we have checked so far: ✅ CORS headers seem correct. Also we operate entirely on the same domain, client and server. ✅ The same request works fine in computer and android devices. ✅ The issue occurs only on iPhone (tested on Chrome and Safari). ✅ Some requests to the same endpoint pass, but suddenly, this specific request always fails. ✅ There is no OPTIONS preflight request logged in the network tab, but we use only simple requests. ✅ We are making a POST request with multipart/form-data. What is Your advice, or where I can find more info about this error? We do not think the CORS is the problem. We have tried to inspect with WebInspector but with no relevant answers. Thank You very much!
0
1
520
Feb ’25
Xcode asset validation failed
Hi all, First time trying to upload a game to the App Store, having some trouble with it. I have managed to build my Unity Project and get it onto Xcode, but when I click "distribute app" it is giving me this error. Asset validation failed, Invalid Bundle. The bundle at (app name).app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'. Xcode version 16.2 Unity editor version 2022.3.30f1 Anyone know how to get past this? Many thanks!
1
0
305
Feb ’25
Prevent Xcode from injecting UIRequiredDeviceCapabilities
Xcode 16.2 suddenly injects the UIRequiredDeviceCapabilities key into our app's Info.plist. This results in a rejection from App Store Connect because of this key: TMS-90109: This bundle is invalid - The key UIRequiredDeviceCapabilities in the Info.plist may not contain values that would prevent this application from running on devices that were supported by previous versions. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/#qa/qa1623/_index.html The setting INFOPLIST_KEY_UIRequiredDeviceCapabilities is empty in our project, yet Xcode still injects: <key>UIRequiredDeviceCapabilities</key> <array> <string>arm64</string> </array> How can we prevent that? Or is there a way to strip it out during the build process? The Info.plist seems to get generated during an invisible build step, is there a way to make this explicit?
3
1
501
Feb ’25
About Xcode and GitHub
So I started a project in Xcode but without GitHub. Now I have prepared Xcode for GitHub and kind of made it work. I have also made a folder where I have cloned my project from GitHub. So is there any way to connect Xcode and the new folder. If I save my project it doesn't know about my new folder I presume: I could continue to use GitHub via Xcode but I'm afraid I will forget about commands in Git if I only use Xcode. If I should work on another project without Git.
1
0
227
Feb ’25
Building visionOS app with Firebase Source Distribution in Xcode Cloud
I have a working Xcode Cloud setup for my iOS and macOS targets, and I'm trying to add visionOS support. The issue is that Firebase requires using their source distribution for visionOS (instead of their default binary distribution). Locally, this works by launching Xcode with: open -a Xcode --env FIREBASE_SOURCE_FIRESTORE project.xcodeproj For Xcode Cloud, I've added a ci_post_clone.sh script that sets this environment variable for visionOS builds: #!/bin/bash if [[ $CI_PRODUCT_PLATFORM == "xrOS" ]]; then echo "Running setup for visionOS..." export FIREBASE_SOURCE_FIRESTORE=1 fi However, I'm getting the following error during build: an out-of-date resolved file was detected at /.../project.xcworkspace/xcshareddata/swiftpm/Package.resolved, which is not allowed when automatic dependency resolution is disabled So since setting FIREBASE_SOURCE_FIRESTORE=1 changes which SPM dependencies are required: Normal setup uses: abseil-cpp-binary, grpc-binary Source distribution needs: abseil-cpp-swiftpm, grpc-ios, boringssl-swiftpm What's the recommended way to handle this in Xcode Cloud when maintaining builds for all platforms? Should I be using separate workflows with different branches for different platforms? Or is there a better approach? System: Xcode 16.2 Using SPM for dependency management Firebase iOS SDK 10.29.0 Building for iOS, macOS, and visionOS Thanks in advance for any guidance!
0
1
455
Feb ’25
Swift UI Missing argument for parameter in @main app call in List View
Hello, I am building an app that records a list view of projects in contentView. I am in Xcode 16.2. I am having trouble when calling contentView in my @main app file and on the ContentView() line shown in the App file shows that ther is a "Missing argument for parameter 'project' in call". It prompts me to fix it with "Insert', project: ,#Project#.>". However when I do this like the following: ContentView(project: Project) It says "Cannot convert value of type 'Project.Type' to expected argument type 'Project'" These are my Code below //Model import Foundation import SwiftUI struct Project: Identifiable { var name: String var icon: String var isFavorite: Bool var color: Color let id = UUID() var compoundscore : Float static func CurrentProjects() -> [Project] { return [Project(name: "Test Project", icon: "🍎", isFavorite: true, color: .red, compoundscore: 4.5), Project(name: "Swimming", icon: "🏊", isFavorite: false, color: .orange, compoundscore: 12.5), Project(name: "Archery", icon: "🏹", isFavorite: false, color: .yellow, compoundscore: 37.5) ] } } // App view where the error is import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView(project: Project) } } } // Content View struct ProjectRow: View { let project: Project var body: some View { HStack { Text(project.icon) .font(.title) Text(project.name) Spacer() Image(systemName: project.isFavorite ? "heart.fill" : "heart") } } } struct ContentView: View { var CurrentProjectlist = Project.CurrentProjects() var project: Project var body: some View { NavigationView { List { Section { if #available(iOS 17.0, *) { ForEach(CurrentProjectlist) { project in ProjectRow(project: project) } .listRowBackground( Capsule() .fill(Color(project.color)) .padding(.vertical, 2).padding(.horizontal, 20) ) .listRowSeparator(.hidden) .foregroundColor(.indigo) } else { // Fallback on earlier versions } } header: { Text("CI Projects") } .listRowBackground(Color.blue) .foregroundColor(.black) .listRowInsets(.init(top: 0, leading: 40, bottom: 0, trailing: 40)) .listRowBackground(Color.black) .listSectionSeparatorTint(.yellow) .headerProminence(.increased) .listRowInsets(EdgeInsets.init(top: 0, leading: 50, bottom: 0, trailing: 50)) } .scrollContentBackground(.hidden) .background( Image("cool background") .resizable() .scaledToFill() .clipped() .edgesIgnoringSafeArea(.all) .blur(radius: 3) .overlay(Color.red.opacity(0.2)) ) .environment(\.defaultMinListHeaderHeight, 20) .environment(\.defaultMinListRowHeight, 70) .navigationTitle("Navigator") } } }
1
0
466
Feb ’25