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

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

Why does dependency analysis work for a script that outputs a folder that is copied in copy bundle resources but not once that script is moved to an aggregate target?
This question is a component of this question and an extension to this question which has been solved. This situation might feel a pinch constructed but it is a simplified version of one step of the original question. Basically in my app I have a script that outputs a folder with a few files inside of it. This folder is output to $(BUILT_PRODUCTS_DIR)/build/ and is referenced via a PBXBuildFile. Because I put a wait in the script (to simulate a long build I have in my real project) it is very obvious when the script is or isn't run. The goal would be for it to run only when its dependencies have changed. The trick is if I put this script as a "run script" phase within my final target dependency analysis works great. The script only runs when the dependencies are updated. However if I put the "run script" phase into an aggregate target then add it as a Target Dependency in the main target Xcode wants to run the script every time. Regardless of if the dependencies have changed. However if you build just the aggregate target alone everything goes just fine. It only builds when it has to. To me this does not quite make sense. I thought that dependency analysis of the script within my aggregate target would be the same regardless of whether that script was within the aggregate target or the main target. In my app I ideally need the aggregate target to be shared by multiple other targets. While I could put the script in each it would be more foolproof to have them share an aggregate target. Why would dependency analysis come to a different conclusion when the script is within an aggregate target that is a target dependency of the main target? If it helps here is the script and the entire project can be found here on GitHub if you would like to play with it. mkdir -p "${SCRIPT_OUTPUT_FILE_0}/build/" echo "Pausing for 10 seconds before creating files..." sleep 10 cat "${SCRIPT_INPUT_FILE_0}" cat > "${SCRIPT_OUTPUT_FILE_0}/build/index.html" << EOF <!DOCTYPE html> <html> <head> <title>Simple Page</title> </head> <body> <h1>Welcome to Simple Page</h1> <p>Generated at: $(date)</p> </body> </html> EOF cat > "${SCRIPT_OUTPUT_FILE_0}/build/page.html" << 'EOF' <!DOCTYPE html> <html> <head> <title>Simple Page</title> </head> <body> </body> </html> EOF
0
0
74
Aug ’25
Trying to get UIBarButtonItem custom view to change color within iOS 26 Liquid Glass like native UIBarButtonItem
One of the bar button items of my bottom toolbar needs to be a custom view., and I’m trying hard to get it to behave like the proper bar button items when it comes to Liquid Glass and matching the appearance of all the other bar button items on my toolbar. I’ve tried many variations of embedding custom views within visual effect views, and this comes closest. I inited a UIBarButtonItem with a custom UIView like you’re supposed to, and then I placed a UIVisualEffectView with Vibrancy within that, so that I could place a UIImageView inside it and the UIImageView would respect the adaptive color changing that comes with being within a Liquid Glass bar button item. I’ve made sure that the UIImageView is using an SF Symbol and a rendering mode of .alwaysTemplate, and that the .tintColor is set to .label, to ensure that I’m not overriding any Liquid Glass rendering. Below, you can see the bar button item with my custom view on the left, and a native Bar Button Item with the same SF symbol on the right, in several scenarios. It gets part of the way there there: against light backgrounds the image view turns black like it should. But against darker backgrounds, instead of turning white, the symbol has an additional vibrancy that comes close to the right white look against certain grays, but then is obviously too translucent against black. The symbol is still visible/experiencing some vibrancy, so I assume it might be some configuration of the UIImageView within the Vibrancy that can correct the behavior to match the images in the native bar button items in all conditions. Anyone got thoughts on what the missing piece might be?
4
0
422
Aug ’25
Xcode 26 beta iOS 16 crash Symbol not found: _UIMenuAutoFill
when launch my app from the Xcode 26 beta on iOS 16 I get this crash: Referenced from: <BB79205B-F03B-382A-A5D7-3F0C8A3135E5> /private/var/containers/Bundle/Application/7C842707-BB01-4C34-A2E0-318DC6E5B3D8/My APP.app/My APP.debug.dylib Expected in: <44798FBF-5AD6-37FB-A58C-DE1B58F2A2E7> /System/Library/Frameworks/UIKit.framework/UIKit Symbol not found: _UIMenuAutoFill Referenced from: <BB79205B-F03B-382A-A5D7-3F0C8A3135E5> /private/var/containers/Bundle/Application/7C842707-BB01-4C34-A2E0-318DC6E5B3D8/My APP.app/My APP.debug.dylib Expected in: <44798FBF-5AD6-37FB-A58C-DE1B58F2A2E7> /System/Library/Frameworks/UIKit.framework/UIKit dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
Topic: UI Frameworks SubTopic: UIKit Tags:
5
0
116
Aug ’25
Xcode compile stucks(stops) when add new source files or add functions to previous files
Hello, we are working on a iOS game project, as progress, the project grows larger and larger. Because we are using other game dependencies and libraries, here larger and larger refers to the whole project, and our source files integrated and compiled by Xcode are not many. Now, it seems we hit a bottleneck, when I add new files or functions to the previous files to implement a new feature, Xcode compile stucks(stops), it's Indexing | Initializing datastore forever, cannot produce a final build. macOS 15.1, Xcode 16.2 Can you provide any solutions to solve this problem? Also submitted Feedback ID #FB18432749
4
0
681
Aug ’25
Cannot find 'atomic_flag' in scope in Xcode 26
Hi, In Xcode 16.4, the atomic_flag() method can be used, but in Xcode 26.0, it is not available. An error message saying Cannot find 'atomic_flag' in scope is displayed. This can be reproduced simply by trying to use atomic_flag() in a newly created empty project. Thank you. Xcode: Version 26.0 beta 4 (17A5285i), macOS: 15.5(24F74) import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() .task { _ = atomic_flag() } } }
1
1
161
Aug ’25
App ID limit reached without any information beforehand
I setup an App that I have been testing on my macOS and iOS in Xcode. Then I realized I have 6 more apps I need to start working on. I have plans to become a developer in the Apple program but I want to get further in my coding to move forward. Apparently the UI Tests in my 6 Apps and those Apps took 10App ID limits from my account. I have App I have App UI Test and then and again up to a total of 5 of those 6 apps. My main app is now locked out of development? I wasn't planning on working on the other apps until I got my big first app developed. What can I do?! I am stuck. I can't work on my main app, nor can I work on the other apps. I'm not ready to at all.
3
0
128
Aug ’25
Xcode folder reference to an aggregate target's output folder breaks between Debug/Release builds. BUILT_PRODUCTS_DIR not relative to the aggregate
In my project I have an aggregate target that runs a script that generates a "web bundle" in a folder build/ with all the html/css/resources needed for the website. These resources are generated via a script. I use these resources in multiple targets so I have created an aggregate target to make this simple. However, I have not found this simple. If I have the aggregate target output to $(DERIVED_FILE_DIR)/ then it outputs to a path that looks like this DerivedData/BrowserApp-bla/Build/Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build/index.html If I then drag that folder into Xcode and create a folder that references it. Then take that reference and make it relative to build products I get this A9DE6A502E41E397005EF4E0 /* build */ = { isa = PBXFileSystemSynchronizedRootGroup; name = build; path = "../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build"; sourceTree = BUILT_PRODUCTS_DIR; }; This is because to the main BrowserApp target the BUILT_PRODUCTS_DIR is DerivedData/BrowserApp-bla/Build/Products/Debug-iphonesimulator. You can see that the reference essentially has to maneuver out of the built products folder for the main BrowserApp target and into the built products directory for WebBundle. This is ok for a debug build I suppose you can imagine that this is going to break down the moment you have a release build. Now if we ignore that problem then comes the problem of getting it in Copy Bundle Resources. Xcode 16s PBXFileSystemSynchronizedRootGroup is a great improvement but does not help here. The only way I have found to get the folder copied is to hop into an earlier Xcode or make the following modifications. Change the PBXFileSystemSynchronizedRootGroup into a PBXBuildFile (In PBXFileReference section) A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/client.build/Debug/WebBundle.build/DerivedSources/build */ = {isa = PBXFileReference; lastKnownFileType = text; path = ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build; sourceTree = BUILT_PRODUCTS_DIR; }; (In the mainGroup PBXGroupSection) A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/client.build/Debug/WebBundle.build/DerivedSources/build */, Then remove any references for A9DE6A502E41E397005EF4E0 as a synchronized group Create a PBXBuildFile using the previous PBXBuildFile as its fileRef then add it to the copy resources stage (In PBXBuildFile section) 96516AC32BF928DD00576562 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build in Resources */ = {isa = PBXBuildFile; fileRef = A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build */; }; (In the PBXBuildResources phase for the resources section of the main target) 96516AC32BF928DD00576562 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/ I do not know of a way to do this with a PBXFileSystemSynchronizedRootGroup so these manual changes seem necessary. After these changes I have the following: And you can confirm the entire folder is accessible to the app. However if you try to build for release/Archive you get lstat(/Users/calebkierum/Library/Developer/Xcode/DerivedData/BrowserApp-bla/Build/Intermediates.noindex/ArchiveIntermediates/BrowserApp/Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build): No such file or directory (2) Which makes sense. The file reference has a relative path that explicitly mentions "debug" however because this path is based on an aggregate target I am not sure how you really update this reference for release.
3
0
107
Aug ’25
can't create info.plist from info-> URL Types
Hi, In Google Admob get started page they are suggesting to update info.plist file with keys. https://developers.google.com/admob/ios/quick-start#update_your_infoplist However, I can't find info.plist in the project folder. On the internet, there are videos suggesting to create info.plist file from pressing + under Targets -> info -> URL Types section. Unfortunately , I can't generate the info.plist using that method. How should I proceed? It is difficult to enter all the keys defined in the Google Admob link there are 40+ keys. Thank you for your help.
3
0
103
Aug ’25
Unable to Download App Version Information in Xcode Organizer Despite Admin Privileges. (from Reports Hangs, Launches, Disk Writes)
I am writing to report a critical issue with the Xcode Organizer. It is failing to download App Version Information from App Store Connect, which prevents our team from accessing vital performance reports like disk writes, hangs, and launches. Other features such as Crashes, Metric's items work fine. When I open the "Reports" tab in the Xcode Organizer, it consistently shows the following error: Xcode failed to load builds for "{Service}". "{Account}" failed with error: No Versions. [Important Context] What is particularly concerning is that this functionality used to work correctly. We were able to see build versions and access their reports up until a certain build in the past. However, at some point, this stopped working, and now no versions are loaded. Given that I am an Admin and this feature was previously working, the issue does not appear to be a simple permissions problem. It seems a change has occurred, either on the server-side or in how Xcode interacts with our app's record on App Store Connect. Could you please help us understand: What might have caused this sudden change that prevents build versions from being loaded? What steps can we take to resolve this "No Versions" error and restore access to our performance reports? Thank you for your investigation into this matter.
2
0
150
Aug ’25
Xcode forces my Macbook to restart when previewing canvas
I can't use Xcode without it crashing. Just writing a very simple iOS app with SwiftUI (using only forms and sections). Whenever my canvas updates to correspond to my changes it forces my Macbook to restart. Does anyone have a solution for this. I'll be honest it's becoming really frustrating. Thank you. Macbook M3 Pro 16GB ram, 500gb Space (400gb free space)
1
0
97
Aug ’25
XCode 26 beta 4 search bar issue
I have a standard list view controller that has a UISearchController set up in the list's navigationItem. When built on Xcode 26 beta 4 the search bar does not appear. It's not present in the view hierarchy. On previous versions it appears, especially on Xcode 16.4. Is this a known issue? Haven't managed to find it anywhere. Also what could be the potential workaround?
1
0
114
Aug ’25
Using Previews causes a system crash on Xcode 26 Beta 4 and MacOS 26 Beta 4
Hey, I've updated to both Xcode 26 Beta 4 and MacOS 26 Beta 4. Both run super stable so far. However, every time I use Xcode Previews for a few minutes, the entire system freezes for a few seconds and then crashes and reboots. I'm trying to generate a system diagnosis (which it offers me after the reboot), but it seems to be stuck generating. It's hard to say what exactly causes the crash, unfortunately. But it happened multiple times after starting to use Xcode Previews. Anyone else has that problem? I've also filed a feedback for this: FB19013059 Cheers Dennis
11
12
725
Aug ’25
Question about Metrics Analysis in Xcode 26
Hello, I have recently been using the new Power Profiler tool introduced in Xcode 26 to analyze the power consumption of my app. My app primarily operates in the background. During a profiling session of 5 hours and 30 minutes, I observed that the app was active in the background for 2 hours and 30 minutes, while it remained in a suspended state for the remaining 3 hours. While the Power Profiler allows me to identify spikes in CPU, networking, and other resource usage at specific points, it is difficult to determine whether these values are objectively considered high. For example, in my case, the total QoS Execution Time of CPU Impact recorded during the 5 hours and 30 minutes was 12.18 seconds. I am wondering whether this is considered a good metric. Could you please advise on the following points? 1. Is there a commonly accepted or recommended ratio between app active time and CPU time that developers should aim for? 2. Are there any guidelines or reference materials on how to interpret CPU usage and other resource metrics for apps that primarily run in the background? Any insights or advice would be greatly appreciated. Thank you.
1
0
182
Aug ’25
linking error file cannot be open()ed, errno=2
I have been learning from the Apple Developer tutorials and I got stuck on the ScoreKeeper chapter with Testing. Since my Macbook Pro 2017 can only use Xcode 15.2 as the highest level, I am having issues with it. I saw a forum post that a certain level of Swift and the tool chain would fix this. I attempted to install Swift 5.10.1 to then realize I only had Xcode 15.2 not 15.3, so I had to attempt to install Swift 5.9. Since neither option worked, I uninstalled Xcode and removed any extra files along with swift packages, minus my projects, to redownload and reinstall Xcode 15.2. Now I am having issues with building the scheme, and I get link error,s and they pertain to Swift 5.10.1, which I had not installed any Swift packages after the Xcode reinstallation. I have tried another previous project even a new one same error. This was 7/30/25, as of today 7/31 I tried to install Swift 5.9 thinking it would overwrite or "downgrade" the package, no such luck. The file path in the error stops at the /.../...RELEASE.pkg file and does not continue, which seems to be the issue of the error. How to I fix this issue, I had a working product 3 dyas ago
2
0
132
Aug ’25
XCode 26 debug build run time crash on iOS Device with iOS < 26.0


