LiveWire for iPhone
  • Swift 80%
  • HTML 18.1%
  • Shell 1%
  • Python 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-20 04:58:52 +00:00
design feat(sports): A tap opens the game page, and guide matches show the listing 2026-11-16 23:45:02 -05:00
LiveWire tvOS: the player, with Channels and Options panels (phase 3) 2026-11-18 02:19:40 -05:00
LiveWire.xcodeproj tvOS: catch up with the Android TV app (audit of LiveWireTV) 2026-11-19 23:35:42 -05:00
LiveWireTests tvOS: catch up with the Android TV app (audit of LiveWireTV) 2026-11-19 23:35:42 -05:00
LiveWireTV tvOS Guide: All channels under Favorites, and Search all for a keyword 2026-11-19 23:51:42 -05:00
LiveWireTVUITests tvOS Guide: All channels under Favorites, and Search all for a keyword 2026-11-19 23:51:42 -05:00
LiveWireUITests feat(sports): A tap opens the game page, and guide matches show the listing 2026-11-16 23:45:02 -05:00
scripts tvOS: app icon, Top Shelf image, release-tvos.sh and README (phase 6) 2026-11-19 20:17:20 -05:00
Shared tvOS: catch up with the Android TV app (audit of LiveWireTV) 2026-11-19 23:35:42 -05:00
.gitignore feat: Add the KSPlayer spike for the IPTV pool 2026-11-05 13:59:37 -05:00
project.yml tvOS: app icon, Top Shelf image, release-tvos.sh and README (phase 6) 2026-11-19 20:17:20 -05:00
README.md tvOS: app icon, Top Shelf image, release-tvos.sh and README (phase 6) 2026-11-19 20:17:20 -05:00

LiveWire for iPhone

A personal, sideloaded iPhone app for the IPTV pool, built on KSPlayer so it plays the pool's raw MPEG-TS streams. It uses the B · Grid design and fonts of the Android TV app, namillis/LiveWireTV. Layouts were picked from design/phase2-core-mockups.html (option C, Watch & browse) and design/phase2-guide-mockups.html (option 1, compact grid).

Screens

  • Watch (home): the video docked on top, what's on now, category chips and the channel list. Tap a row to switch in place, swipe the video to change channel, turn the phone or tap the expand button for full screen. Press and hold a channel to favorite it.
  • Guide: the TV grid fitted to a phone (logo column, about 1¼ hours across, red now-line). Tap a programme for Watch live / Watch from start; tap NOW to jump back.
  • Sports: ESPN's scoreboards for the TV app's 7 leagues (NFL, NCAAF, NBA, NCAAB, MLB, NHL, EPL) in On now, Coming up and Finished, with league chips, scores, the clock and the networks (layout A in design/phase9-sports-mockups.html). A game the pool's Live Sports list carries has a Live Now pill and plays it on tap. Other games are matched to your own channels (network, local affiliate, a channel named after the game, or the guide; LiveWireTV's ChannelMatcher), and the pill names the best one. ⋯ or a long-press opens the game's page: the scoreboard, Watch on the best channel, the other channels with why each matched, and the pool's sources to pin one (layout C in design/phase10-sports-sources-mockups.html). "No stream found" opens Search with a team's name. The pool's other events (tennis, F1, smaller college games) follow under More from the pool. Scores reload when the tab opens, when the app comes back, and every 30 s while a game is live, and the Live Sports list reloads with them.
  • Search: channels by name and programmes in the guide by title.
  • Settings: stream format, background playback and picture-in-picture, guide refresh, favorites, Manage providers.

Providers

No provider is built in. The first launch walks through setup (Welcome → Xtream or M3U → details → a sign-in / channels / guide check). Settings → Manage providers lists them with ACTIVE and BACKUP tags. Tap one to switch, swipe left or press and hold to edit, delete or mark it the backup, and add more with one sheet that switches between Xtream Codes and M3U playlist. When the active provider can't load, the app loads the backup and says so on Watch. Layouts are from design/phase5-provider-mockups.html (A for first run, B for the add sheet).

