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

This commit is contained in:
Jenn Magder
2020-09-02 11:11:07 -07:00
committed by GitHub
parent a8281e31af
commit 4fde217dea
5 changed files with 323 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`.
///