1.App build using xCode 26 beta 4 crashing on run time on iOS device with iOS < 26.0 but works fine on iOS 26 beta devices. 2. Works fine if build using xCode 16.2 Runtime Crash Dump 
dyld[67519]: Symbol not found: _NSUserActivityTypeBrowsingWeb Referenced from: /private/var/containers/Bundle/Application/2D4B24D6-CEA5-4682-B549-9CCB6A56BAB9/Foreground Camera.app/Foreground Camera.debug.dylib Expected in: <050203DD-7488-307D-A999-E587314B041A> /System/Library/Frameworks/CoreServices.framework/CoreServices Symbol not found: _NSUserActivityTypeBrowsingWeb Referenced from: /private/var/containers/Bundle/Application/2D4B24D6-CEA5-4682-B549-9CCB6A56BAB9/Foreground Camera.app/Foreground Camera.debug.dylib Expected in: <050203DD-7488-307D-A999-E587314B041A> /System/Library/Frameworks/CoreServices.framework/CoreServices dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib:/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture Symbol not found: _NSUserActivityTypeBrowsingWeb Referenced from: /private/var/containers/Bundle/Application/2D4B24D6-CEA5-4682-B549-9CCB6A56BAB9/Foreground Camera.app/Foreground Camera.debug.dylib Expected in: <050203DD-7488-307D-A999-E587314B041A> /System/Library/Frameworks/CoreServices.framework/CoreServices dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib:/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture
2
0
184
Jul ’25
UITabBar hitTest method is not triggered when click button that is a subview of UITabBar and the subview frame is beyond UITabBar when using Xcode26 build app on OS 26
In our project, we defined a CustomTabBar that inherits UITabBar, and we add some subviews and these subviews' frame is beyond UITabBar, see below picture(a beyond area button, this button is a subview of UITabBar, but frame is out of UITabBar's area): and in order to let this button response to click action, we override the UITabBar's hitTest method, this works well below OS 26 with Xcode version below 26: override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { let pointInCollectionView = self.beyondAreaButton.convert(point, from: self) if self.beyondAreaButton.bounds.contains(pointInCollectionView) { return self.beyondAreaButton.hitTest(pointInCollectionView, with: event) } return super.hitTest(point, with: event) } but when using Xcode26 build app on OS 26, I noticed the UITabBar is wrapped by a UIKit._UITabBarContainerView and UIKit._UITabBarContainerWrapperView, and it can not trigger the hitTest method. since the hitTest is not triggered, so the button action is no chance to trigger too. Any suggestions to solve this problem, thank you~ And I have file a feedback assistant: FB19252973
1
0
187
Jul ’25
XCode 26 beta 4 Playground macro issue
Using the #Playground macro in beta 3 worked fine, but the Playgrounds package appears to be missing in beta 4. import Playgrounds #Playground { print("🚀 Playground is active") } Canvas error message: Cannot find playgrounds Check whether the playground is compiled for the current scheme and OS of the selected device. There could be compile time checks filtering playgrounds out. Check for dead code stripping or other settings that could exclude playgrounds from the final binary.
1
0
143
Jul ’25