Add observatory Bonjour service to built iOS Info.plist bundle (#65138)

This commit is contained in:
Jenn Magder
2020-09-02 17:57:43 -07:00
committed by GitHub
parent c034f1a1cc
commit 5e0aa8b9fc
5 changed files with 352 additions and 97 deletions

View File

@@ -5,6 +5,8 @@
import 'dart:async';
import 'dart:convert';
import 'package:path/path.dart' as path;
import 'utils.dart';
typedef SimulatorFunction = Future<void> Function(String deviceId);
@@ -102,6 +104,40 @@ Future<bool> containsBitcode(String pathToBinary) async {
return !emptyBitcodeMarkerFound;
}
Future<bool> dartObservatoryBonjourServiceFound(String appBundlePath) async =>
(await eval(
'plutil',
<String>[
'-extract',
'NSBonjourServices',
'xml1',
'-o',
'-',
path.join(
appBundlePath,
'Info.plist',
),
],
canFail: true,
)).contains('_dartobservatory._tcp');
Future<bool> localNetworkUsageFound(String appBundlePath) async =>
await exec(
'plutil',
<String>[
'-extract',
'NSLocalNetworkUsageDescription',
'xml1',
'-o',
'-',
path.join(
appBundlePath,
'Info.plist',
),
],
canFail: true,
) == 0;
/// Creates and boots a new simulator, passes the new simulator's identifier to
/// `testFunction`.
///