Skip to content

Repository files navigation

AirPlay Monitor

Android app that receives AirPlay screen mirroring from a Mac, so a tablet can act as a wireless second display.

Features

  • Discoverable on the LAN as AirPlay Monitor (mDNS _airplay._tcp + _raop._tcp)
  • AirPlay mirror handshake (pairing, FairPlay, SETUP / RECORD)
  • H.264 video decrypt + hardware decode (MediaCodec)
  • Fullscreen display when a stream starts
  • Foreground service keeps the receiver alive while streaming

Requirements

  • Android 7.0+ (API 24)
  • Mac and tablet on the same Wi‑Fi (client isolation / guest networks usually break discovery)
  • Android NDK 27 (used to build the FairPlay native library)

Build

./gradlew :app:assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk

Usage

  1. Install and open AirPlay Monitor on the tablet; grant notification / nearby-device permissions if asked.
  2. Confirm the service is running (status shows the device IP and port 7000).
  3. On the Mac: Control Center → Screen Mirroring → AirPlay Monitor.
  4. Choose Mirror or Use As Separate Display.
  5. The tablet opens a fullscreen view when video starts.

Project layout

app/src/main/java/com/airplaymonitor/app/
  protocol/   AirPlay server, pairing, FairPlay, mirror stream
  service/    Foreground receiver + mDNS
  video/      Frame bus + MediaCodec decoder
  ui/         Main screen + fullscreen display
app/src/main/cpp/playfair/   FairPlay ekey decrypt (JNI)

Limitations

  • Audio is not rendered yet
  • DRM content (e.g. Apple TV app) cannot be decrypted
  • Multicast-blocked networks hide the device from the Mac

Troubleshooting

adb logcat | grep -iE 'airplay|fairplay|mirror|pair'
Issue Things to check
Not listed on Mac Same Wi‑Fi; restart the app; no AP isolation
Connects then drops Pair / FairPlay errors in logcat
Black screen Stream logs present? Try Open Display in the app

Third-party code

See THIRD_PARTY.md.

  • Protocol reference: RPiPlay, UxPlay, shairplay
  • Vendored: PlayFair under app/src/main/cpp/playfair/ (upstream license)
  • Gradle deps: JmDNS, Bouncy Castle, AndroidX

No git submodules are required to build.

License

  • Application code: MIT (unless noted otherwise)
  • PlayFair: see app/src/main/cpp/playfair/LICENSE.md

Not affiliated with Apple Inc. AirPlay is a trademark of Apple Inc.

About

Add Android device as secondary display to Mac using Airplay

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages