Read the iPhone's own name for its host and tailnet node

This commit is contained in:
Ian Gulliver
2026-10-22 09:25:15 -07:00
parent fedd4ad673
commit 08fe45814e
4 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -17,5 +17,5 @@ The simulator's window (Xcode's Device Hub) lists the app's own accessibility el
## Platform facts
- CloudKit on iOS requires the `remote-notification` background mode in `Info.plist`, even though the app sets up no push of its own.
- `ProcessInfo.hostName` is the Mac's name in the simulator and meaningless on a phone, so the phone's tailnet node and `Byre-Host` are named `iPhone`.
- The phone's tailnet node and `Byre-Host` take its name from `UIDevice.current.name`, which iOS reads only on the main actor (so the app delegate reads it first) and returns as just `iPhone` unless the app has the `com.apple.developer.device-information.user-assigned-device-name` entitlement. Apple grants that entitlement on request (developer.apple.com/contact/request/user-assigned-device-name); it then has to be enabled on the App ID and added to `mac/phone/byre.entitlements`. The simulator returns the simulator device's own name without it.
- SwiftTerm's iOS `TerminalViewDelegate` requires `requestOpenLink`, which its macOS one provides a default for.