tvOS is the operating system for Apple TV.

tvOS Documentation

Posts under tvOS tag

122 Posts
Sort by:
Post not yet marked as solved
0 Replies
363 Views
I was shutdown tvOS simulator as hold TV/Control center button and select Shutdown. How turn on? Im trying press/hold menu/tv/any buttons, simulate not react, I see only black screen
Posted
by gruzd1sok.
Last updated
.
Post not yet marked as solved
2 Replies
415 Views
If users press the menu button multiple times from any page, it is likely to exit the app. I think it would be nice to have an alert before exiting the app. I have noticed that some apps on other platforms have this feature; however, I am not sure if it is allowed on tvOS. The logic would be something like this: Users tap the menu button. Show an alert with 'Cancel' and 'Exit' buttons. If 'Cancel' is tapped, go back to the app. If 'Exit' is tapped, exit the app by calling UIApplication.shared.perform(#selector(NSXPCConnection.suspend)). Will calling NSXPCConnection.suspend get my app rejected from Apple? It seems like a reasonable feature, though."
Posted
by ANATest.
Last updated
.
Post not yet marked as solved
3 Replies
573 Views
I have an AppleTV app which I released in 2016. I've updated it and released a new version every year without much hassle. This year, with tvOS 17.2, the layered app icon isn't working right. This is a two-layer image made with PNGs. When it's selected, it looks right and the layers move correctly: But when it's not selected, the background layer disappears: Screenshots are from the simulator but it also happens on the device. It's inconsistent; sometimes it's the front layer that disappears. Occasionally both layers work, but I can't tell why. I've spent a day trying everything. Very frustrated. The icon previews correctly in Xcode and in Parallax Viewer. The image sizes are correct: 400 x 240 for Small, 800 x 480 for Small@2x, 1280 x 768 for Large. The back layer is a non-transparent PNG. I tried adding a Large@2x set. Didn't help. Originally I had a three-layer image with no middle layer PNG. I deleted the empty middle layer, but that didn't help. All the PNG files are from GnuIMP. Same color space, even. I was using the filenames tvicon-back-s.png and tvicon-back-s@2x.png. I tried taking out the @ sign in case that was confusing Xcode. (It never has before, but I am flailing here.) Anybody have any clues? If it's an Apple bug and there's nothing I can do, I'm going to just push the release button and hope it fixes itself someday.
Posted
by erkyrath.
Last updated
.
Post not yet marked as solved
0 Replies
309 Views
Hi guys, I have Xcode 15.2 + MacOS Sonoma 14.2.1 + iPhone SDK 17.2 + Apple M3 chip When I build my project with FMOD for Unreal 2.0.2.20 for iOS Simulator on have an error: /Plugins/FMODStudio/Binaries/IOS/libfmodL_iphoneos.a(libfmodL_iphoneos.a-arm64-master.o) building for iOS Simulator, but linking in object file built for iOS**, file '/Plugins/FMODStudio/Binaries/IOS/libfmodL_iphoneos.a' Found that in downloaded latest verison "fmodstudio20220ue5.3mac.zip" from https://www.fmod.com/download#fmodforunreal inside folder "Plugins/FMODStudio/Binaries/IOS" there are no files for iOS Simulator (so it's not builded for support it or they just forgot to do it) So next i found on page https://www.fmod.com/docs/2.02/api/platforms-ios.html#ios-specific-starter-guide that they Released iOS simulator binary for Core Engine and Studio Engine FMOD Core Engine library /api/core/lib/libfmod_iphonesimulator.a - Release iOS simulator binary for production code. /api/core/lib/libfmodL_iphonesimulator.a - Release iOS simulator binary with logging enabled for development. FMOD Studio Engine library (used in conjunction with core library) /api/studio/lib/libfmodstudio_iphonesimulator.a - Release iOS simulator binary for production code. /api/studio/lib/libfmodstudioL_iphonesimulator.a - Release iOS simulator binary with logging enabled for development. So next step from page https://www.fmod.com/download#fmodengine I downloaded "fmodstudioapi20220ios-installer.dmg" inside 2 folders "/api/core/lib" and "/api/studio/lib" I found these files and copy it to my folder "/Plugins/FMODStudio/Binaries/IOS/", and it didn't work :slight_smile: So just to try luck I made a copy of this folder and deleted files that work for iOS build only libfmod_iphoneos.a libfmodL_iphoneos.a libfmodstudio_iphoneos.a libfmodstudioL_iphoneos.a Next step renamed files libfmod_iphonesimulator.a -> libfmod_iphoneos.a libfmodL_iphonesimulator.a -> libfmodL_iphoneos.a libfmodstudio_iphonesimulator.a -> libfmodstudio_iphoneos.a libfmodstudioL_iphonesimulator.a -> libfmodstudioL_iphoneos.a And finally I successfully builded and launched my project with FMOD for Unreal 2.0.2.20 for iOS Simulator FMOD team need to rebuild FMOD for Unreal with adding _iphonesimulator and _appletvsimulator files and support and it will launch on iOS/TVOS Simulators with any problems. PS same you can do with TVOS Simulator and fix it
Posted
by davaidev.
Last updated
.
Post not yet marked as solved
2 Replies
424 Views
I’m developing this tvOS app, and it builds and runs fine locally in Simulator. However, when I do Product > Archive (so I can upload it to app store later), it fails with error in the screenshot. Looks like Xcode is trying to sign the app with a certificate, but could not find a valid profile to do so. Since I don't have a physical Apple TV device, I'm unable to add an Apple TV to the Devices list on developer.apple.com, thus unable to create a profile. Is the any way around this issue to archive my tvOS app?
Posted
by hliang.
Last updated
.
Post not yet marked as solved
3 Replies
655 Views
Loading a video that played on tvOS 17, won't now play in tvOS 17.2. It isn't true for all videos or even all videos of a certain type. This code works fine on tvOS 17, but not on 17.2 import SwiftUI import AVKit struct ContentView: View { var body: some View { let player = AVPlayer(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!) VideoPlayer(player: player) .onAppear { player.play() } } } I have tried reloading the metadata. I tried making the player from an AVAsset rather than a URL. I can't seem to see what is making it work with some videos and not all and what is different from tvOS 17 to 17.2.
Posted Last updated
.
Post not yet marked as solved
4 Replies
667 Views
I have a multiplatform app where I support iOS, macOS and tvOS. There is one target which supports it all. In my assets catalog I have the AppIcon entry which holds the app icon for iOS and macOS. This works as expected. However the tvOS app icon is ignored. I added an "tvOS App Icon & Top Shelf Image" asset to my asset catalog and filled it with my icons for tvOS. Then I added it in the target’s general settings App Icon entry under App Icons and Launch Screen like shown in the screenshot. What am I missing? What needs to be done to make this work?
Posted
by RayWo.
Last updated
.
Post not yet marked as solved
0 Replies
342 Views
It looks like there's a new tab bar / column style design for tvOS that was introduced with the current TV app. Is there any word on this being a developer available component?
Posted Last updated
.
Post not yet marked as solved
0 Replies
425 Views
when i am adding new view to replace viewcontroller's view like this : let viewcontroller: UIViewController! let rootview:UIView! viewcontroller = UIViewController () rootview = UIView (frame:viewcontroller.view.bounds) viewcontroller.view = rootview // Adding a button let button = UIButton(type: .system) button.setTitle("Tap Me", for: .normal) button.titleLabel?.font = UIFont.systemFont(ofSize: 18) button.addTarget(self, action: #selector(buttonTapped), for:.allEvents) viewcontroller.view.addSubview(button) For ios(iPhone/ipad) , i am able to get button click event . But in case of tvOS , i am not getting button click event. But in case of tvOS if use the default view of viewcontroller like this , i am getting button click events and things works fine: let viewcontroller: UIViewController! viewcontroller = UIViewController () // Adding a button let button = UIButton(type: .system) button.setTitle("Tap Me", for: .normal) button.titleLabel?.font = UIFont.systemFont(ofSize: 18) button.addTarget(self, action: #selector(buttonTapped), for:.allEvents) viewcontroller.view.addSubview(button) Is this some bug for tvOS or for tvOS this suppose to happen this way ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
389 Views
I want to use uitableview in tvos to show list of string data but compiler is throughing following errors in generated header: "No type or protocol named 'UITableViewDataSource'" And "Attempting to use the forward class 'UITableView' as superclass of 'TWOSSelectionTableTVOS'" Even though this code is working is ios . My code structure is as follow : SelectionTable.swift: import UIKit class TWOSSelectionTableTVOS : UITableView { private var vDataSrc:[String]! func SetDataSrc (_ pDataSrc:[String]) { self.vDataSrc = pDataSrc } func UpdateDataSrc (_ pStringList:[String]) { self.vDataSrc += pStringList } func GetDataSrc () -> [String] { return self.vDataSrc } } PaintUI.swift : import UIKit @objc class PaintUI: NSObject,UITableViewDelegate, UITableViewDataSource { static let uShared = PaintUI () @objc static func updateUIMessage() { DispatchQueue.main.async { ExecuteInlineSelectionTable () } } func tableView (_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 5 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell (withIdentifier: "cell", for: indexPath) cell.textLabel?.text = "hello" return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let viewcontroller: TWIOSViewController! viewcontroller = StaticContext.sViewController } public static func ExecuteInlineSelectionTable () { let selectiontable:TWOSSelectionTableTVOS! selectiontable = TWOSSelectionTableTVOS () selectiontable.register (UITableViewCell.self, forCellReuseIdentifier: "cell") selectiontable.dataSource = uShared selectiontable.delegate = uShared selectiontable.isScrollEnabled = true // TODO : will add selection table in view heriearchy but currently getting // compilation error } } And finally calling PaintUI.updateUIMessage () , it is throughing above errors for tvOS only but in case of ios code is working fine.
Posted Last updated
.
Post not yet marked as solved
0 Replies
528 Views
On an Apple TV, if you have an app that triggers a video playing in AVPlayer while another device is air playing to the Apple TV. The device gets disconnected from Airplay and the video plays instead. There doesn't seem to be a way to sense that Airplay is happening or not happening from the Apple TV side programmatically or a way to prevent the behavior. Is this intentional? It would seem to make more sense to have Airplay take priority or push the app to the background.
Posted Last updated
.
Post marked as solved
3 Replies
529 Views
I have a pretty basic tvOS app. It uses storyboard named 'Main'. Before a week ago, all was fine. It would load no problems at all. I installed 17.2 on my Apple TV, and it crashes as soon as it opens. I tested this out in Xcode and it runs on a 17.0 simulator, but the 17.2 simulator crashes and the only message I get is Exception NSException * "Could not load NIB in bundle: 'NSBundle </Users/Tyler/Library/Developer/CoreSimulator/Devices/A442BA1A-318B-43EC-850E-EA0CFA7AAB95/data/Containers/Bundle/Application/CC57DE61-B9E4-49EE-A044-8FE00D709CB6/Piedmont Road Apple TV.app> (loaded)' with name 'kQf-Ef-Nxz-view-nK4-c0-71Y'" 0x0000600000c73d50 I have put in breakpoints, but it doesn't seem to help. Anyone have an idea what got changed with tvOS 17.2 to cause this?
Posted
by tbrass84.
Last updated
.
Post not yet marked as solved
0 Replies
321 Views
Hardware: Apple TV 4K (1st gen) OS: tvOS 17.1 I have been attempting to create a simple dashboard using MapKit for my company's devices located around the globe. As of now, we only have 7-8 attached to the main database, so I'm using an API client I created to load that many Map markers after the View is loaded. My issue is that despite this being a relatively low-intensity task, the Map view crashes after about 15 minutes, with no errors or any indications of memory leaks or other problems that would indicate something is wrong. GPU usage spikes on initial load, but remains in the green throughout the process. I tried the same code in swift playgrounds and was able to get the globe to spin indefinitely, probably because it's using the extra resources available on my M2 Max chip. But again, I am well below the memory and CPU usage limits available for tvOS. other than initially loading 7-8 objects asynchornously on initial load, no other work is being done. MRE: import SwiftUI import MapKit struct ContentView: View { let timer = Timer.publish(every: 0.1, on: .main, in: .default).autoconnect() @State var viewport: MapCameraPosition = .region(MKCoordinateRegion(center: .init(latitude: 0, longitude: 0), span: .init(latitudeDelta: 90, longitudeDelta: 180))) @State var longitude: Double = 0 { didSet { viewport = .region(MKCoordinateRegion(center: .init(latitude: 20, longitude: longitude), span: .init(latitudeDelta: 90, longitudeDelta: 180))) } } private func shiftLongitude(by: Double) { if self.longitude >= 180 { self.longitude -= 360 } else { self.longitude += by } } var body: some View { Map(position: $viewport) { } .mapStyle(.imagery(elevation: .realistic)) .onReceive(timer) { _ in withAnimation { self.shiftLongitude(by: 1.0) } } } }
Posted
by theta71.
Last updated
.
Post not yet marked as solved
2 Replies
471 Views
When we try to push blueprint for MDM over Wi-Fi in apple TV it fails, but in over the cable it works properly. After pushing the blueprint over Wi-Fi, the device gets rebooted and go through setup steps, at the end we don't see the step for Mobile Device Management. I'm attaching a sample Profile we attach to blueprint and Screenshot of Blueprint configuration.
Posted
by _kvnryn.
Last updated
.
Post not yet marked as solved
0 Replies
329 Views
In a tvOS app I have two buttons and would like to determine which one has focus when selected. Using func pressesBegan works for nw. override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { guard let selected = UIScreen.main.focusedItem else { return } Xcode tells me that focusedItem is deprecated and I should use -[UIWindowScene focusSystem].focusedItem instead. Any suggestions on a code snippet that could be used. Thanks
Posted
by Boomer.
Last updated
.
Post not yet marked as solved
1 Replies
385 Views
I'm trying to improve our application to receive and handle events from a bluetooth keyboard. To intercept incoming events I use sendEvent: method. But I get a different event type for a different key. For example when I press 'Esc' key I get an event type is UIEventTypePresses (and event is a instance of UIPressesEvent class) but when I press 'ArrowUp' key I get an event type is 4 (there is no enum value for that number) and event is a instance of UIPhysicalKeyboardEvent class. In the first case I found a documentation of UIPressesEvent and I can implement handler for it. But for the second case I didn't find any documentations of UIPhysicalKeyboardEvent nether in the online documentation nor in the Xcode help. How can UIPhysicalKeyboardEvent events be handled? Is the any documentation for that? My target OS is tvOS 17.1
Posted Last updated
.
Post not yet marked as solved
0 Replies
401 Views
The alertController.view.tintColor = .yellow statement does not seem to take effect in TVOS 17 when creating alerts. Interestingly, when using the same alert code on TVOS 16, the specified color is applied successfully. I'm seeking assistance in resolving this discrepancy and would appreciate any guidance or solutions you can provide. I could understand that the Alert design aswell is modified which is not mentioned in the release notes of TVOS 17. Please help me out here. TVOS 17: TVOS 16:
Posted
by Ganesh56.
Last updated
.
Post not yet marked as solved
0 Replies
444 Views
Hello, I have a SwiftUI application that uses NavigationSplitView. It's working great on iOS, iPad, and macOS. I decided to give it a try on tvOS. After it builds, it will not allow user interaction on the NavigationSplitView's sidebar. I've tried various view focus modifiers without any success. I'd also expect this to "just work" as default behavior. I have filed FB13447961 on this issue. Here is a distillation of the code that demonstrates the problem. Any ideas? Thank you. enum Category : String, CaseIterable { case first case second case third } enum Detail : String, CaseIterable { case one case two case three } struct DetailView : View { let category : Category? var body: some View { if let category { Text(category.rawValue) List(Detail.allCases, id: \.self) { detail in NavigationLink(value: detail) { Text(detail.rawValue) } } } else { Text("Select Category") } } } struct ContentView: View { // NOTE: If this category is set to something, it will show that category's detail. // The problem is that the NavigationSplitView sidebar does not have, nor does not // seem to be able to get focus. @State var category: Category? @State var path : [Detail] = [] var body: some View { NavigationSplitView { List(Category.allCases, id: \.self, selection: $category) { category in Text(category.rawValue) } } detail: { NavigationStack(path: $path) { DetailView(category: category) .navigationDestination(for: Detail.self) { detail in Text("\(detail.rawValue)") } } } } } #wwdc2023-10162 #wwdc20-10042
Posted
by Bolsinga.
Last updated
.