Skip to content

Conversation

@benroeder
Copy link
Contributor

Summary

  • Add tvOS as a supported target alongside iOS (tvOS uses the same AudioToolbox/RemoteIO APIs, available since tvOS 9.0)
  • Add tvOS build job to CI workflow
  • Add tvOS example with sine wave generator

Notes

tvOS targets (aarch64-apple-tvos, aarch64-apple-tvos-sim) are Tier 3 in Rust, requiring nightly toolchain and -Zbuild-std flag since there is no prebuilt standard library.

Changes

  • Add tvOS to cfg conditions for RemoteIO, audio_session_get_property, and buffer frame size calculation
  • Add tvOS build job to CI workflow using nightly + -Zbuild-std
  • Add tvOS example with sine wave generator (tvOS doesn't support microphone input, so uses output-only demo)
  • Update .gitignore for Xcode build artifacts

@simlay simlay self-requested a review December 12, 2025 21:21
Copy link
Member

@simlay simlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Looks like the meat of this is a few lines of rust.

Let's move the iOS example directory to "apple" and add tvOS as a possible target in the Xcode project and add that to CI similar to the existing example.

I'll submit a PR to your fork and branch sometime this weekend if you don't get to it before me.

benroeder added a commit to benroeder/coreaudio-rs that referenced this pull request Dec 18, 2025
Per maintainer feedback on PR RustAudio#146, merge the separate iOS and tvOS
examples into a single directory with one Xcode project supporting
both platforms.

Changes:
- Rename examples/ios to examples/apple, delete examples/tvos
- Single Xcode project with iOS and tvOS targets
- Unified Rust code with single run_example() for both platforms
- Both platforms now play 440Hz sine wave demo
- AppDelegate.m uses #if TARGET_OS_TV for platform differences
- SDK-conditional library search paths in Xcode project
- Update CI workflow to use new paths
@benroeder benroeder requested a review from simlay December 18, 2025 14:49
Add tvOS as a supported platform alongside iOS. Both platforms now share
a single example in examples/apple/ with one Xcode project containing
targets for both iOS and tvOS.

Changes:
- Add tvOS target support (aarch64-apple-tvos, aarch64-apple-tvos-sim)
- Consolidate examples/ios and examples/tvos into examples/apple
- Single Xcode project with iOS and tvOS targets sharing source files
- Unified sine wave demo (440Hz) for both platforms
- Platform-specific code via #[cfg(target_os)] in Rust and
  #if TARGET_OS_TV in Objective-C
- SDK-conditional library search paths in Xcode project
- Build script detects SDKROOT to build only relevant targets
- Update CI workflow for both platforms

tvOS is a Tier 3 target requiring nightly toolchain with -Zbuild-std.
Comment on lines +73 to +76
- name: Build for tvOS simulator
run: cd examples/apple && cargo +nightly build -Zbuild-std --target aarch64-apple-tvos-sim --release
- name: Build for tvOS device
run: cd examples/apple && cargo +nightly build -Zbuild-std --target aarch64-apple-tvos --release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are duplicated in the buildscript that's called from the xcodebuild call. Granted, they do check different things. It's not a big deal.

Copy link
Member

@simlay simlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! This turned out to be more work than I was expecting. I might follow up with a few minor refactors to CI. Doing them in this PR has some friction as I've gotta approve CI runs for first time contributors.

@simlay simlay merged commit d0545fc into RustAudio:master Dec 18, 2025
8 checks passed
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.

2 participants