Post

Replies

Boosts

Views

Created

Frameworks, Libraries, and Embedded content versus Link Binary With Library
I'm experimenting with creating a Framework and have noticed a difference when dragging and dropping/or adding it into a project. If I create a brand new app and add the Framework then Xcode automatically creates a "Frameworks, Libraries, and Embedded" section within the app settings general section. The framework gets added with a default embed setting of Do Not Embed, which can be changed to Embed & Sign or Embed without Signing. However, I have an existing app which doesn't already contain a "Frameworks, Libraries, and Embedded section" section, if I add the framework to that app then Xcode is NOT creating a "Frameworks, Libraries, and Embedded section", instead it is adding the framework to the existing "Link Libraries with Binary" section. However this section does not have the embed box that a "Frameworks, Libraries, and Embedded" section has. Why is there this difference? And how can you choose whether to sign or not the framework if its been added by Xcode to the "Link Binary With Libraries" section rather than the "Frameworks, Libraries, and Embedded" section. I am finding that when Xcode adds the framework to the "Link Binary With Libraries" section and the app is run then there are run time errors about the framework not being able to be found, this does not occur when it gets added to the "Frameworks, Libraries, and Embedded" section. Is it possible to there explicitly create a "Frameworks, Libraries, and Embedded" section? I can't find one, nor can I get Xcode to create one, it keeps insisting on adding the Framework to "Link Binary With Libraries", which results in the app not running.
0
0
727
May ’24
Privacy manifests: how to identify which pod a category use is originating from?
I received an email from Apple saying the app is using: NSPrivacyAccessedAPICategoryDiskSpace NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPICategorySystemBootTime I'm not directly calling (afaik) any API that might be involved in getting the disk space, file timestamp, nor system boot time, so presumably these are indirectly originating in a pod whose api I'm using. However I have about 100 pods in the app, how can I know which one these are originating from? (100 seems a lot, but its a React Native app and that alone pulls in dozens and dozens of pods implicitly in addition those specified explicitly in a pod file) I can try and update all the pods to the latest version, but if the offending pod(s) hasn't added a manifest file, then I have no way of knowing which one it is - therefore I can neither contact them to ask when they will release a new version, nor can I attempt to try and remove the pod, because I just don't know which one might be causing the manifest warning. So what are we supposed to do in this situation?
3
2
6k
Mar ’24
PluginKit Code 4 error and fail to launch notification service extension
I've got an app which has a notification service extension (and has had so for a few years). I noticed that the pushes were getting delivered directly to the user for a handset, and in the log could see a SpringBoard error saying Error Domain=PluginKit Code=4 RBSLanchRequest error trying to launch plugin Error Domain=RBSRequestErrorDomain Code=5 Launch failed ErrorDomain=NSPOSIXErrorDomain Code=111 Unknown error:111 I rebooted the phone and it started working as expected. But it's worrisome this happened, and it's not the first time I've seen it either. Observed with iOS 17.3.1
1
0
792
Mar ’24
URLSession doesn't use http3 on first connection even though server advertised it?
I don't follow the section in the wwdv video on http3 https://developer.apple.com/videos/play/wwdc2021/10094/ From about 07.00 onwards for a couple of minutes, the presenter says URLSession won't use http3 unless the server advertises it. Then he uses instruments to show the app is using http2 - BUT the server is advertising http3. Then he says the fact the server advertised http3 will be remembered for future sessions. Why does the app use http2 for the first session even though the server advertised http3? Does that mean the first time any app connects to a http3 server it'll actually be http2 and only http3 for subsequent connections?
0
0
475
Feb ’24
Developer cert says revoked on one Mac but not on another
I've installed the same developer certificate onto three different Macs. When viewed in the keychain (or in Xcode) on one Mac it says its revoked, on another it says its not trusted, but on a third there's no issue reported. How could there be a difference between the three Macs? (Both Macs have the date/time set to be the same). Can 3rd party software, VPNs etc. interfere in this at all?
1
0
718
Feb ’24
Can React Native's Metro and Xcode's LLDB interfere with each other
Trying to run a React Native app via Xcode can be very very very slow. Excruciatingly so. I often see messages saying things like Launching app is taking longer than expected. LLDB is likely reading from device memory to resolve symbols. But I see this all the time, if that's what it's doing it never finishes, and does it every time. This isn't just with one phone, its with several. Is it possible there some fundamental conflict between Xcode and LLDB and React Native Metro trying to communicate / load / debug / whatever that slows things down to a standstill?
2
1
954
Feb ’24
UNUserNotificationCenter.current().removeDeliveredNotifications() is hanging
An app is hanging randomly on app launch, after looking into it, it appears it's hanging on a call to UNUserNotificationCenter.current() calls. I say this because there's logging and the sometimes the last line logged is prior to a call to UNUserNotificationCenter() I have a hang log (.ips file) rom the iPhone and at the bottom it says this. I presume blockingThreadInfo is talking about the thread being blocked, and it identifies the topBlockingProcess as user notifications. "blockingThreadInfo" : { "topBlockingProcess" : "usernotificationsd", The following is the code, why would this code cause a hang? The problem occurs when there's lots of notifications that have been posted i.e. something like 100. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appBecameActive) name: UIApplicationDidBecomeActiveNotification object:nil]; @objc func appBecameActive() { method1() method2() } @objc func method1() { UNUserNotificationCenter.current().getDeliveredNotifications { notifications in if SettingsManager.isProductionFinalBuild() == false { // Log notification center contents for notification in notifications { let title = notification.request.content.title let targetId = notification.request.content.targetContentIdentifier let threadId = notification.request.content.threadIdentifier let categoryIdentifer = notification.request.content.categoryIdentifier let identifier = notification.request.identifier let info = notification.request.content.userInfo Logger.trace("Previously delivered notification: title: \(title) identifier: \(identifier) threadId: \(threadId) category: \(categoryIdentifer) target id: \(String(describing: targetId)) userInfo: \(info)") } let matchchingNotifications = notifications.filter({ $0.request.identifier == kMdnAccountNotFoundNotificationIdentifier }) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [kMdnAccountNotFoundNotificationIdentifier]) } } func method2() { UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [Constants.kWhatsNewNotificationIdentifier]) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [Constants.kWhatsNewNotificationIdentifier]) }
1
0
919
Feb ’24
App hang - .ips files differ but all mention logging?
My app has occasionally randomly started hanging. I have extensive logging in it, so you'd think it'd be easy to find out where its hanging (look at the last line logged etc.) However its hanging at different places each time it runs, so its impossible to debug. I've got several .ips files from off the handset, and they're all different. But a few of them have the same pattern at the top which is: 0 __unlock_wait2 NSLog If I open some in Xcode, it doesn't display any useful info or jump to a line of my code, it shows "deferred_logger". What do these mean? The common theme of mentioning logging can't be a co-incidence? Is there something wrong with the logging, is it being overloaded or something? If I turn off verbose logging to reduce the amount, the issues still persist, implying its not an overloaded logging situation. What could be going on?
0
0
432
Feb ’24
Interpreting a hang log
I have a hang log, too large to copy past all of it here. It showing [NSNotificationCenter postNotificationName:object:userInfo:] in the stack. Does that mean there was a hang attempting to post a notification? How could that cause a hang, once the app posts a notification its out of its hands and in the hands of the OS. Or is that a red herring? How do I attach the full .ips file? When trying to add it via the Add File option, its grey and not selectable, if I change the extension .txt it says its too large to attach. Also how to format this? Copy/pasting it looks fine, but after hitting the save button all the formatting is lost. Formatting it as quote or code block also looses it all. Event: Timed Out Runloop Hang Duration: 9.99s Duration Sampled: 3.57s Steps: 344 (10ms sampling interval) Report threshold: 2s `Heaviest stack for the main thread of the target process: 344 start + 2240 (dyld + 24012) [0x1d8996dcc] 344 ??? (CallFilter + 69812) [0x10006d0b4] 344 UIApplicationMain + 340 (UIKitCore + 2276456) [0x1b8080c68] 344 -[UIApplication _run] + 888 (UIKitCore + 2278956) [0x1b808162c] 344 GSEventRunModal + 164 (GraphicsServices + 13560) [0x1f91de4f8] 344 CFRunLoopRunSpecific + 608 (CoreFoundation + 210040) [0x1b5c5d478] 344 __CFRunLoopRun + 828 (CoreFoundation + 211096) [0x1b5c5d898] 344 __CFRunLoopDoSources0 + 340 (CoreFoundation + 215996) [0x1b5c5ebbc] 344 __CFRunLoopDoSource0 + 176 (CoreFoundation + 222120) [0x1b5c603a8] 344 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CoreFoundation + 225580) [0x1b5c6112c] 344 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 (FrontBoardServices + 41848) [0x1ce0c4378] 344 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 (FrontBoardServices + 42144) [0x1ce0c44a0] 344 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52 (FrontBoardServices + 42272) [0x1ce0c4520] 344 _dispatch_block_invoke_direct + 284 (libdispatch.dylib + 32072) [0x1bdc24d48] 344 _dispatch_client_callout + 20 (libdispatch.dylib + 17152) [0x1bdc21300] 344 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 352 (FrontBoardServices + 106380) [0x1ce0d3f8c] 344 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FrontBoardServices + 57756) [0x1ce0c819c] 344 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.108 + 280 (FrontBoardServices + 62832) [0x1ce0c9570] 344 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 324 (FrontBoardServices + 63188) [0x1ce0c96d4] 344 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288 (UIKitCore + 2422752) [0x1b80a47e0] 344 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 508 (UIKitCore + 2423368) [0x1b80a4a48] 344 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 (UIKitCore + 1274564) [0x1b7f8c2c4] 344 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 (UIKitCore + 1274964) [0x1b7f8c454] 344 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.225 + 612 (UIKitCore + 4964520) [0x1b83110a8] 344 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 (UIKitCore + 1278672) [0x1b7f8d2d0] 344 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 (UIKitCore + 1279520) [0x1b7f8d620] 344 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 (UIKitCore + 1281432) [0x1b7f8dd98] 344 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148 (UIKitCore + 1281680) [0x1b7f8de90] 344 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 248 (UIKitCore + 1281984) [0x1b7f8dfc0] 344 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 608 (UIKitCore + 1283672) [0x1b7f8e658] 344 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 332 (UIKitCore + 1289296) [0x1b7f8fc50] 344 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 (UIKitCore + 2175308) [0x1b806814c] 344 _UIScenePerformActionsWithLifecycleActionMask + 112 (UIKitCore + 1621112) [0x1b7fe0c78] 344 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke_2 + 108 (UIKitCore + 1621280) [0x1b7fe0d20] 344 -[UIApplication _stopDeactivatingForReason:] + 1240 (UIKitCore + 1623808) [0x1b7fe1700] 344 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (Foundation + 173988) [0x1b4bee7a4] 344 _CFXNotificationPost + 724 (CoreFoundation + 188728) [0x1b5c58138] 344 _CFXRegistrationPost + 440 (CoreFoundation + 191464) [0x1b5c58be8] 344 ___CFXRegistrationPost_block_invoke + 88 (CoreFoundation + 191648) [0x1b5c58ca0] 344 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 148 (CoreFoundation + 193240) [0x1b5c592d8] Thread 0x403e DispatchQueue "com.apple.main-thread"(1) 344 samples (1-344) priority 47 (base 47) 344 start + 2240 (dyld + 24012) [0x1d8996dcc] 344 ??? (CallFilter + 69812) [0x10006d0b4] 344 UIApplicationMain + 340 (UIKitCore + 2276456) [0x1b8080c68] 344 -[UIApplication _run] + 888 (UIKitCore + 2278956) [0x1b808162c] 344 GSEventRunModal + 164 (GraphicsServices + 13560) [0x1f91de4f8] 344 CFRunLoopRunSpecific + 608 (CoreFoundation + 210040) [0x1b5c5d478] 344 __CFRunLoopRun + 828 (CoreFoundation + 211096) [0x1b5c5d898] 344 __CFRunLoopDoSources0 + 340 (CoreFoundation + 215996) [0x1b5c5ebbc] 344 __CFRunLoopDoSource0 + 176 (CoreFoundation + 222120) [0x1b5c603a8] 344 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CoreFoundation + 225580) [0x1b5c6112c] 344 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 (FrontBoardServices + 41848) [0x1ce0c4378] 344 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 (FrontBoardServices + 42144) [0x1ce0c44a0] 344 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52 (FrontBoardServices + 42272) [0x1ce0c4520] 344 _dispatch_block_invoke_direct + 284 (libdispatch.dylib + 32072) [0x1bdc24d48]
1
0
589
Feb ’24
iOS app/OS behavior with heavy background processing and differences between Xcode/Testflight/App Store
I'm analyzing an app which is doing some processing with contacts, and stress testing it with tens and tens of thousands of contacts which are being processed. The code is being processed within DispatchQueue.global(qos: .background).async {) When the app moves to the foreground the processing starts and continues after the app moves to the background. What I've noticed is that if the app is downloaded from TestFlight, then ~20 seconds after moving to the background, a dialog is displayed saying the App Crashed. Though it hasn't actually "crashed" in the usual sense of crash - there's no crash log present on the device nor in TestFlight if the crash is reported nor is there anything reported to Crashlytics. In addition the is still displayed in the iPhone task manager, also ApplicationWillTerminate() isn't called so it wasn't killed by the OS. This doesn't happen if the app is installed via Xcode and then run (not run via Xcode, installed via Xcode, then run independently from Xcode). When running via TestFlight installation I can see the OS logging" ReportCrash recordCrashEvent; isBeta 1 app stored Received a beta app crash notification. What's going on here, why is TestFlight reporting this? Is it erroneously reporting the background processing after 20 seconds as a crash? Is there anything the app should be doing in this situation that it isn't? Otherwise why is TF popping up that dialog?
0
0
620
Feb ’24
Where's this contacts logging coming from?
When I run my app there's lots of logging in the console appearing, with it appearing with my app's name as the process. My app is accessing contacts, however I'm not logging this, so is the OS? The thing is, I'm testing performance with contacts databases which have thousands of entries in them, not only is this logging cluttering up the console making it difficult to examine, but I think the logging of so many thousands of line is affecting performance. Where is it coming from? Can it be turned off?
0
0
651
Feb ’24
How can you run Instruments/Logger with a TestFlight app?
If I try to run Instrument's logger for an app downloaded from TestFlight it says "Permission to debug app name was denied". "Recover Suggestion: The app must be debuggable and signed with 'get-task-allow'. How do you make the app debuggable? (I tried creating an archive with the scheme set to Debug, but after uploading that to TestFlight, it doesn't appear. So presumably its not possible to upload an app built with debug scheme builds to TF?). Therefore how can I make a TF build debuggable?, and how to sign it with get-task-allow? Does it have to be a developer distribution .ipa rather than a TestFlight build to enable Instruments/Logger to run it?
2
1
1.6k
Feb ’24
Massive difference in time taken to scan contacts/perform action in Xcode versus TestFlight
I'm looking at some inefficient code that somebody wrote that repeatedly searches contacts within a loop, and that loop can execute hundreds or thousands of times. If I run the app via Xcode then its taking 20-30 seconds to execute, but if the app is downloaded from Testflight and run, the same code runs in less than a second. I'm presuming this difference is due to the scheme being debug for Xcode run but release for the archive scheme? Can the debug scheme really have such an enormous impact?
2
0
567
Feb ’24