Trying to build/deploy RetroArch to an Apple TV 4K - Failed to install

Hi all!

I absolutely love RetroArch and have been using it for years to play all of my childhood favourites whenever time permits and the mood strikes.

I just got an Apple TV 4K from a friend who didn’t want it anymore, and thought it would be cool (and handy since I currently have to play on my laptop) to try installing RetroArch on it.

I have followed this guide to download the *.ipa and attempt to install it on the device, but AltServer refused to deploy it for some reason. Which led me to this guide for building the app yourself, and even though I’ve followed it to the letter, I’m stuck on the final step of deployment.

Xcode connects to my Apple TV and the app builds successfully, but when attempting to deploy it, Xcode spits out the following:

Failed to install the app on the device.

Domain: com.apple.dt.CoreDeviceError
Code: 3002
User Info: {
    DVTErrorCreationDateKey = "2023-12-09 12:38:51 +0000";
    IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker;
    NSURL = "file:///Users/kenny/Library/Developer/Xcode/DerivedData/RetroArch_iOS13-bfoxxgsvuozstbdodrtkoynqgujg/Build/Products/Release-appletvos/RetroArchTV.app/";
}
--
Connection with the remote side was unexpectedly closed : <dictionary: 0x1de85dcb0> { count = 1, transaction: 0, voucher = 0x0, contents =
	"XPCErrorDescription" => <string: 0x1de85dea0> { length = 22, contents = "Connection interrupted" }
}
Domain: IXRemoteErrorDomain
Code: 6
Failure Reason: Unhandled error domain IXRemoteErrorDomain, code 6
User Info: {
    FunctionName = "_IXHandleConnectionForInstallMessagesFromRemoteService_block_invoke";
    SourceFileLine = 237;
}
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_isCoreDevice" = 1;
    "device_isWireless" = 1;
    "device_model" = "AppleTV6,2";
    "device_osBuild" = "17.1 (21K69)";
    "device_platform" = "com.apple.platform.appletvos";
    "dvt_coredevice_version" = "348.1";
    "dvt_mobiledevice_version" = "1643.40.14";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 33605;
    "operation_errorCode" = 6;
    "operation_errorDomain" = "com.apple.dt.CoreDeviceError.3002.IXRemoteErrorDomain";
    "operation_errorWorker" = IDEInstallCoreDeviceWorker;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.appletvos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 99;
    "param_launcher_substyle" = 8192;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_structuredConsoleMode" = 1;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "appletvos17.0";
    "sdk_osVersion" = "17.0";
    "sdk_variant" = appletvos;
}
--
System Information

macOS Version 14.1.2 (Build 23B2091)
Xcode 15.0.1 (22266) (Build 15A507)
Timestamp: 2023-12-09T23:38:51+11:00

Any ideas what the issue could be? Those error messages seem pretty vague to me, and the more technical stuff goes way over my head as a non-Apple developer. I’ve been a Windows desktop and web developer for over a decade now but have never dabbled with anything Apple-related, so any guidance from an experienced tvOS developer (or anyone that knows anything about this stuff) would be very much appreciated!

MTIA :smiley:

I haven’t seen that with Xcode before. “Connection interrupted” after 33 seconds sort of implies the device was trying to install it and then hit some error that forced it to stop. Have you verified there’s enough disk space for the app? The IPA is compressed (it’s basically just a zip file) and the uncompressed app with all of the cores can end up being large depending on which cores are in it (the one from the buildbot has every core, so ends up being over 1GB installed).

Thanks @warmenhoven, I had to install a third party app to find this out (which I find ludicrous!) but apparently I have 1.61 GB of free disk space. So that shouldn’t be the issue, right?

I have built all of the available cores into my IPA, but they still shouldn’t take up more than 1.6 GB right? Although I’ve always hated how Apple will warn you of low disk space much sooner than is really necessary on macOS/OS X, and won’t let you install a large system update if you don’t have enough free space + several GB more. So maybe that’s what’s happening here?

I’d still expect something about low disk space in the error log though, if that were the case. Very perplexing indeed…

I just grabbed the latest nightly tvOS build off the buildbot which has all of the cores in it, changed the .ipa extension to .zip, and unzipped it, and it’s 1.01GB. So it should fit, but I’m not sure how close to the limit Xcode will let you go.

Coincidentally I just had this happen to me last night, on my iPhone. It was connected via USB and I was able to resolve the problem just by unplugging and replugging it. With the AppleTV connected via WiFi that’s not as straightforward. Have you tried turning it off and on again?