Skip to content

Fix launch failure on tvOS 26/27 by adopting the UIScene life cycle - #68

Open
KJRRR wants to merge 1 commit into
jvanakker:masterfrom
KJRRR:fix/tvos27-uiscene-lifecycle
Open

Fix launch failure on tvOS 26/27 by adopting the UIScene life cycle#68
KJRRR wants to merge 1 commit into
jvanakker:masterfrom
KJRRR:fix/tvos27-uiscene-lifecycle

Conversation

@KJRRR

@KJRRR KJRRR commented Jul 26, 2026

Copy link
Copy Markdown

Problem

On tvOS 26 and later the app installs and shows a Home Screen icon, but does nothing when launched. Selecting the icon returns straight to the Home Screen.

The failure signature is unusually misleading:

  • devicectl device process launch reports success, then the app terminates immediately with exit code 0
  • the process is gone from devicectl device info processes within a second
  • no crash log is produced — it is a clean termination, not a crash
  • the app runs perfectly in the tvOS Simulator

That last point in particular tends to send people toward signing/provisioning as the suspect, which is a dead end.

Cause

Apps linked against the tvOS 26 SDK or later must declare a UIApplicationSceneManifest in Info.plist. Without one, UIKit fails a launch-time assertion before any UIApplicationDelegate method runs, so no app code executes and nothing is logged. The Simulator does not enforce the assertion, which is why it still runs there.

This project has used the pre-scene lifecycle (UIApplicationMain + UIMainStoryboardFile) since 2015, so it trips the assertion on every tvOS 26/27 device.

Note this is determined by the SDK the app is linked against, not the deployment target. Since deploying to a tvOS 27 device requires an Xcode that supports tvOS 27, and that Xcode links against the tvOS 27 SDK, there is currently no way to sideload this project onto tvOS 27 without hitting it.

Likely the underlying cause of #67.

Fix

Info.plist — declare a single default scene configuration. UISceneStoryboardFile carries over the same Main storyboard that UIMainStoryboardFile previously loaded, and UIMainStoryboardFile is left in place for older tvOS versions.

AppDelegate — conformed to UIWindowSceneDelegate and named as the scene delegate class. UIKit instantiates a separate scene-delegate instance of the same class, and the storyboard-created window is assigned to its existing window property automatically. Doing it this way means no new files are added to the .xcodeproj, keeping the diff small and avoiding project-file churn.

Scene lifecycle callbacks — this part is not optional. Under the scene lifecycle, applicationWillResignActive:, applicationDidEnterBackground:, applicationWillEnterForeground: and applicationDidBecomeActive: stop firing entirely. This app drives its cookie save/restore from exactly those methods, so without porting them the app would launch fine but silently lose cookies and logins on every exit. The five scene* equivalents call the same saveCookiesToDefaults / restoreCookiesFromDefaults helpers.

(application:didFinishLaunchingWithOptions: does still fire, so the initial restore is unaffected.)

Testing

Verified working on Apple TV 4K (3rd generation), tvOS 27.0 (24J5325d), Debug configuration, built with Xcode 27.0 (27A5228h) against the tvOS 27.0 SDK. App launches, renders pages, and the top bar / remote interaction behave as before.

Scope of what I actually tested, stated plainly: one device, one tvOS version, Debug only. I have not verified Release builds, older Apple TV hardware, or tvOS 26 — though the mechanism is an Apple-wide SDK requirement rather than anything device-specific, so I would expect it to hold.

🤖 Generated with Claude Code

Apps linked against the tvOS 26 SDK or later must declare a
UIApplicationSceneManifest. Without one, UIKit fails a launch-time
assertion before any UIApplicationDelegate method runs: the app installs
and shows a Home Screen icon, but terminates immediately with exit code 0
and produces no crash log. The Simulator does not enforce the assertion,
so the app still runs there, which makes the failure easy to misdiagnose
as a signing or provisioning problem.

Declare a single default scene configuration and let the existing
AppDelegate serve as the scene delegate, so no new files need to be added
to the project. UISceneStoryboardFile carries over the same Main
storyboard that UIMainStoryboardFile previously loaded.

Under the scene life cycle applicationWillResignActive:,
applicationDidEnterBackground:, applicationWillEnterForeground: and
applicationDidBecomeActive: no longer fire, so the cookie save/restore
driven by them is ported to the scene equivalents. Without that part the
app launches correctly but silently loses cookies on every exit.

Verified on Apple TV 4K (3rd generation) running tvOS 27.0 (24J5325d),
Debug configuration, built with Xcode 27.0 (27A5228h).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant