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

Posts under Xcode tag

191 Posts

Post

Replies

Boosts

Views

Activity

Swift student challenge assessment query!!!
I was just filling the submission for the swift student challenge and there is a note below adding the zip file saying Note: Xcode app playgrounds are run in Simulator. Now my xcode app playground(.swiftpm) is an AR app and needs an ipad or an iphone to run . So will my submission still be eligible for assessment and checked on ipad???
1
0
669
Feb ’25
OS 17 Disconnects from Xcode
Hello, Is anyone experiencing devices on OS 17 disconnecting from Xcode 15 and 16 Beta? I remember there were a lot of past conversations around the time when iOS 17 released but it seems to still be happening even after using Xcode 16 beta. Re-pairing devices and rebooting the hosts appear to fix it temporarily. I discovered that killing the remoted process also allows xcode to reconnect to the devices. Using Xcode 16's devicectl also doesn't work. I have my devices connected to a USB Hub and to multiple devices. The odd thing is I have iOS 16 devices connected and those don't disconnect. I believe iOS 17 introduced a new coredevice stack to connect but has anyone found a fix for it or have any recommendations? TN3158 isn't relevant in my situation because VPN and Packet filtering is not in use and I filed feedback with Apple but they have't responded in a long time.
5
0
463
Feb ’25
Mismatch of teamID while creating development certificate
Hi Team, I have created multiple certificates for macOS application. Below are the certificates created- Apple Development Certificate DeveloperID Installer Certificate Apple Distribution Certificate others certificates Later, I have imported the all these above certificates in keychain-access. Now, I tried to compile the code through Xcode. I am getting error for code signing certificate. Warning: unable to build chain to self-signed root for signer "Apple Development: Amit (M2WMF2YERI)” .... Command CodeSign failed with a nonzero exit code When I checked the TeamID of User(Amit) I can see that his current TeamID is [P8ZW3W9R2Q]. There is mismatch of teamID in apple development certificate generation. Note- All certificates are generated with current TeamID[P8ZW3W9R2Q] of user (Amit) except Apple Development certificate which has been generated with TeamID [M2WMF2YERI] which is generated with old TeamID of user (Amit). I attempted to generate the apple development certificate multiple times but it is getting generated with old TeamID TeamID[M2WMF2YERI] of user(Amit)
 Summary- While creating a developer certificate using apple developer account and mapping it in keychain, the certificate is being generated with old apple account details (Inactive) instead of the current one. This is causing issues when using the certificate in keychain. If anyone has encountered this issue, how it was resolved?
 Thanks
