Hi @lore-lml! I’m Dosu and I’m helping the Tuist team.
Great analysis — I can confirm this is a valid bug. The TransportType enum in DeviceController.swift only defines localNetwork and wired, so when devicectl returns "sameMachine" for simulators, JSONDecoder throws a DecodingError before the compactMap filter can run, taking down the entire device list.
The fix would involve two changes in DeviceController.swift:
-
Add the missing case to the
TransportTypeenum [1]:enum TransportType: String, Codable {case localNetworkcase wiredcase sameMachine} -
Handle it in the mapping to
PhysicalDevice[2]:let transportType: PhysicalDevice.TransportType? = switch device.connectionProperties.transportType {case .localNetwork: .wificase .wired: .usbcase .sameMachine: .none // simulators — no physical transportcase .none: .none}
A more resilient alternative would be to implement a custom init(from decoder:) on TransportType that decodes unknown raw values as nil instead of throwing, which would future-proof against any other new transport types Apple may add. Something like:
init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let rawValue = try container.decode(String.self)
self = TransportType(rawValue: rawValue) ?? .unknown
}
This would prevent future breakage if Apple introduces additional transport types.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.