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 15 console logging of system messages
Background I have a SwiftUI app that uses OSLog and the new Logger framework. In my SwiftUI views, I would like to use something like Self._logChanges() to help debug issues. After some trial and error, I can see the messages appear in the System console log for the app I am debugging using the com.apple.SwiftUI subsystem. Problem I'd like to see those same messages directly in Xcode's console window so I can filter them as needed. How do I do that? Thanks! -Patrick
4
1
2.3k
Mar ’25
Watch: WCSession is NOT reachable
** Facing issue for watch unreachable, I have tried for real device as well simulator** if let controller = window?.rootViewController as? FlutterViewController { let channel = FlutterMethodChannel( name: "watchconnectivity", binaryMessenger: controller.binaryMessenger) channel.setMethodCallHandler({ [weak self] (call, result) in switch call.method { case "sendToWatch": guard let watchSession = self?.session else { print("❌ Watch session not initialized") result(false) return } guard watchSession.isPaired else { print("❌ Watch not paired") result(false) return } guard watchSession.isReachable else { print("❌") print("isPaired: \(watchSession.isPaired)") print("isWatchAppInstalled: \(watchSession.isWatchAppInstalled)") print("isComplicationEnabled: \(watchSession.isComplicationEnabled)") result(false) return } guard let arguments = call.arguments as? [String: Any] else { print("❌ Invalid arguments format") result(false) return } if watchSession.isWatchAppInstalled { try? watchSession.updateApplicationContext(["forceLaunch": true]) } print("📤 Sending message to Watch: \(arguments)") watchSession.sendMessage(arguments, replyHandler: { response in print("✅ Message sent successfully") result(true) }, errorHandler: nil ) default: result(FlutterMethodNotImplemented) } }) }
1
0
169
Mar ’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
71
Mar ’25
The iPad software keyboard becomes impossible to show programmatically when an external keyboard is connected.
When an external keyboard is connected to the iPad, the software keyboard often becomes hidden and cannot be made to show again programmatically. Help! Is there a way to programmatically get the software keyboard to re-appear when an external keyboard is connected without clicking 'Show Keyboard' from the Keyboard Shortcuts menu-item button? Its corner-casey for sure, (with our own keyboard extension) we have a sub-view that is added to the software keyboard view under a certain use case. When the user has an external keyboard connected, everything is fine until the app is backgrounded. When the app is re-foregrounded the software keyboard often becomes hidden (what the user now sees is a keyboard shortcut menu-item group w/a keyboard button and a mic button.) This makes it impossible for the user to interact with the subview we added (because it is hidden), unless the user manually shows the software keyboard again by clicking "Show Keyboard" from the keyboard shortcut. The software keyboard view is still the 'firstResponder' (accepting key strokes, etc), we just cannot find a way to programmatically make it visible again. Sigh.
1
0
100
Mar ’25
TestFlight group selection disabled for 'Ready to Test' build — Tried 3 builds, same issue
Hello, I uploaded a new iOS build (1.0.1 - Build 180) to App Store Connect for my app "Benimle Konus". The build has been processed successfully and is marked as "Ready to Test". However, when I try to assign this build to any internal TestFlight group, the group checkboxes are greyed out and cannot be selected. I’ve made sure that: All required metadata is filled out. What’s New and compliance information is complete. Previous builds worked with the same TestFlight groups. To fix this, I have uploaded 3 separate builds, but the issue still persists with all of them. There are no error messages, but I can't continue testing because I can't assign the build to testers. App ID: 6742759002 Bundle ID: com.benimlekonus.app Build Version: 1.0.1 (180) Is this a known issue or something I'm missing? Any help would be appreciated.
16
13
1.2k
Mar ’25
Invalid binary for tvOS app which integrates an xcframework
We're building an SDK (let's call it MyFramework) which is distributed as an .xcframework for developers to integrate it into their own apps. Recently, we've added tvOS support by adding it as a supported destination for the SDK. Essentially, the SDK became a cross-platform framework and easy to be adopted in both iOS and tvOS apps. The .xcframework is generated fine, all builds correctly. We've tested the SDK integrated in test apps. We've also submitted an iOS archive app to the AppStore connect, just to make sure all is well with the AppStore submission. However, when I tried submitting a tvOS archive app (that integrates the same SDK) to the AppStore connect, the build was marked as invalid binary and we've got the following error message: ITMS-90562: Invalid Bundle - One of the nested bundles is built for a platform which is different from the main bundle platform. Please make sure that all bundles have correct platform specification. First, I thought that any of the modules of the framework was not correctly configured for tvOS but that was not the case. Everything compiles ok and it runs in debug as expected. It only fails when trying to submit the tvOS app that integrates the SDK. After a lot of investigating, we realised that the reason for the AppStore submission error is because we codesign the framework. We use codesign to distribute it as cryptographically signed xcframework. codesign --timestamp -v --sign "Apple Distribution: Company (xxxxxxxxxx)" "MyFramework.xcframework" As soon as we remove the above line from our CI/CD pipeline that generates the xcframework, and submit a tvOS archive app that integrates the unsigned framework, the AppStore submission error goes away and the TestFlight build can be tested. I've also tried to just strip the _CodeSignature folder from the .xcframework package but it still fails. So the only solution currently is to not codesign the xcframework to be able to upload tvOS archive apps that integrate the SDK to the AppStore connect. However, we're still puzzled as to why only the tvOS archive app gets the invalid binary error when it integrates a signed SDK. I feel like the error message is quite misleading if we have to stop signing the SDK xcframework for it to be accepted during the AppStore submission. Anyone has any idea? Or has anyone encountered a similar issue? Thanks!
0
0
126
Mar ’25
Xcode cloud: xcode build archive error
Hello! I'm trying to build my flutter app through xcode cloud, but im getting following error: Command exited with non-zero exit-code: 65 Run command: 'xcodebuild archive -workspace /Volumes/workspace/repository/ios/Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -archivePath /Volumes/workspace/build.xcarchive -derivedDataPath /Volumes/workspace/DerivedData -resultBundleVersion 3 -resultBundlePath /Volumes/workspace/resultbundle.xcresult -resultStreamPath /Volumes/workspace/tmp/resultBundleStream97053cd8-9db9-41c6-9dc8-a9fc142bacb6.json -IDEPostProgressNotifications=YES CODE_SIGN_IDENTITY=- AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM={development_team_here} COMPILER_INDEX_STORE_ENABLE=NO -hideShellScriptEnvironment' When i build locally, it works fine, tried both debug/release modes, but in the cloud archive fails. Also have following message in xcode cloud: `'Flutter/Flutter.h' file not found GeneratedPluginRegistrant.h:10` failed to emit precompiled header '/Volumes/workspace/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/Runner/PrecompiledHeaders/Runner-Bridging-Header-swift_2QGFV1FVTQX2Z-clang_IX5TH88559CY.pch' for bridging header '/Volumes/workspace/repository/ios/Runner/Runner-Bridging-Header.h'
1
0
138
Mar ’25
Value column missing for Info.plist
Here's what my Info.plist looks like: The problem here is that there is no value column. No where for me to edit the values. It's driving me insane. I can edit in a vanilla text editor, but it's annoying to use the auto complete feature here and then open a text editor to change the value. Anyone know why this could be happening? Am I just missing a setting toggle somewhere?
4
0
69
Mar ’25
How to implement a CoreML model into an iOS app properly?
I am working on a lung cancer scanning app in for iOS with a CoreML model and when I test my app on a physical device, the model results in the same prediction 100% of the time. I even changed the names around and still resulted in the same case. I have listed my labels in cases and when its just stuck on the same case (case 1) My code is below: https://github.com/ShivenKhurana1/Detect-to-Protect-App/blob/main/DetectToProtect/SecondView.swift I couldn't add the code as it was too long so I hope github link is fine!
1
0
111
Mar ’25
Call Tracking with CallKit Works in Debug Mode but Not in Release (TestFlight) – iOS
I am working on an iOS app using Flutter that tracks outgoing calls using CallKit. The call tracking functionality works perfectly in Debug mode but does not work when the app is published to TestFlight. I have already added Background Modes (voip, audio, processing, fetch) in Info.plist. I have added CallKit.framework in Xcode under Link Binary With Libraries (set to Optional). <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>aps-environment</key> <string>production</string> </dict> </plist> These are the necessary permission which I used in info.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BGTaskSchedulerPermittedIdentifiers</key> <array> <string>com.agent.mygenie</string> </array> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> <string>MyGenie</string> <key>CFBundleDocumentTypes</key> <array/> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>mygenie</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>$(FLUTTER_BUILD_NAME)</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>$(FLUTTER_BUILD_NUMBER)</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSCallKitUsageDescription</key> <string>This app needs access to CallKit for call handling</string> <key>NSContactsUsageDescription</key> <string>This app needs access to your contacts for calls</string> <key>NSMicrophoneUsageDescription</key> <string>This app needs access to microphone for calls</string> <key>NSPhotoLibraryUsageDescription</key> <string>This app needs access to photo library for profile picture updation</string> <key>UIApplicationSupportsIndirectInputEvents</key> <true/> <key>UIBackgroundModes</key> <array> <string>voip</string> <string>processing</string> <string>fetch</string> <string>audio</string> </array> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> [code.txt](https://developer.apple.com/forums/content/attachment/0a327dbd-652e-41d5-8811-c462d09e0567) </dict> </plist> And below is the file are AppDelegate.swift, call_tracking_mixin.dart, & main_call.dart file for full knowledge
0
0
80
Mar ’25
Xcode App Crashing after Initial Launch
I'm quite new to Xcode development, and I've been having an issue test-running my app. When I run the app on my iPhone from my Mac, the app launches properly and works initially. However, when I close the app fully and try to reopen it, it keeps crashing. This occurs whether I test on a physical device or an iPhone simulator. Somehow, this issue does not occur when the app is run on Profile mode. I would appreciate any pointers to debug this.
2
0
74
Mar ’25
The Xcode project keeps crashing on launch
Hello, I need a little bit of help. My game keeps crashing on launch no matter what I do. I’ve tried running it in Xcode on my Mac, on my iPhone, and through TestFlight, but I get the same result every time. I’ve tried everything I could find on the internet, and nothing worked. Asking here is my last resort because I’m completely stuck. The game runs fine in Unity, but not so much in Xcode. Can someone help me figure out what I’m doing wrong?Any help would be greatly appreciated. Here is the error log I found by connecting my iPhone to my Mac. To view the logs, I used the Console in the Devices and Simulators section of Xcode. ➤ SecKeyVerifySignature failed: Error Domain=NSOSStatusErrorDomain Code=-50 "rsa_pub_crypt failed" [10:27:36.034791+0200] kernel ➤ Sandbox: [App] deny(1) sysctl-read kern.bootargs [10:27:36.043389+0200] SpringBoard ➤ Live host view super view[(null)] not matching container view ➤ Frame not updated [10:27:36.050473+0200] backboardd ➤ Cycle detected [10:27:36.100799+0200] SpringBoard ➤ Live host view super view[(null)] not matching container view [10:27:36.538361+0200] akd ➤ Error fetching keychain item - Error Domain=NSOSStatusErrorDomain Code=-25300 "no matching items found" [10:27:36.545734+0200] akd ➤ Failed to set last known MID with error (Error Domain=NSOSStatusErrorDomain Code=-25300) [10:27:36.603384+0200] rtcreportingd ➤ Gap in hierarchy: [10:27:36.604536+0200] cloudd ➤ TCP input flags=[R.] state=LAST_ACK [10:27:36.613317+0200] cloudd ➤ TCP input flags=[R] state=CLOSED [10:27:36.648449+0200] kernel ➤ 1 duplicate report for Sandbox: [App] deny(1) sysctl-read kern.bootargs [10:27:36.648484+0200] kernel ➤ Sandbox: [App] deny(1) file-test-existence /private/var/Managed Preferences/mobile/com.apple.CoreMotion.plist [10:27:36.900275+0200] CommCenter ➤ Client is not entitled for request [10:27:37.131555+0200] storekitd ➤ AMSURLSession: Session decoder failed. Error = Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" [10:27:37.131761+0200] storekitd ➤ AMSURLSession: Task completed with error = Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" [10:27:38.137847+0200] kernel ➤ System Policy: [Process] deny(1) file-read-metadata /private/var/mobile/Library/Biome/FlexibleStorage [10:27:38.779536+0200] kernel ➤ Sandbox: [App] deny(2) file-test-existence /private/etc/localtime [10:27:38.942342+0200] mobileassetd ➤ TCP input flags=[R] state=LAST_ACK [10:27:38.963596+0200] kernel ➤ Sandbox: [App] deny(2) file-test-existence /bin/bash [10:27:40.152019+0200] mobileassetd ➤ TCP input flags=[R] state=LAST_ACK [10:27:40.280661+0200] assetsd ➤ Warning: cache_handle_memory_pressure invokedPreformatted text```
2
0
253
Mar ’25
Can't build onto iPhone 16e with XCode 16.1
I'm trying to debug on my iPhone 16e and I'm running into this error: Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) Since all of my other devices are working fine, I assume this is due to outdated XCode, which is something I see mentioned in other threads. What is the specific XCode version needed to build onto the 16e and is there any workaround for XCode 16.1? Thanks!
3
0
194
Mar ’25
Abnormal UI and Keyboard Behavior in iPhone App Running on iPadOS 18.x Built with Xcode 16
Case-ID: 12591306 Use Xcode 16.x to compile an iPhone demo app and run it on an iPad (iPadOS 18.x) device or simulator. Launch the iPhone app and activate Picture-in-Picture mode. Attempt to input text; the system keyboard does not appear. Compare the output of [[UIScreen mainScreen] bounds] before and after enabling Picture-in-Picture mode, notice the values change unexpectedly after enabling PiP. This issue can be consistently reproduced on iPadOS 18.x when running an app built with Xcode 16.0 to Xcode 16.3RC(16E137). Beginning April 24, 2025, apps uploaded to App Store Connect must be built with Xcode 16 or later using an SDK for iOS 18, iPadOS 18, tvOS 18, visionOS 2, or watchOS 11.Therefore, I urgently hope to receive a solution provided by Apple.
1
0
98
Mar ’25
Build Libraries For Distribution flag usage
I want to build an ios .xcframework (for external delivery) and .framework(for internal debugging) in order to package some code to a customer for incorporation into their app. My framework has a dependency upon RealmSwift, which I've added using SPM. There is a warning saying Module RealmSwift was not compiled with library evolution support. And when building SwiftVerifyEmittedModuleInterface fails with an error saying "missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'" By default, Build Libraries For Distribution was set to YES, however if I turn it off then the warning and error go away and I can cleanly build the framework. I've been attempting to get a good understanding of this flag and if it should be used or not, most material says yes but doesn't go a good job of explaining why. However anyway I can't get the framework to build with RealmSwift as a dependency without turning off this flag. Therefore is that ok to proceed down that route? Does the fact the xcframework will only ever be distributed to one consumer affect decisions (i.e. binary compatibility etc.) Thanks
0
0
86
Mar ’25