Passwords are in the Keychain (provider.<id>). Favorites and the last channel are kept per provider. An M3U playlist (optionally gzipped) can carry its own guide link (url-tvg) or take one in the EPG URL field.

Outside the app: the stream keeps playing in the background (sound, and video in picture-in-picture when you swipe home). The lock screen and Control Center show the programme, channel and logo with play/pause and next/previous channel. The video controls have picture-in-picture and AirPlay buttons.

The video view lives in RootView and moves between the docked, mini-player and full-screen spots, so switching tabs never restarts the stream. Going to the background calls pool_stop; coming back resumes the channel.

What's here

  • LiveWire/Providers.swift: saved providers, active and backup, the M3U parser.
  • LiveWire/ProviderViews.swift: first-run setup, the add sheet, Manage providers.
  • LiveWire/PoolClient.swift: Xtream or M3U per provider, channels, xmltv.php, pool_info, pool_sources, pool_stop, live URLs with try=N / why=refused / source=, /timeshift/.
  • LiveWire/EPGStore.swift: stream-parses the guide (from a pool with guide_window, only 2 h back to 16 h ahead), keeps 6 h back to 24 h ahead for channels in the list, and uses the saved file for 4 hours. After that it shows the old file while a new one downloads, sending its ETag so an unchanged guide answers 304.
  • LiveWire/PlaybackController.swift: KSPlayer's FFmpeg engine (AVPlayer first for .m3u8), up to 3 tries, no retry on 404, pool_stop on every channel change.
  • LiveWire/AppModel.swift, RootView.swift, WatchView.swift, GuideView.swift, OtherTabs.swift, Theme.swift: the app.
  • LiveWire/Sports/: the Sports tab. EspnClient fetches and maps the scoreboards, SportsList holds the list rules and the Live Now matching (ported from LiveWireTV's SportsList.kt, SportsFormat.kt and SportsRepository.kt), SportsStore reloads them, SportsView draws them.
  • LiveWireTests/: unit tests (the TV app's Sports tests, ported to XCTest).
  • LiveWire/SpikeRunner.swift: the Phase 1 unattended playback test.
  • scripts/shot.sh: launches the app in the Simulator with launch arguments and saves a screenshot.

Build

The Xcode project is generated from project.yml with XcodeGen, and the generated LiveWire.xcodeproj is committed, so you can open it directly.

To install on your iPhone, open LiveWire.xcodeproj and pick your Apple ID team under Signing & Capabilities. Then choose your iPhone as the run destination and press Run. With a free Apple ID the install expires after 7 days and needs a re-run from Xcode.

KSPlayer is pinned to 2.3.4, the last release that ships as source. From 5.x the free (GPL) KSPlayer is a binary with no iPhone-device slice (Simulator, macOS and tvOS only).

Install with SideStore or AltStore

Add this source in SideStore (Sources → +), then install LiveWire from it:

https://git.namillis.me/namillis/LiveWireiOS/raw/branch/sidestore/livewire-ios.json

SideStore signs the app with your Apple ID. With a free Apple ID the install lasts 7 days and SideStore refreshes it on the phone.

Releasing an IPA

scripts/release.sh "What's new"            # every release: 1.1.13 → 1.1.14
scripts/release.sh "What's new" minor      # a bigger feature set: 1.1.14 → 1.2.15
scripts/release.sh "What's new" major      # 1.2.15 → 2.0.16

Versions are MAJOR.MINOR.RELEASE. The last number is the build number, one past the source's latest build, so it goes up by one on every release. The first releases, once all "1.0" (builds 1–12), were renumbered 1.0.1–1.0.12, and 1.1.0 (build 13) became 1.1.13: each IPA was rebuilt with its new version and re-attached to its release, and the source points at it.

From a pushed commit, this:

  1. Builds an unsigned Release IPA with that version and build.
  2. Creates the Forgejo release v<version> with the IPA attached, using fj.
  3. Downloads the IPA back and checks its SHA-256.
  4. Adds the version and a News item to livewire-ios.json on the sidestore branch and pushes it.

The News item (AltStore's News format) is titled "LiveWire ", links to the release page and shows the app's banner. Its caption is the notes' first line when they have several ($'Score bar\n\nMore detail…'), else their first sentence. scripts/source.py backfill-news <file> --apply adds News for any release without one (a dry run without --apply).

Nothing in project.yml needs bumping. Settings → About shows the version and build.

The app icon is drawn by scripts/make-icon.swift (option B in design/phase6-icon-mockups.html).

Apple TV

LiveWireTV/ is the Apple TV app (tvOS 18, bundle id me.namillis.livewire.tvos). It's a second target in the same project and compiles the same Shared/ code as the iPhone app: the providers, guide, playback and Sports. You drive it with the Siri Remote.

Install and updates

atvloadly installs it on the Apple TV from this source:

https://git.namillis.me/namillis/LiveWireiOS/raw/branch/sidestore/livewire-tvos.json

atvloadly signs the app with a free Apple ID and installs new versions from the source. A free Apple ID's signature lasts 7 days, so atvloadly re-signs the app every night. Settings → About shows when the signature runs out, and Home warns when fewer than 2 days are left. tvOS apps can't install apps, so there's no in-app updater.

There's no Top Shelf extension, only a static Top Shelf image: an extension needs another App ID, and a free Apple ID allows 10 a week.

Build and run

In Xcode, pick the LiveWireTV scheme and an Apple TV Simulator, then press Run. From the command line:

xcodebuild -project LiveWire.xcodeproj -scheme LiveWireTV \
  -destination 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)' build

To run on the Apple TV itself, pair it with Xcode once: on the Apple TV open Settings → Remotes and Devices → Remote App and Devices, then pick it in Xcode under Window → Devices and Simulators. Then choose it as the run destination. These builds are signed with the Mac's Apple ID, so they install next to the atvloadly copy.

The icon and Top Shelf images are drawn by scripts/make-tv-icon.swift from the iPhone icon's art. It writes the layered icon (a gradient back layer and the mark on a front layer) and the Top Shelf images into LiveWireTV/Assets.xcassets/AppIcon.brandassets:

swift scripts/make-tv-icon.swift LiveWireTV/Assets.xcassets/AppIcon.brandassets

Releasing

DRY_RUN=1 scripts/release-tvos.sh "What's new"   # builds the IPA, publishes nothing
scripts/release-tvos.sh "What's new"             # every release: 1.0.1 → 1.0.2
scripts/release-tvos.sh "What's new" minor       # 1.0.2 → 1.1.3

It works like release.sh, with its own version numbers. The first release starts livewire-tvos.json at 1.0.1. From a pushed commit, this:

  1. Builds an unsigned Release IPA for generic/platform=tvOS, named LiveWire-tvOS-<version>.ipa.
  2. Creates the Forgejo release tvos-v<version> with the IPA attached, using fj.
  3. Downloads the IPA back and checks its SHA-256.
  4. Adds the version and a News item to livewire-tvos.json on the sidestore branch and pushes it.

A dry run builds the IPA, then prints the tag, the IPA's size and SHA-256, and the source entry it would add. It skips the pushed-commit check. Set SOURCE_PACKAGES to reuse a folder of cloned Swift packages.

atvloadly guesses the platform from words in the app's name, bundle id and file name. "tvos" means tvOS, and "ios" or "iphone" mean iPhone, so the source keeps those words out of the name and subtitle. scripts/source.py init-tvos checks this when it starts the source.

Tests

xcodebuild test -project LiveWire.xcodeproj -scheme LiveWire -destination 'platform=iOS Simulator,name=iPhone 17'

After changing project.yml, run xcodegen generate and commit the project with it.

LiveWireUITests taps through Sports on a real provider. It's skipped unless the login comes from the environment, so none is in the source:

TEST_RUNNER_LW_SERVER=<server> TEST_RUNNER_LW_USER=<user> TEST_RUNNER_LW_PASSWORD=<password> \
  xcodebuild test -project LiveWire.xcodeproj -scheme LiveWire -destination 'platform=iOS Simulator,name=iPhone 17'

Spike run

xcrun simctl launch --stdout=spike.log <device> me.namillis.livewire \
  -spikeIds 2216,1740,30234 -spikeLiveNow 2 -spikeCatchup 2604 -spikeRetry 1900 -spikeHold 12

Results are printed as SPIKE … lines and written to Documents/spike-results.json.

Screenshots in the Simulator

scripts/shot.sh guide 14 -noAutoplay -play 1740 -tab guide -guideCat 524

Launch arguments (see AppModel.applyLaunchArguments): -tab watch|guide|sports|search|settings, -play <stream id>, -watchCat / -guideCat <category id|fav>, -pick <id>[:<minutes from now>] (opens the programme sheet; add -fromStart to play it from catch-up), -fav <id,id>, -search <text>, -guideSearch <text> (opens the Guide's channel search; prefix ! to include channels without a guide), -full, -noAutoplay, -providers (opens Manage providers), -addProvider (opens the add sheet).

Debug builds only, so no login has to live in the source:

  • -login <server> <username> <password> adds an Xtream provider when there is none.
  • -resetProviders deletes every provider, to see the first-run setup.
  • -prefill <server> <username> <password> fills the setup and add forms (the Simulator can't type into a password field from automation).
  • -connectTest <server> <username> <password> [backup] or -connectTest m3u <url> [backup] runs the add sheet's Connect without UI and prints CONNECT … and PROVIDERS … lines.
  • -failoverTest points the active provider at an unreachable address (saved) so the next load falls back to the backup. Re-add the provider afterwards.
  • -steps "4:zap,12:land,24:zap,32:port" turns the phone (land / port), changes channel (zap) or plays a stream id at each second mark, and prints a STEP line with the player state. Capture it with xcrun simctl launch --console-pty (--stdout refuses commas).
  • -ffmpeg uses the FFmpeg engine for HLS too, to test it with HLS-only playlists.
  • -slowLoad <seconds> waits before loading, to see the loading states.
  • -sportsLeague <id> opens Sports with a league chip on (nfl, nhl, …). -sportsFail makes every ESPN league fail, to see the error state. -sportsDetail <n> opens the nth game's page (none: the first game nothing carries), and -sportsNoChannels shows a page as if nothing did. Each scoreboard reload prints a SPORTS line, and each match run its timing and unmatched games.
  • -captions turns subtitles on for every channel that has them (the remembered CC choice). Apple's img_bipbop_adv_example_ts/v5/prog_index.m3u8 sample carries broadcast captions.
  • -stallTest <seconds> reports a stall that long after each start of playback, to test reconnecting (it gives up on the third stall within a minute).
  • -archiveTest <url> <minutes> plays a stream as catch-up of a programme that aired 3 hours ago, to try seeking without a catch-up provider. Apple's img_bipbop_adv_example_fmp4/master.m3u8 sample is seekable. -steps also takes jf / jb (a double-tap forward or back), seek<N> (drag to N minutes in) and live (Go live). -noNativeSeek forces every seek to reopen the stream, as on a provider that can't seek.

Known issues

  • KSPlayer 2.3.4's interlace detector (KSOptions.filter(log:)) traps on an integer overflow. LiveOptions turns it off. Streams that flag interlaced fields still get yadif.
  • Catch-up keeps FFmpeg's default probing: with the 1 MB live cap, ESPN's archive opened without its video track.
  • Picture-in-picture can't be tested in the Simulator (isPictureInPictureSupported is false there), so its button only shows on a real iPhone.
  • AirPlay to an Apple TV carries sound only while the FFmpeg engine plays (MPEG-TS, the default); the app says so and points to Screen Mirroring or the HLS stream format.