Post

Replies

Boosts

Views

Activity

Message filtering extension appears on one phone but not another
I created a message filter extension, then edited only a few lines from the template source code (for example to return something in the capabilities query). However no matter what I do, I just cannot get the app to appear in the Settings app - when I turn on "Filter Unknown Senders" there's nothing that appears to select my app. I've tried rebuilding, deleting/reinstalling the app, restarting the phone, it just won't appear. But then I switched to another phone, and with this phone, when I turn on "Filter Unknown Senders" my app does appear and can be selected and enabled. But I still cannot get this to happen on the first phone. Why does the exact same app, exact same build of the app to be precise, appear on one phone but not the other? The phone it works on has iOS 17.2.1 and the phone it doesn't work on has iOS 17.1.1
1
0
722
Jan ’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
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
652
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
623
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
590
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
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
920
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
719
Feb ’24
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
728
May ’24
Options for switching between incorporating binary and/or source code within an app
Our company is going to develop an iOS library of functionality for inclusion in several apps, some of the apps will be developed in-house and some externally. When the library is included in external apps the source code shouldn't be visible. When the library is included in internal apps, having the option to view and step through the code within the library will be invaluable for debugging. How could I set things up so that two forms of the library can be easily generated - one exposing source code and the other not. Ideally they should be capable of being incorporated within the apps in the same manner regardless of if the source code is expose or not Is that possible? I looked at Swift Packages, but it seems its for distribution of source code only, and its not possible to hide the source code. However, conversely, a framework only contains binary and no source code. Is there any other option?
0
0
433
Jun ’24
Is there anyway to view output from an Xcode scheme's build pre-action / verify it completed successfully?
I've got a custom run script build phase in my Xcode iOS project, however I want it to run before the items in the Target Dependencies section get built. So I added a Pre-Actions phase to the target's build scheme and pasted the contents there. However, during a build, there's no way to see if the stuff in the pre action is successful or not. It's possible to put echo statements into a run script build phase which is useful to print values such as file paths etc. but these don't work when part of a scheme pre action. Also if I deliberately put garbage into the scheme pre action, then I can see Xcode is still running the pre action, but as its full of garbage it should fail, but Xcode doesn't report any errors anywhere. So, is there any way to see and confirm if a scheme pre-action was successful or not, or to output logging statements from it to verify values its using are as expected?
0
0
631
Jun ’24
What happened to logging in a Message Filter Extension on iOS 18?
If an app with a Message Filter Extension is run on an iPhone with iOS 18 installed then there's no logging output to the console (using print or NSLog), however there is logging in all previous versions of OS. Being able to view logging at run time for this component is essential as a debugging aid to see, for example, if the extension launches, if a text is handled locally or deferred to the network, to see if there's a network error, to examine the server response etc. Is there a specific reason it was disabled or is it accidental? Thank you
2
0
649
Oct ’24
Is Xcode 16 a battery drainer?
I've got a 2023 M2 MacBook Pro and used to get great battery life out of it (> 6 hours when using it for development purposes). Now however, all of a sudden, that has dropped off a cliff, and the only thing that has changed is Xcode 16 has appeared. As I'm compiling a project I can literally see the % amount of the battery charge remaining tick down in front of my eyes as I watch. I just compiled a project twice and during that time the battery dropped from from %89 to %79 and Xcode is listed as a culprit using significant battery drain. Anybody else noticed anything similar? Anything that can be done to to decrease Xcode's battery drain?
2
0
443
Oct ’24
Does the iOS simulator append any different HTTPs headers to an iPhone?
I've got a bit of code which is making a HTTPS GET request. On an iPhone it runs as expected, however when running on the simulator there's a HTTP 400 response. I've logged the url and my http headers that I'm adding, and in both cases they are identical for the simulator and iPhone (there is no http body content). Therefore, as everything is identical, I'm wondering how it could work with hardware and not with the simulator? Does the OS append any additional HTTP headers before the request goes out (such as User-Agent for example) and might those be different between iPhone/simulator?
0
0
425
Oct ’24