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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

How can one suppress SF Symbol deprecation warnings?
Xcode 16 insists on showing deprecations of this type: Some.xib SF Symbol 'doc.on.doc' is deprecated, use 'document.on.document' instead. The problem is that the XIBs in question are set with a Deployment Target of macOS 12, where "document.on.document" actually isn't available and produces a missing image. So the warnings are wrong, as they ignore the deployment target set on the XIB. I filed a bug against this long ago and it was ignored. Having given up... does anyone know how to disable this particular warning?
0
1
158
May ’25
NSE Filtering Entitlement Rejected Repeatedly – Seeking Advice & Possible Solutions
Hi everyone, I’m facing a major roadblock with my family location tracking app, and I need some advice or guidance from the community. Background Back in 2021, I implemented NSE filtering entitlement to send location-based notifications and retrieve the device's location in return (as suggested by Apple’s technical code support). Over time, I built my app around this entitlement, adding many features that depend on it. When Location Push Service Extension was introduced for iOS 15+, I adapted accordingly: NSE filtering was used for devices below iOS 15 Location Push Service Extension was used for iOS 15+ NSE filtering also played a crucial role in: ✅ Accepting/rejecting location-based notifications ✅ Checking device settings & location permissions (since location push won’t work without proper permissions) The Issue In November 2024, I created a new developer account to change my business entity. Since then, I’ve been requesting the NSE entitlement repeatedly for four months, but Apple keeps rejecting it. Meanwhile, they approved the Location Push Entitlement, but without NSE filtering, I’m forced to rewrite a huge part of my app’s core functionality. I’ve sent multiple emails explaining my use case, but I keep getting rejected without any clear explanation or workaround. My Ask Has anyone faced a similar issue with NSE entitlement? Are there any alternative approaches to achieve the same functionality? Any advice on how to escalate this to Apple or get proper feedback on why it's being rejected? I’ve invested years into this app, and a forced rewrite would take months. Any help, insights, or contacts who could assist would be greatly appreciated! Thanks in advance! 🙏
0
0
63
Mar ’25
XCode 16 run Fastlane fail when called get_version_number function after convert project from groups to folders
My project is using Fastlane 2.226.0. After converted groups to folders on XCode 16, I got an error when executed below function in Fastfile: get_version_number(xcodeproj: "MyProject.xcodeproj", target: "MyProject") Below is the error message output after I ran fastlane: Unable to find XCode build setting: MARKETING_VERSION
0
0
109
Mar ’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
Followed docs for "Local Package", how to add to 2nd project?
I have a couple apps in one git repository. I'd like to have a Swift package in that repo as well, shared by apps. In other words, I don't want a separate repo for the Swift package. I followed the instructions here: https://developer.apple.com/documentation/xcode/organizing-your-code-with-local-packages It seems to work. I can write code like this in my app: import MyLocalPackage func foo() { myLocalPackageFunc() } I notice that the package is not listed under Project > MyApp > Package Dependencies. I don't really care, as long as I can reuse code between apps. But when I try to add this package code to a 2nd app, I'm at a loss. I tried "Add Package Dependencies" and "Add Local", but that creates a different looking setup than the 1st app. The code is browsable in the project navigator. And when I try to build it says "Missing package product 'MyLocalPackage'. The documentation linked above, which I used for the 1st app, does a "New > Package". I don't want a new package. How can I connect the existing one?
0
0
78
May ’25
Xcode is is throwing error when I run my Unity Build
When I try to build my project in Xcode (from Unity AR) project, it throws me these errors: I feel like I've tried everything to make the LaunchScreen work. I downloaded xcode the night I tried running this build, so the whole deleting and redownloading and restarting everything didn't work. I've tried making sure my macbook and terminal are fully up to date. I literally can't find a solution! Please help!! I will also say, I'm fairly new to App building, Xcode, and Unity. But this does seem like a barrier that is stopping me from testing my project.
0
0
160
Mar ’25
AuthenticateAsClient(this.Host、this.certificates、System.Security.Authentication.SslProtocols.Tls12,false)
Apple's push cannot receive information, use the open-source library JdSoft. Apple.Apns.Notifications Because I am not familiar with it, I modified Tls12. Does anyone know how to modify this open-source library to achieve push functionality apnsStream.AuthenticateAsClient(this.Host, this.certificates, System.Security.Authentication.SslProtocols.Tls12, false)
0
0
60
Apr ’25
App Unable to Archive After Xcode Update
Hi! I am having trouble getting my app to build successfully or archive since an xcode update a few months ago. Below is the error that shows in the log. Thank you in advance for any help! Run custom shell script 'Run Script' Failed to package [project folder]. Command PhaseScriptExecution failed with a nonzero exit code
0
0
69
May ’25
Preview broken
Hello, I am doing the SwiftUI tutorial with Xcode 16.2 For the watch app the simulator working fine but the preview keep saying “This app cannot run on the selected target device.” while the preview is working …… For the macOS part the simulator working fine but the preview is totally broken with -> ”ContentView.swift” not found in any targets. While it is correctly added to the target … Please fix or make tutorial clear.
0
0
158
Feb ’25
How to setup a directory in Xcode project 16.2
the Xcode Version 16.2 (16C5032a), I want to know how to setup a directory in Xcode project when develop the iOS app. Here is the whole thing: I start a new iOS App project "test_path". then I right click, and choose "New Folder", to make a new folder "configx" then I right click on the configx folder, and choose the "add files to test_path", add a file in it But the folder does not exist in the project when try to access by "Bundle.main.urls" func. 5. when ls in the Mac, /data/Containers/Bundle/Application/E4F11903-3FAD-467F-A4CD-60AC68D64934/test_path.app, the file just at the root path of test_path.app, no "configx" folder ahead the file. so, how to setup a directory or a path in iOS project?
0
0
89
Mar ’25
FamilyControls Framework info.plist missing
We are trying to create a screentime app using the Family Controls as well as Device activity frameworks. The build succeeds but while pushing to an iphone we are getting an info.plist file for deviceactivity.framework could not be found error. For reference when using the Screentime API a physical device must be used not a simulator. When we remove the device activity framework this error also occurs for the family controls framework. We have added the Family Controls(development) Capability and applied for the distribution capability. We have redownloaded xcode multiple times on the main device, deleted derived data, and redownloaded all of the iphone SDKs and the issue still persists.
0
0
252
Mar ’25
Most useless Xcode error message ever
Neither a google search, nor a search of the Apple forums give me a clue as to how to locate or fix the following message I get from Xcode. CLIENT: Failure to determine if this machine is in the process of shutting down, err=1/Operation not permitted This error message came from attempting to build and execute an iOS App which ran just fine the last time I built it. Now, that was actually a little over two years ago. This is an iOS app, which I've run successfully for more than a year on macOS, and that, "My Mac (Designed for iPad)", is what my build target for this run was. Any ideas? Anyone? If this is a "known condition", just why doesn't a friendly internet search or a search of the Apple forums NOT tell me what it means, or what causes the message. Of course, I've upgraded the OS a few times, and updated Xcode as well, but have just not had any time to monkey around with my pet code project. Now that I've gotten some time, and I want to see what's new since March of '23, I finally remember where I stashed my code repository and decided to take it for a spin. Sure, I expect(ed) to see Xcode tell me that the version of Swift has been updated, and maybe some code constructs need to be fixed. But, NO, the code compiles fine. The first build attempt told me that I needed to update my provisioning profiles, and sign-in and agree to the updated developer agreements, which I did. Not so unhelpful was the code window in the debugger: libswiftCore.dylib`swift_willThrow: -> 0x1aeb7b2a0 <+0>: pacibsp 0x1aeb7b2a4 <+4>: str x19, [sp, #-0x20]! 0x1aeb7b2a8 <+8>: stp x29, x30, [sp, #0x10] 0x1aeb7b2ac <+12>: add x29, sp, #0x10 0x1aeb7b2b0 <+16>: adrp x8, 365651 0x1aeb7b2b4 <+20>: add x8, x8, #0x88 ; _swift_willThrow 0x1aeb7b2b8 <+24>: ldapr x8, [x8] 0x1aeb7b2bc <+28>: cbnz x8, 0x1aeb7b2cc ; <+44> 0x1aeb7b2c0 <+32>: ldp x29, x30, [sp, #0x10] 0x1aeb7b2c4 <+36>: ldr x19, [sp], #0x20 0x1aeb7b2c8 <+40>: retab 0x1aeb7b2cc <+44>: mov x0, x21 0x1aeb7b2d0 <+48>: mov x19, x21 0x1aeb7b2d4 <+52>: blraaz x8 0x1aeb7b2d8 <+56>: mov x21, x19 0x1aeb7b2dc <+60>: b 0x1aeb7b2c0 ; <+32> Still not much to go on. I decide to see if it was a macOS vs. iOS issue, so did a clean build folder and tried running on an iPad simulator, "iPad (10th generation)". Now, I have a blank white screen on my simulator and not much to go on in the code window. import SwiftUI @main struct JottoApp: App { Thread1: Breakpoint 1.1 var body: some Scene { WindowGroup { ContentView() } } init() { UITableView.appearance().backgroundColor = UIColor.clear } } Any and all help with this error message will be appreciated.
0
0
96
Apr ’25
Google map APIs not working in my app with xcode 16.3
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=station%20bab%20saadoun&key=GOOGLE_API_KEY&components=country:TN func googleAutocomplete(for query: String, completion: @escaping ([GooglePlaces]) -> Void) { let apiKey = GoogleMapAPIs.shared.apiKey let baseURL = "https://maps.googleapis.com/maps/api/place/autocomplete/json" guard let url = URL(string: "\(baseURL)?input=\(query)&key=\(apiKey)&components=country:TN") else { print("Invalid URL") completion([]) return } print(url) let task = URLSession.shared.dataTask(with: url) { data, response, error in if let error = error { print("Error fetching data: \(error.localizedDescription)") completion([]) return } guard let data = data else { print("No data received") completion([]) return } do { let decodedResponse = try JSONDecoder().decode(GooglePlacesResponse.self, from: data) completion(decodedResponse.predictions) } catch { print("Decoding error: \(error)") completion([]) } } task.resume() } struct GooglePlaces: Codable { let title: String? let region: StructuredFormatting? let placeID: String? enum CodingKeys: String, CodingKey { case title = "description" case region = "structured_formatting" case placeID = "place_id" } } struct StructuredFormatting: Codable { let main_text: String let secondary_text: String? } struct GooglePlacesResponse: Codable { let predictions: [GooglePlaces] } Error fetching data: The network connection was lost.
0
0
62
Apr ’25
XCODE Account not found
I have one of our developer when he attempts to login to xcode on his macos device, he get a message that account is not found but he has an account and he logs in to app developer portal with no issue. Thanks
0
0
47
Apr ’25
Active Compilation Conditions in Packages
The flags like #if DEBUG ... endif are dependent on the Active Compilation Conditions. So if they say DEBUG the enclosed code block will be executed, otherwise not. Now I have the phenomenon that a #DEBUG block in a Package does not evaluate these conditions. It rather depends on the name of the configuration used to build. So if I build my app with Active Compilation Condition set to DEBUG, but the configuration name is something like App-Release, the DEBUG block in my Package is not added/executed. The ones which are directly in the project are added. Vice versa if the Compilation Condition say RELEASE but the configuration is called App-Debug the blocks in the Package are added to the compilation, but the ones in the project itself are not It suffices that the config name contains the word Debug for this to happen. E.g. the configuration App-Release-Debug (I know that this would be stupid, but it is for demonstrating purposes) will cause the Packages to include the DEBUG blocks. This happens no matter what you set in the Build Settings of the project and/or target. The Packages are added via GitHub/GitLab Source Control with SPM. Any ideas why this behaves like it does? It doesn't seem like it should...
0
1
105
Mar ’25
Xcode Test Pane for TDD and Unit Tests?
At the last place I worked it took roughly 5 minutes to do an application build. Which in turn made doing any sort of TDD or ever just regular Unit Tests extremely painful to do as the cycle time was simply too long. But that got me thinking. In recent versions of Xcode, Apple added Previews for SwiftUI Views that basically showed code changes to the View in real time. And Previews were made possible by extremely targeted compilation of the view in question. So... what if instead of a Preview pane in the Xcode IDE there was a Test pane the could be displayed such that Tests for a piece of code could be created and run almost immediately? Perhaps by adding a #Testing section to your code #Testing(MyService.self) // Define the entity to be tested. If you could drop the turnaround time AND provide a test playground for service level code that could speed development of such code greatly... and encourage interactive test development at the same time. What do you think?
0
0
110
Apr ’25
Getting an error in Xcode after resting simulator
I just made clean data on simulator then started getting the below error built on Xcode ? Showing Recent Issues Entitlements file "Clinic.entitlements" was modified during the build, which is not supported. You can disable this error by setting 'CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION' to 'YES', however this may cause the built product's code signature or provisioning profile to contain incorrect entitlements.
0
0
324
Feb ’25
Distribution and Apple TV Question
Hi, This maybe somewhat confusing, but please bear with me. I currently have an app in the App Store that supports iOS and tvOS. But the tvOS version was a separate app during the development process. I'd like to combine the iOS and tvOS app into one project so its easier to handle and keep track of internally. Can I upload the new Apple TV version to the same place where the current one is, or would I have to delete the current Apple TV version before uploading the newly combined version? I hope I made that clear enough :-) Thank you, Dan Uff
0
0
89
Apr ’25
Icon dark mode not working on iPadOS
I updated the icons in Xcode to customize the appearance of my app icons to be light, dark, or tinted. The app is allowed to be downloaded and run on iPadOS. The app icon behaves as expected on iOS however the app icon does not change on the iPad. Am I missing a step for the iPad? To be clear the app does not target iPadOS rather it is just running the iOS version. Thanks kof
0
0
47
Apr ’25