Skip to content

[ios][tools] Do not add duplicate bonjour services to Info.plist #173057

@hellohuanlin

Description

@hellohuanlin

Steps to reproduce

I was just reading the code, and there is a logic error here:

ProcessResult result = runSync('plutil', <String>[
'-extract',
'NSBonjourServices',
'xml1',
'-o',
'-',
builtProductsPlist,
], allowFail: true);
if (result.exitCode == 0) {
runSync('plutil', <String>[
'-insert',
'NSBonjourServices.0',
'-string',
'_dartVmService._tcp',
builtProductsPlist,
]);
} else {

If the bonjour services is already setup properly, we shouldn't add duplicate _dartVmService._tcp entry to it.

Expected results

No duplicate entries in bonjour services

Actual results

I wrote a simple test and got duplicate values:

              '\t<key>NSBonjourServices</key>\n'
              '\t<array>\n'
              '\t\t<string>_dartVmService._tcp</string>\n'
              '\t\t<string>_dartVmService._tcp</string>\n'
              '\t\t<string>_bogus._tcp</string>\n'
              '\t</array>\n'

Code sample

NA

Screenshots or Video

NA

Logs

NA

Flutter Doctor output

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions