apple-tv-troubleshooter
Expert troubleshooting for Apple TV (tvOS) React Native development. Use when users have issues with Siri Remote, focus management, TVEventHandler, TVFocusGuideView, ScrollView not scrolling, tvOS-specific problems, parallax animations, or tvOS vs Android TV differences.
Best use case
apple-tv-troubleshooter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Expert troubleshooting for Apple TV (tvOS) React Native development. Use when users have issues with Siri Remote, focus management, TVEventHandler, TVFocusGuideView, ScrollView not scrolling, tvOS-specific problems, parallax animations, or tvOS vs Android TV differences.
Teams using apple-tv-troubleshooter should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/apple-tv-troubleshooter/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How apple-tv-troubleshooter Compares
| Feature / Agent | apple-tv-troubleshooter | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Expert troubleshooting for Apple TV (tvOS) React Native development. Use when users have issues with Siri Remote, focus management, TVEventHandler, TVFocusGuideView, ScrollView not scrolling, tvOS-specific problems, parallax animations, or tvOS vs Android TV differences.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Apple TV Troubleshooter
You are an expert in Apple TV (tvOS) development with React Native. This skill activates when users encounter:
- Focus management issues on Apple TV
- Siri Remote event handling problems
- TVEventHandler not capturing events
- ScrollView/FlatList not scrolling
- TVFocusGuideView configuration
- tvOS vs Android TV differences
- Expo TV build issues
- Navigation and focus traps
## tvOS Focus Engine vs Android TV
**Critical Difference:** tvOS uses a **precision-based** focus engine while Android TV uses **proximity-based**.
| Aspect | Apple TV (tvOS) | Android TV |
|--------|-----------------|------------|
| Focus Engine | Precision-based (strict alignment) | Proximity-based (nearest element) |
| Remote Input | Siri Remote touchpad (swipe + click) | D-pad directional buttons |
| Focus Recovery | Attempts automatic (inconsistent) | Moves to top-left corner |
| Screen Resolution | 1920x1080 (native) | 960x540 (scaled) |
**Implication:** UI elements must be properly aligned on tvOS or focus won't move between them.
## Siri Remote Event Handling
### Using useTVEventHandler Hook (Recommended)
```typescript
import { useTVEventHandler } from 'react-native';
function MyComponent() {
useTVEventHandler((evt) => {
switch (evt.eventType) {
case 'up':
case 'down':
case 'left':
case 'right':
// Handle navigation
break;
case 'select':
// Center button pressed
break;
case 'playPause':
// Play/Pause button
break;
case 'longPlayPause':
// Long press play/pause (tvOS only)
break;
}
});
return <View>{/* content */}</View>;
}
```
### TVEventControl for Menu and Gestures
```typescript
import { TVEventControl } from 'react-native';
// Enable Menu button handling (for back navigation)
TVEventControl.enableTVMenuKey();
// Enable pan gesture detection on Siri Remote touchpad
TVEventControl.enableTVPanGesture();
// Disable when component unmounts
TVEventControl.disableTVMenuKey();
TVEventControl.disableTVPanGesture();
```
## Common Problems & Solutions
| Problem | Cause | Solution |
|---------|-------|----------|
| **ScrollView won't scroll** | Regular ScrollView needs focusable items | Use `TVTextScrollView` for swipe-based scrolling |
| **TVEventHandler doesn't fire** | No focusable component on screen | Add `hasTVPreferredFocus={true}` to parent View or ensure a Touchable exists |
| **Event fires twice** | Press and release both trigger | Known behavior - debounce or track event state |
| **InputText can't receive focus** | tvOS limitation | Use native input alternatives or custom keyboards |
| **Focus leaves FlatList unexpectedly** | Virtualization removes focused item | VirtualizedList auto-wraps with TVFocusGuideView - ensure `trapFocus` enabled |
| **Menu button doesn't work** | Not enabled by default | Call `TVEventControl.enableTVMenuKey()` |
| **Pan/swipe not detected** | Disabled by default | Call `TVEventControl.enableTVPanGesture()` |
| **Expo prebuild fails after changing EXPO_TV** | Cached native config | Always run `npx expo prebuild --clean` |
| **Flipper causes build errors** | Incompatible with TV | Set Flipper to false in Podfile, run prebuild --clean |
| **Wrong screen dimensions** | Platform difference | Use platform-specific StyleSheets |
| **Focus doesn't move diagonally** | Precision engine limitation | Ensure UI elements are aligned vertically/horizontally |
| **BackHandler doesn't work** | Different API on tvOS | Use TVEventControl.enableTVMenuKey() for menu/back |
| **Parallax not working** | Missing props | Add `tvParallaxProperties` to TouchableHighlight |
| **removeClippedSubviews breaks focus** | Clipped items lose focus | Set `removeClippedSubviews={false}` |
## TVFocusGuideView Configuration
```typescript
import { TVFocusGuideView } from 'react-native';
// Basic usage with auto-focus memory
<TVFocusGuideView autoFocus>
<TouchableOpacity>Item 1</TouchableOpacity>
<TouchableOpacity>Item 2</TouchableOpacity>
</TVFocusGuideView>
// Trap focus within container
<TVFocusGuideView
trapFocusUp
trapFocusDown
trapFocusLeft
trapFocusRight
>
{/* Focus cannot escape this container */}
</TVFocusGuideView>
// Custom focus destinations
<TVFocusGuideView destinations={[buttonRef.current]}>
{/* Guides focus to specific elements */}
</TVFocusGuideView>
```
### Key Props
| Prop | Description |
|------|-------------|
| `autoFocus` | Remembers last focused child, restores on revisit |
| `trapFocusUp/Down/Left/Right` | Prevents focus from leaving in that direction |
| `destinations` | Array of refs to guide focus toward |
| `focusable` | When false, view and children not focusable |
## Platform-Specific Components
### TVTextScrollView (for scrolling content)
```typescript
import { TVTextScrollView } from 'react-native';
// Use instead of ScrollView for non-focusable content
<TVTextScrollView>
<Text>Long text content that should scroll with swipe...</Text>
</TVTextScrollView>
```
### Parallax Animations
```typescript
<TouchableHighlight
tvParallaxProperties={{
enabled: true,
magnification: 1.1,
pressMagnification: 1.0,
shiftDistanceX: 5,
shiftDistanceY: 5,
}}
>
<Image source={poster} />
</TouchableHighlight>
```
### Unsupported Components on tvOS
These components are **disabled or suppressed** on Apple TV:
- `StatusBar`
- `Slider`
- `Switch`
- `WebView` (limited support)
## Focus Management Best Practices
### 1. Set Default Focus on Mount
```typescript
<TouchableOpacity hasTVPreferredFocus={true}>
Default Focused Item
</TouchableOpacity>
```
### 2. Use nextFocus Props for Custom Navigation
```typescript
<TouchableOpacity
ref={button1Ref}
nextFocusRight={button2Ref.current}
nextFocusDown={button3Ref.current}
>
Button 1
</TouchableOpacity>
```
### 3. Capture Events at Top Level
```typescript
// Good: Capture at parent level
function Screen() {
useTVEventHandler((evt) => {
// Handle all events here, delegate to children
});
return <View>{/* children */}</View>;
}
// Bad: Each small component handles its own events
function SmallButton() {
useTVEventHandler((evt) => { /* ... */ }); // Avoid this pattern
}
```
### 4. Use React Context for Focus State
```typescript
const FocusContext = createContext({ focusedId: null, setFocused: () => {} });
function FocusProvider({ children }) {
const [focusedId, setFocused] = useState(null);
return (
<FocusContext.Provider value={{ focusedId, setFocused }}>
{children}
</FocusContext.Provider>
);
}
```
## Expo TV Specific Issues
### Environment Variable
```bash
# Must be set BEFORE prebuild
export EXPO_TV=1
# Always clean when changing this variable
npx expo prebuild --clean
```
### Common Expo TV Errors
| Error | Solution |
|-------|----------|
| "EXPO_TV not recognized" | Ensure using Expo SDK 50+ |
| Build fails after toggling EXPO_TV | Run `npx expo prebuild --clean` |
| Flipper errors | Disable Flipper in ios/Podfile |
| Dev menu not showing | Use SDK 54+ with RNTV 0.81 for TV dev menu support |
## Platform Detection
```typescript
import { Platform } from 'react-native';
// Check if running on any TV
if (Platform.isTV) {
// TV-specific code
}
// Check specifically for Apple TV (not Android TV)
if (Platform.isTVOS) {
// Apple TV only code
}
// Platform-specific styles
const styles = StyleSheet.create({
container: {
padding: Platform.isTVOS ? 48 : 16,
},
});
```
## Debugging Tips
1. **LogBox works on TV** - Error display supported after RN TV 0.76+
2. **Use console.log liberally** - Metro bundler shows logs
3. **Test on real device** - Simulator misses Siri Remote nuances
4. **Check focus state** - Add `onFocus`/`onBlur` handlers to debug focus flow
## Resources
- [react-native-tvos GitHub](https://github.com/react-native-tvos/react-native-tvos)
- [React Native TV Docs](https://reactnative.dev/docs/building-for-tv)
- [Expo TV Guide](https://docs.expo.dev/guides/building-for-tv/)
- [TVFocusGuideView Guide](https://dev.to/amazonappdev/tv-navigation-in-react-native-a-guide-to-using-tvfocusguideview-302i)
---
# Cross-Platform Troubleshooting (Also Applies to Apple TV)
## TypeError: Cannot read property 'displayName' of undefined
This error affects all TV platforms including Apple TV when using Expo.
**Symptoms:**
- App builds successfully but crashes immediately on launch
- Metro shows: `ERROR TypeError: Cannot read property 'displayName' of undefined`
**Common Causes & Fixes:**
1. **Wrong import in index.js** (Most Common)
```javascript
// ❌ WRONG - Named import when App uses default export
import { App } from './App';
// ✅ CORRECT - Default import
import App from './App';
```
2. **Metro cache corruption**
```bash
pkill -f "expo" 2>/dev/null || true
rm -rf node_modules/.cache /tmp/metro-* /tmp/haste-map-*
npx expo start --clear
```
3. **react-tv-space-navigation v6 missing configuration**
- v6.0.0+ requires explicit remote control configuration
- Create `src/configureRemoteControl.ts`:
```typescript
import { SpatialNavigation } from 'react-tv-space-navigation';
SpatialNavigation.configureRemoteControl({
remoteControlSubscriber: (callback) => () => {},
remoteControlUnsubscriber: () => {},
});
```
- Import at top of App.tsx: `import './src/configureRemoteControl';`
## Expo TV Build & Run Issues
### Always Use Development Builds for TV
```bash
# ❌ May cause SDK version issues on TV simulators
npx expo start
# ✅ Correct for TV development
npx expo run:ios # Apple TV
npx expo run:android # Android TV
# or
npx expo start --dev-client
```
### Apple TV Simulator Quick Commands
```bash
# List available simulators
xcrun simctl list devices available | grep -i tv
# Boot Apple TV simulator
xcrun simctl boot "Apple TV"
# Run app
npx expo run:ios --device "Apple TV"
```Related Skills
Apple Foundation Models
Use this skill when working with Apple's Foundation Models framework for on-device AI and LLM capabilities in iOS/macOS apps
apple-reminders
Manage Apple Reminders via the `remindctl` CLI on macOS (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.
apple-productivity
Access macOS productivity apps (Calendar, Contacts, Mail, Messages, Reminders, Voice Memos). Use when user asks about calendar events, contacts, emails, iMessages, reminders, or voice transcription.
apple-health-fitness
Query Health and Fitness data from Apple Health app including activity, workouts, heart rate, sleep, and health metrics. Use when user asks about health stats, fitness activity, workouts, sleep data, or health metrics.
apple-app-store-agent
Comprehensive agent for preparing and generating all assets needed for Apple App Store submission. Use when user needs to prepare an iOS/iPadOS/macOS app for App Store release, including generating app metadata (descriptions, promotional text, keywords), creating app icons, designing screenshots, preparing privacy policy URLs, and organizing fastlane-compatible folder structures. Triggers on requests like "prepare my app for App Store", "create App Store screenshots", "generate app description", "make app icon", or "set up fastlane metadata".
devops-troubleshooter
Expert DevOps troubleshooter specializing in rapid incident response, advanced debugging, and modern observability.
aks-deployment-troubleshooter
Diagnose and fix Kubernetes deployment failures, especially ImagePullBackOff, CrashLoopBackOff, and architecture mismatches. Battle-tested from 4-hour AKS debugging session with 10+ failure modes resolved.
applesauce-core
This skill should be used when working with applesauce-core library for Nostr client development, including event stores, queries, observables, and client utilities. Provides comprehensive knowledge of applesauce patterns for building reactive Nostr applications.
apple-dev-best-practices
Apple platform development best practices for Swift 6, SwiftUI, SwiftData, and iOS/macOS apps. Use when building any iOS or macOS app, writing Swift code, designing SwiftUI views, working with Xcode projects, implementing navigation, state management, concurrency, networking, persistence, or testing on Apple platforms. Triggers on Swift, SwiftUI, iOS, macOS, Xcode, UIKit, SwiftData, Core Data, XCTest, StoreKit, CloudKit, MapKit, HealthKit, or any Apple framework. Also use when reviewing Swift code, debugging iOS apps, migrating UIKit to SwiftUI, or planning Apple platform architecture.
apple-appstore-reviewer
Serves as a reviewer of the codebase with instructions on looking for Apple App Store optimizations or rejection reasons.
apple-ui-design
Apple-inspired clean, minimal, premium UI design. Use when building modern interfaces requiring exceptional UX, clean aesthetics, or Apple-like polish. Triggers on: clean UI, modern design, Apple style, minimal, premium, user-friendly, UX.
apple-hig-designer
Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.