** 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)
}
})
}
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi - I've added in-app purchases (Quarterly and Yearly
) to my app and submitted it for TestFlight. The app is available, but in my Developer account, the in-app purchases section still shows the products as 'Waiting for Review.'
When I test the app for in-app purchase, the dialog does not appear. Is this issue of "Approval" of the in-app purchase product?
If YES, how can I get approval for these in-app purchase products?
FYI: I have attached a screenshot of the in-app purchase products.
Please suggest
Thanks,
Sushil
When trying to build and run our iOS app on the simulator we're hitting the following error:
Could not attach to pid: "XXXXX"
failed to get reply to handshake packet within timeout of 6.0 seconds
I've included some more details on our project/setup below:
We're working on a large project with multiple schemes / app targets.
The error only affects one of our targets - however the dependencies between the problematic target and the others are very similar.
The issue only affects building to the simulator; building to a physical device works fine.
Scheme configuration is the same across all targets.
We've faced this issue on multiple versions of Xcode, from 15.x through to the latest 16.3 RC.
We've tried a number of workarounds, some of which work intermittently for some colleagues - but none of which have provided a durable solution. These include varying combinations of:
Setting the IDEPreferLogStreaming=YES environment variable
Unchecking Debug Executable under Edit Scheme -> Run
Manually launching the app on the Simulator and then attaching the debugger using Debug -> Attach in Xcode
Erasing all contents and settings on the simulator (this sometimes fixes things for a single build, but we run into the same issue again for all subsequent builds, and it doesn't work for all developers).
Clearing out Derived Data and running a clean build (this doesn't seem to help).
We'd really appreciate any input on how we can diagnose what's causing this issue or any suggested steps to help resolve it.
第一次接触swift编程,swift playground里面编程入门挺简单的,因为英语也不好,不知道怎么入手了
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!
We have a rather complex network of dependencies for our application stack and, from it, we create multiple unique executables that are placed into the Contents/MacOS directory of our bundle.
MyApp.app
`- Contents/
`- Frameworks/...
`- MacOS/
`- exec_a
`- exec_b
`- Resources/...
Both executables require the same dependencies (and use the same shared .dylib files built as targets in the same project) so it makes sense for them to be in the same place rather than in their own .app folder as I understand it.
Qt Libs -> core_lib.dylib -> gui_lib.dylib -> exec_a
`-> exec_b
etc.
We've confirmed build artifacts are correct and the rpath/dependencies are all clean. When in development, all executables run as expected and we can command exec_a (the executable we're listing in the primary Info.plist) to launch exec_b at any time.
Once the bundle is signed, however, we cannot get exec_b to launch in any capacity. Even lldb dies right away because it can't attach to anything. We assume this is something in the gatekeeper area of blocking these additional executables.
We get the following when trying to run those additional exes in any way:
Trace/BPT trap: 5
We're using macdeployqt to finalize the bundle and bring in the correct packages - perhaps something it's doing is causing the additional executables to fail or we're missing an entitlement.
We've submitted the app to TestFlights successfully even with these invalid executables to see if there was something the processing of the app would find but so far nothing.
We've seen other example of applications with multiple executables in the same MacOS directory and are wondering what the difference is. Any hints or guidance would be great. Thank you!
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.
Topic:
App Store Distribution & Marketing
SubTopic:
TestFlight
Tags:
iPhone
Xcode
TestFlight
Testing
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
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!
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.
I just noticed this today while building a React Native app.
Anybody else seen this and know what it means/how to track it down/how to fix it
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!
I've used SPM to install some dependencies, however for one of them, CocoaLumberjackSwift the Embed section is blank and attempting to click in it doesn't brink up any dropdown menuetc.
Why is that, how can I change it or check what its set to if its blank?
(Code 16.2)
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'
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
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```
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.
I've been trying to upload my app to the App Store with Xcode 16.3 RC but I keep getting these error messages. When will Apple start allowing Xcode 16.3 submissions?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Xcode
Organizer Window
I'm seeing a build failure when archiving for TestFlight due to removing landscape support from the project. I see tons of apps that lock portrait in the app store. Is this a new requirement for apps compatible with both iPhone and iPad? What is the best approach if I am focused on portrait? Make the app iPhone only?
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
Design
Xcode
Interaction Design
Accessibility
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?