1
0
398
Feb ’25
Hide the TabBar while navigating between screens in Xcode Swift for iOS 16 or later.
Hey, I am developing my app in Swift using Xcode for iOS 16 or later. I want to implement the navigation behavior found in apps like WhatsApp or Instagram, where navigating from the feed to a user's profile keeps the tab bar visible. Then, when opening a chat from the profile, a new view appears, leaving the profile view behind along with the tab bar. I have this code as a base to achieve this, but when navigating from View 1 to View 2, it applies the effect that should only happen in View 3. I haven't been able to prevent View 2 from using this effect and limit it only to View 3. Can anyone help me??? import SwiftUI struct ContentView: View { @State private var path: [String] = [] // Controls the navigation stack in View1 var body: some View { NavigationStack(path: $path) { TabView { View1(path: $path) .tabItem { Label("View 1", systemImage: "1.circle") } View4() .tabItem { Label("View 4", systemImage: "4.circle") } } .navigationDestination(for: String.self) { value in if value == "View3" { View3(path: $path) // View3 outside the TabView } } } } } struct View1: View { @Binding var path: [String] var body: some View { VStack { Text("View 1 with TabBar") Button("Go to View 2") { path.append("View2") // Adds View2 to the stack } } .navigationDestination(for: String.self) { value in if value == "View2" { View2(path: $path) } } } } struct View2: View { @Binding var path: [String] var body: some View { VStack { Text("View 2 with TabBar") Button("Go to View 3 (Without TabBar)") { path.append("View3") // Adds View3 to the stack } } } } struct View3: View { @Binding var path: [String] var body: some View { VStack { Text("View 3 without TabBar") .font(.largeTitle) .padding() Button("Go Back") { path.removeLast() // Returns to View2 } } } } struct View4: View { var body: some View { Text("View 4 with TabBar") } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2
0
288
Feb ’25
Xcode: Skipping Duplicate Build File in Compile Sources in a .swiftpm Project – How to Fix?
I'm trying to add Assets.xcassets to a .swiftpm project, but I'm getting the warning: ⚠️ Ignoring duplicate build file in build source build phase (Just to know, that is about developing in XCODE, in Swift Playgrounds does not appear it, even in this second being harder to setting up) The problem is that there are no “Build Phases” in XCODE to remove duplicate files manually. I've already tried adding the path of Assets.xcassets in the resources property of Package.swift, like: .executableTarget( name: "AppModule", path: ".", resources: [ .process("Assets.xcassets") ] ) Even so, the warning persists. Does anyone know how to solve this? Is there any way to remove duplicate references or force a cleanup of the Swift Package Manager cache to fix it? I appreciate any tips! 🙏🚀
2
2
585
Feb ’25
Xcode16 support
I don't see a timeline for Xcode16 adoption yet. However, based on past experience, Apple usually provide a deadline by the end of April. Do we have a tentative timeline for Xcode 16 (Apps uploaded to App Store Connect must be built with Xcode 16)? This will help us plan our delivery.
1
0
670
Feb ’25
Does CLANG_CXX_LANGUAGE_STANDARD affect my Swift app and why is it not set to Compiler Default?
I was just comparing the build settings of two of my apps to try to understand why they behave differently (one of them uses the full screen on iPad, and the other one has small top and bottom black borders, although that's not the issue I want to discuss now). I saw that the option CLANG_CXX_LANGUAGE_STANDARD is set to gnu++0x for the older project, while it's set to gnu++17 for the newer one. The documentation lists different possible values and also a default one: Compiler Default: Tells the compiler to use its default C++ language dialect. This is normally the best choice unless you have specific needs. (Currently equivalent to GNU++98.) If it really is the best choice (normally), why is it not used when creating a new default Xcode project? Or is it better to select a newer compiler version (GNU++98 sounds quite old compared to GNU++17)? Also, does this affect Swift code?
2
0
421
Feb ’25
Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier
I had a standalone python application (created with pyinstaller) which was working perfectly alone. This macOS application was created in VS. I later decided to improve the application by implementing some Swift features (Subscription Manager). This required me to write a brief Swift file (Subscription Management) in XCode which the Python file called on. Python Standalone Application Calling Swift : # Function to check if the user has a valid subscription def check_subscription(): subscription_manager_path = "/Users/isseyyohannes/Library/Developer/Xcode/DerivedData/SubscriptionManager2-ezwjnnjruizvamaesqighyoxljmy/Build/Products/Debug/SubscriptionManager2" # Adjust path try: result = subprocess.run([subscription_manager_path], capture_output=True, text=True, check=True) return "VALID_SUBSCRIPTION" in result.stdout # Return True if valid, False otherwise except subprocess.CalledProcessError as e: print(f"Error checking subscription: {e}") return False # Return False if there's an issue However, when I try to run xcrun altool --validate-app ... I get the following error message. The error reads as follows Running altool at path '/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Frameworks/AppStoreService.framework/Support/altool'... 2025-02-16 11:02:21.089 *** Error: Validation failed for '/Users/isseyyohannes/Desktop/ALGORA Performance.app'. 2025-02-16 11:02:21.089 *** Error: Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in ‘/Users/isseyyohannes/Desktop/ALGORA Performance.app’. Unable to validate your application. (-21017) { NSLocalizedDescription = "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in \U2018/Users/isseyyohannes/Desktop/ALGORA Performance.app\U2019."; NSLocalizedFailureReason = "Unable to validate your application."; I located the Info.plist file which had everything correct (my Bundle ID, etc.) for the python file. I am successfully able to notarize the application, just having issues submitting it. **It is worth noting I currently have a python executable calling on a file written in swift code and created in xcode. I created the python application with the following command on VS. pyinstaller --onefile --noconsole \ --icon="/Users/isseyyohannes/Downloads/E0BWowfbDkzEiEAckjsHAsYMzpdjjttT.icns" \ --codesign-identity "Developer ID Application: Issey Yohannes (GL5BCCW69X)" \ --add-binary="/Users/isseyyohannes/Library/Developer/Xcode/DerivedData/SubscriptionManager2-ezwjnnjruizvamaesqighyoxljmy/Build/Products/Debug/SubscriptionManager2:." \ --osx-bundle-identifier com.algora1 \ /Users/isseyyohannes/Desktop/ALGORA\ Performance.py Note : All steps on Apple Developer site are done (ex. Creating identifier, secret password etc)
1
0
357
Feb ’25
Xcode 15 Breaks Usage Of TextField.focused()
My usage of TextField.focused() works fine in Xcode 14.3.1 but is broken as of Xcode 15. I first noticed it in the second beta and it's still broken as of the 4th beta. Feedback / OpenRadar # FB12432084 import SwiftUI struct ContentView: View { @State private var text = "" @FocusState var isFocused: Bool var body: some View { ScrollView { TextField("Test", text: $text) .textFieldStyle(.roundedBorder) .focused($isFocused) Text("Text Field Is Focused: \(isFocused.description)") } } }
7
1
1.6k
Feb ’25
Cannot launch simulated executable: no file found at /Applications/Warenwirtschaft.app
Hallo zusammen, ich habe seit einiger Zeit ein Problem, dass ich eine App 'Warenwirtschaft' aus Xcode heraus nicht mehr im Simulator oder auf meinem IPad starten kann. Ein Compilieren und Verteilen über TestFlight funktioniert weiterhin ohne Probleme. Leider klappt das Debugger nun nicht mehr. Anbei die Fehlermeldung von Xcode. Ich hoffe ihr könnt mir helfen. Grüsse Mark Cannot launch simulated executable: no file found at /Applications/Warenwirtschaft.app Domain: IDEFoundationErrorDomain Code: 1 User Info: { DVTErrorCreationDateKey = "2025-02-05 10:10:06 +0000"; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; } Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "D572897F-2ECB-4109-9DFC-C7D0FB145C1C"; "device_model" = "iPad16,6"; "device_osBuild" = "18.2 (22C150)"; "device_platform" = "com.apple.platform.iphonesimulator"; "device_thinningType" = "iPad16,6-A"; "dvt_coredevice_version" = "397.28"; "dvt_coresimulator_version" = "993.7"; "dvt_mobiledevice_version" = "1759.81.1"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 562; "operation_errorCode" = 1; "operation_errorDomain" = IDEFoundationErrorDomain; "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphonesimulator"; "param_diag_113575882_enable" = 0; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_guardMalloc_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_mtc_enable" = 1; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_enable" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 2; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphonesimulator18.2"; "sdk_osVersion" = "18.2"; "sdk_variant" = iphonesimulator; } System Information macOS Version 15.3 (Build 24D60) Xcode 16.2 (23507) (Build 16C5032a) Timestamp: 2025-02-05T11:10:06+01:00
3
0
447
Feb ’25
Full Disk Access, Run and Debug from Xcode?
I'm working on a macOS app that I want to give "Full Disk Access". When I run from Xcode, I get "permission denied" errors when reading a file in my home directory. What can I do so that I can run and debug from Xcode? I dragged the binary from the derived data folder to the System Preferences list for Full Disk Access, but that seems to do nothing.
5
0
3.0k
Feb ’25
Apple developer
in xcode i have select the developer team. but show some error that is here, "Communication with Apple failed Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/" and show this error also "No profiles for 'com.kuntaldoshi.homeautomation' were found Xcode couldn't find any iOS App Development provisioning profiles matching 'com.kuntaldoshi.homeautomation'."
0
0
360
Feb ’25
Xcode won't symbolicate .ips crash log
I was my understanding that you're supposed to be able to open a .ips crash log in Xcode and see pretty much what you would see if the app had been running in the debugger when it crashed. But the addresses in my app don't get symbolicated. I opened the .ips in the same project and same version of Xcode that was used to create the app. The .dSym file is around, and I can use it to symbolicate using the atos tool. What am I missing?
3
1
2.4k
Feb ’25
[ERROR] Could not create a bookmark: NSError: Cocoa 4097 "connection to service named com.apple.FileProvider" for PhotosPicker
I am on Xcode 16.2 and running a simulator for iOS 18.2. Previously, I was on Xcode 15.x and running iOS 17.4 sims. This problem did not occur for me on iOS 17.4. Sample code is as follows: import SwiftUI import PhotosUI struct ContentView: View { @StateObject var imagePicker2 = ImagePicker() var body: some View { ScrollView { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") .background(Color.orange) .padding(.bottom, 75) PhotosPicker(selection: $imagePicker2.imageSelection, matching: .images, photoLibrary: .shared()) { Label("", systemImage: "photo") } .font(.system(size: 55)) .padding(.bottom, 55) if let image = imagePicker2.image { HStack { image .resizable() .frame(width:75, height:75) .scaledToFit() .overlay(Rectangle().stroke(Color.teal, lineWidth: 2)) } } } .padding() } } } import SwiftUI import PhotosUI @MainActor class ImagePicker: ObservableObject { @Published var unableToLoad: Bool = false @Published var image: Image? @Published var myUIImage: UIImage? @Published var imageSelection: PhotosPickerItem? { didSet { unableToLoad = false if let imageSelection { //.. try to convert photosPickerItem imageSelection into a uiImage Task { try await setImage(from: imageSelection) } } } } func setImage(from imageSelection: PhotosPickerItem?) async throws { do { if let data = try await imageSelection?.loadTransferable(type: Data.self) { print("got image data") if let uiImage = UIImage(data: data) { print("converted to uiImage") self.image = Image(uiImage: uiImage) self.myUIImage = uiImage } } } catch { print(error.localizedDescription) unableToLoad = true } } } The image loads on the UI but I get "[ERROR] Could not create a bookmark: NSError: Cocoa 4097 "connection to service named com.apple.FileProvider" in the log every time I choose a new photo. So far, I haven't had an actual crash but others have indicated that depending on what they're doing code-wise, that some have crashed. Is this an iOS 18.x bug? Thoughts?
2
0
649
Feb ’25
Compiling old code with XCode give the error [XSym <- Unknown type name ‘Xsym’]
When I try to compile with XCode an app that is about 10 years old gives me the following compiler errors in JSONModel.h header file. There are only 4 lines in that file. Content of file with the error messages. XSym <- Uknown type name ‘Xsym’ 0075 <- Expected identifier or ‘(’ a7b090c047283ff76fc7f1def7ba7425 ../../../JSONModel/JSONModel/JSONModel/JSONModel.h The app was originally compiled wit XCode 3.2, targeting iPhone 7 Now I am using XCode 16, targeting iPhone 12. Original coder is unaccessible. I am very new to this environment and any guidance / assistance is greatly appreciated. Please let me know if it is more appropriate to post this somewhere else.
1
0
209
Feb ’25
Assistance Needed – Xcode: Command PhaseScriptExecution Failed with a Nonzero Exit Code
Main Issue: While building an iOS project using IL2CPP in Unity, I encountered the following error: Command PhaseScriptExecution failed with a nonzero exit code Sub-Issue: Unity is unable to detect a compatible iPhoneOS SDK, even though Xcode is correctly installed and functioning as expected. Error Message: Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed. Building for Apple Silicon requires Xcode 9.4 and Mac 10.12 SDK. Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select. It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements. More information and installation instructions can be found here: https://developer.apple.com/support/xcode/ Specific Xcode versions can be downloaded here: https://developer.apple.com/download/more/ Unable to detect any compatible iPhoneOS SDK! Additional Errors & Observations: bee_backend Not Found chmod: /Users/vaunicacalji/Desktop/DinoKite/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/bee_backend/mac-x86_64/bee_backend: No such file or directory Issue: Manually checking the file, bee_backend does exist and is executable, but the build process still reports it as missing. 2. IL2CPP Build Failure Build failed with 0 successful nodes and 0 failed ones Error: Internal build system error. BuildProgram exited with code 1. 3. Xcode Not Detected by Unity Unable to detect any compatible iPhoneOS SDK! Issue: Running xcode-select -p confirms that Xcode is installed at /Applications/Xcode.app/Contents/Developer, and xcodebuild -showsdks lists available SDKs, including iOS 18.2. Environment Details: macOS Version: Sonoma 14.5 Mac Model: MacBook Air (Retina, 13-inch, 2018) Processor: 1.6 GHz Dual-Core Intel Core i5 Memory: 8GB 2133 MHz LPDDR3 Graphics: Intel UHD Graphics 617 1536MB Unity Version: 2022.2.21f1 Installed Unity Modules: ✅ iOS Build Support ✅ Mac Build Support (IL2CPP) ✅ IL2CPP Current Status & Key Issues: ✅ Xcode is properly installed, and xcode-select -p shows the correct path. ✅ xcodebuild -showsdks confirms that iOS SDK 18.2 is available. ✅ bee_backend is present and executable when checked manually. ❌ Unity still reports Unable to detect any compatible iPhoneOS SDK! during the build process. ❌ Unable to successfully build the iOS project. Could you please provide guidance on how to resolve this issue? Xcode Build Settings (for reference): ALWAYS_SEARCH_USER_PATHS = NO ARCHS = arm64 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon CLANG_CXX_LANGUAGE_STANDARD = c++0x CLANG_CXX_LIBRARY = libc++ CLANG_ENABLE_OBJC_ARC = YES CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution CODE_SIGN_IDENTITY[config=Debug] = Apple Development CODE_SIGN_IDENTITY[config=Release] = Apple Distribution CODE_SIGN_STYLE = Manual DEVELOPMENT_TEAM[sdk=iphoneos*] = 4429TL28T7 IPHONEOS_DEPLOYMENT_TARGET = 15.6 LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks PRODUCT_BUNDLE_IDENTIFIER = com.torihiplay.DinoKite PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*] = DinoKite. SDKROOT = iphoneos SUPPORTED_PLATFORMS = iphoneos TARGETED_DEVICE_FAMILY = 1,2 UNITY_RUNTIME_VERSION = 2022.2.21f1 UNITY_SCRIPTING_BACKEND = il2cpp This build is intended for a production release. I would appreciate any help in resolving this issue. Thank you!
1
0
334
Feb ’25
What does the @__EntryDefaultValue macro expand to?
In Xcode 16.0 and 16.1, it was clear how @Entry macro works from the generated code. If you explicitly specify the type, then defaultValue is a computed property, if you do not specify the type, then a stored property. In Xcode 16.2, @__EntryDefaultValue has been added to the generated code, which Xcode does not want to expand. Visually, it seems that a stored property is generated, but the behavior shows that as a result we have a computed property, and for both options: with an explicit type and without an explicit type. So the question is: what does this @__EntryDefaultValue macro generate and is the result a bug? Or was it a bug in previous versions of Xcode?
1
0
331
Feb ’25