(opts: {
udid: string;
deviceName: string;
spawn?: SpawnImpl;
resolve?: ResolveImpl;
legacyResolve?: ResolveImpl;
})
| 217 | * Returns the first address that any strategy yields, or null. |
| 218 | */ |
| 219 | export async function resolveTunnelIPv6(opts: { |
| 220 | udid: string; |
| 221 | deviceName: string; |
| 222 | spawn?: SpawnImpl; |
| 223 | resolve?: ResolveImpl; |
| 224 | legacyResolve?: ResolveImpl; |
| 225 | }): Promise<string | null> { |
| 226 | const spawn = opts.spawn ?? defaultSpawn; |
| 227 | const resolveLookup = opts.resolve ?? defaultResolve; |
| 228 | const resolveLegacy = opts.legacyResolve ?? legacyResolve6; |
| 229 | |
| 230 | // 1. devicectl-based |
| 231 | const fromDevicectl = getDeviceTunnelIPv6FromDevicectl(opts.udid, spawn); |
| 232 | if (fromDevicectl) return fromDevicectl; |
| 233 | |
| 234 | // 2. mDNS via dns.lookup |
| 235 | const fromLookup = await getDeviceTunnelIPv6(opts.deviceName, resolveLookup); |
| 236 | if (fromLookup) return fromLookup; |
| 237 | |
| 238 | // 3. last-resort: legacy dns.resolve6 |
| 239 | const fromLegacy = await getDeviceTunnelIPv6(opts.deviceName, resolveLegacy); |
| 240 | return fromLegacy; |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Check whether a specific bundle ID has a running process on the device. |
no test coverage detected