Looking at some tutorials on how to create a swift package (for iOS) they all start by creating a package within Xcode and then showing what files Xcode auto-generated.
However with Xcode 15.1 there's lots of stuff mentioned in tutorials which isn't getting created, for example the readme file, the licenses file, a documentation directory and contents.
Why is it not creating them? How to add them manually then? Because File/New doesn't have the option to create a Readme.md file for example.
Post
Replies
Boosts
Views
Activity
I want to implement a scheme whereby the server gets instructed by the app during a handshake whether the server should send pushes over the Apple sandbox environment or the production environment.
There's several variations where the push environment will vary depending upon the circumstances:
Debug build/scheme with app installed via XCode
Release build/scheme with app installed via XCode
Developer distribution installed via .ipa/Apple Configurator app
Ad hoc distribution installed via .ipa/Apple Configurator app
App is installed from Testflight
App is installed from the app store
Is there a way the app can programmatically detect at run time which push server should be used and thus it can instruct the server accordingly during its handshake with it?
I guess this boils down to if the app is able to programatically detect at run time if there's a production provisioning profile being used or not? Or is there some other mechanism to detect which push server should be used?
There's a couple questions/answers on Stackoverflow about programatically detecting if a provisioning profile is present but they look a bit hacky and I don't know if they can be trusted to be future proof.
Xcode has had the ability to debug app extensions for many years.
However, several years ago it used to be so bad as to be unusable (extremely slow to load, very slow to run, and just utterly utterly unreliable).
I'm glad to say this situation changed and for the past few years its been great, interactively running app extension with Xcode 14.2 or 14.3 is as stable and almost as quick as interacting with the main app.
But unfortunately there's been a big step back in reliability in Xcode 15.
Many times with Xcode 15 it just stops working, its just not possible to step into the code, stop at a breakpoint for app extensions.
It's not like this all the time, sometimes it works just fine, but the problem is quite often it just stops working (by not working I mean breakpoints set in an app extension aren't hit, despite the path of control going through them and the extension being selected as the scheme to execute)
The problem is once it stops working there's no way I've found to get it working again, restarting XCOde, rebuilding, restarting the phone, none of this works. Once Xcode has decided to stop working for debugging app extensions there's no apparent way to get it going again.
It doesn't matter what type of extension it is - action extension, unwanted communication extension, notification service extension, ..... There's just something fundamentally regressed in XCode 15 that didn't exist with Xcode 14.
Apple please can you investigate fixing this, it makes developing and debugging app extension impossible.
At least are there any tips to try to attempt to reset Xcode to try and get it working again once its stopped interactively running the extensions?
UPDATE:
So I discovered that if UIScreen.main.traitCollection.userInterfaceStyle is called in a notification service extension then it doesn't detect any change to the iPhones light/dark mode unless the phone is restarted.
(I tried with other extensions, changes are detected immediately in other extensions, however not with a notification service extension nor in a notification content extension).
ORIGINAL POSTING:
I've got a notification service extension which is populating the notification with images before it's displayed.
The images are part of an image set with different images for light and dark modes.
What I've discovered is that which image is displayed in the notification depends upon whatever mode the phone was in when the app was installed or when the phone was restarted and it will stay like that for any subsequent posted notifications forever regardless of what the phone's light/dark mode setting is, unless the phone is restarted.
Here's an example to illustrate what I mean, here's an image set in the Media.xcassets for the extension, its called "Grunt".
And here's some code in the extension:
notificationContent!.title = "GRUNT"
if let url = URL(forImageResource: "Grunt") {
do {
let attachment = try UNNotificationAttachment(identifier: "imageAttachment", url: url)
notificationContent!.attachments = [attachment]
} catch {
NSLog("error")
}
}
contentHandler(notificationContent!)
When the app is installed, if the phone is set to light mode, then when a notification is posted the 2x Light image is displayed in the notification. If the phone's setting is then changed to dark, then the 2x Light image still continues to displayed in all subsequent notifications that get posted.
Conversely, if the phone is set to dark mode when the app is installed then the 2x Dark image is displayed in a notification, similarly if the phone's settings are changed to Light, the Dark image continues to be displayed for any new notifications posted.
Until the phone is restarted - then any new notification display in accordance with whatever the phone's dark mode is set to at the time the phone is restarted.
In other words, if the phone's light/dark mode setting is changed, new notifications posted don't display the appropriate light/dark image from the image set unless the phone is restarted.
(Occurs with both iOS 16 and 17)
This is about the 3rd time I've seen this now (in about 5 years of using notification service extension, however all the occurrences have been in the past couple of months so presumably its some recent instability).
What happens is a push is sent to the handset and is meant to get intercepted by a notification extension, except that doesn't happen - not due to an error with the app - something internally has gone wrong with the OS.
Once this starts the notification service extension can never receive pushes again until the phone is restarted after with the extension starts to receive the pushes again.
I got log from the OS when it did this and found there was an RBSRequestErrorDomain Code=5 error
[u A0F3A639-F287-4B0C-AADE-A6F547D91404:m (null)] [<private>(<private>)] Failed to start plugin; pkd returned an error: Error Domain=PlugInKit Code=4 "RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): **Error Domain=RBSRequestErrorDomain Code=5 "Launch failed**." UserInfo={NSLocalizedFailureReason=Launch failed., **NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111"** UserInfo={NSLocalizedDescription=**Launchd job spawn failed**}}}" UserInfo={NSLocalizedDescription=RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}}
Can file a radar but just posting here first just in case anybody from Apple know what the OS error code and hence the reason.
(longer console log available)
I've got a crash occurring at app launch time, its crashing too early for Crashlytics to have a chance to send off its stuff to its website.
The person on who's phone it is crashing is tech savvy so we've managed to extract the Apple crash report and the Crashlytics directly full of loads of stuff.
The Apple crash report is very useful, but I'd like to supplement the information obtained from the with that from Crashltyics (not the actual crash stack, Crashlytics can't improve on what Apple do) but some breadcrumbs that Crashlytics ought to have.
I've opened all the files but there's nothing human readable, I asked this question of their customer support but they never replied.
Anybody happen to know if the raw Crashlytics files can manually be munged into a human readable form, or manually uploaded to the Crashlytics web site?
If I upload a build to Testflight using Xcode 14 that offers the option to upload the app symbols. Xcode 15 doesn't offer this option, so presumably it does so automatically.
However I've got several builds in TF, built with both Xcode 14 and 15 but the option to download dSYMs isn't available in the Metadata section.
There defiantly are dSYMs though - they are present in the archive.
How can I download them for apps in Testflight and in the AppStore if the option isn't appearing in the Metadata section?
I've been constantly having this problem for the past few months, using the various Xcode 15 betas and the iOS 17 betas, but the problem is still present with Xcode 15 release and iOS 17.0 release (and indeed with 17.1 beta).
The issue is Xcode constantly says "Connecting to the phone" when attempting to run an iOS app from Xcode. Once it says this it never stop. Terminating and restarting Xcode doesn't fix it, disconnecting the phone and re-connecting doesn't fix it.
If I restart the phone then Xcode will switch to saying "Preparing the phone" and it'll never stop saying that (even though the phone might have been attached for hours and has previously been prepared).
I think the problem is actually iOS 17 or iOS 17 in combination with Xcode 15 because I don't have an issue with Xcode 15 and iOS versions less than 17. Nor in 13 years have I ever encountered a similar problem before.
So for the past few months I've been avoiding using iOS 17 because of this issue it's literally impossible to develop. But it's becoming harder to avoid using iOS 17.
So restarting the phone doesn't fix it, disconnecting the phone from the Mac doesn't fix it, restarting Xcode doesn't fix it. Are there suggestions for something else to try?
Apple are there any logs I can get to provide you that will help diagnose this issue?
I'm occasionally getting a crash (on iOS) after a hang and termination by the OS. While reproducing it and watching the Mac console I don't see any obvious cause of the issue. There shouldn't be anything synchronous and long running in the main thread. Verbose logging is turned on, is it possible too much logging is causing this (its using NSLog for the console and also echoing logging to Crashlytics.log())? If so why is it not deterministic in its reproducibility? Here's a crash stack:
> Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.appname>:3315] failed to terminate gracefully after 5.0s
ProcessVisibility: Unknown
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 4.260 (user 2.150, system 2.110), 11% CPU",
"Elapsed application CPU time (seconds): 0.022, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x1dd27b7dc __ulock_wait + 8 1 libsystem_platform.dylib 0x1fe05efb0 _os_unfair_lock_lock_slow + 176 2 CoreFoundation 0x19e3a6648 _logToStderr + 148 3 CoreFoundation 0x19e421500 __CFLogCString + 84 4 CoreFoundation 0x19e34fc8c _CFLogvEx2Predicate + 344 5 CoreFoundation 0x19e35e548 _CFLogvEx3 + 252 6 Foundation 0x1986195c0 _NSLogv + 124 7 Foundation 0x198617f58 NSLog + 56 8 AppName 0x1042dd480 +[Logger trace:] + 70784 (Logger.m:48) 9 AppName 0x104311ae4 CallExtensionManager.appBecameActive() + 285412 (<compiler-generated>:0) 10 AppName 0x104312004 @objc CallExtensionManager.appBecameActive() + 286724 (<compiler-generated>:0) 11 CoreFoundation 0x19e2f2590 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 12 CoreFoundation 0x19e396828 ___CFXRegistrationPost_block_invoke + 88 13 CoreFoundation 0x19e3798b8 _CFXRegistrationPost + 440 14 CoreFoundation 0x19e306afc _CFXNotificationPost + 700 15 Foundation 0x1985d1d18 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 16 UIKitCore 0x1a05b61e8 -[UIApplication _stopDeactivatingForReason:] + 1236 17 UIKitCore 0x1a05b5c98 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 280 18 UIKitCore 0x1a05b5a84 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 19 UIKitCore 0x1a05b5634 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 20 UIKitCore 0x1a05b5500 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148 21 UIKitCore 0x1a0ca2a68 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 22 UIKitCore 0x1a0d41074 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 23 UIKitCore 0x1a0462c70 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 24 UIKitCore 0x1a08d41ac __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.223 + 556 25 UIKitCore 0x1a0533c60 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 26 UIKitCore 0x1a0533ad0 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 27 UIKitCore 0x1a0533910 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 28 FrontBoardServices 0x1b4340ac8 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 420 29 FrontBoardServices 0x1b4340904 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 30 FrontBoardServices 0x1b4344120 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 31 FrontBoardServices 0x1b434403c __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344 32 libdispatch.dylib 0x1a578beac _dispatch_client_callout + 20 33 libdispatch.dylib 0x1a578f91c _dispatch_block_invoke_direct + 264 34 FrontBoardServices 0x1b434e24c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 35 FrontBoardServices 0x1b434dde8 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 36 FrontBoardServices 0x1b4350694 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 37 CoreFoundation 0x19e38e128 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 38 CoreFoundation 0x19e39a7b4 __CFRunLoopDoSource0 + 176 39 CoreFoundation 0x19e31f648 __CFRunLoopDoSources0 + 340 40 CoreFoundation 0x19e3350d4 __CFRunLoopRun + 828 41 CoreFoundation 0x19e33a3ec CFRunLoopRunSpecific + 612 42 GraphicsServices 0x1d985035c GSEventRunModal + 164 43 UIKitCore 0x1a06c6f58 -[UIApplication _run] + 888 44 UIKitCore 0x1a06c6bbc UIApplicationMain + 340 45 AppName 0x1042dfbf0 main + 80880 (main.m:7) 46 dyld 0x1bd86cdec start + 2220
Can't get the stack trace for Thread 0 to display nicely
I'm trying to report a crash report. Originally it was about 30,000 characters so I hoped it down until it was < 7000. But when I try and post I get a message saying the post is empty and the character could is negative. Tried multiple times, just can't post.
If I turn on (my company supplied VPN access) and then attempt to build with Xcode then that has the consequence that all the dev/distribution certificates in the keychain turn red and say "certificate is not trusted".
Turning off VPN doesn't reset them back and of course re-attempting to build will fail.
However if I reboot my MacBook, then the keychain is back in a good state again.
However as I work remotely I constantly have to flick VPN on and off throughout the day, and having to reboot endlessly is a pain.
Is there something I can do to reset the Keychain's certs to a good state without having to reboot? (and without having to delete them all and re-add them all back to the keychain).
In the console app, there is an option to turn on/off the displaying of Info and Debug message levels:
However I don't see an equivalent to do likewise with Xcode's console. Is there one?
I've gone through several tutorials, and the documentation, it seems there's no way to adjust the logging level dynamically, or even at build time for that matter.
i.e. there is apparently nothing that exists such as:
static let logger = Logger(subsystem: subsystem(), category: category())
logger.setMinimalLevel(.Warning)
logger.trace("I won't get displayed because minimal level is debug")
Am I mistaken and there is something like this?
I have a lot of phones and constantly switch between them, its very very annoying that when a phone is connected via cable, and then swapped out with another one, then Xcode will continue to install/run with the phone that's just been switched out, not the one that's just been connected by cable.
This is because Connect via network it turned on and there's no way to turn it off.
In previous versions of Xcode you could turn this on/off as you wished, not so with Xcode 15, it decides to turn it on for you and won't let you turn it off because its always disabled.
I'm getting loads of these appearing in my console, I can't find anything for it from googling.
What does it mean?