Skip to content

Error on first run after iOS simulator is updated #780

@freakboy3742

Description

@freakboy3742

The first time you attempt to run an app in the iOS simulator after installing or updating the iOS simulator, the simulator fails to start at the point when it tries to identify the available simulators.

To Reproduce
Steps to reproduce the behavior:

  1. On a completely clean macOS install, install Xcode
  2. Generate a new Briefcase project
  3. run briefcase run iOS
  4. Briefcase fails with the error: "Unable to parse output of xcrun simctl":

briefcase.2022_07_06-11_12_50.run.log

The error will also occur when Xcode undergoes a major version update, and the simulator is updated.

Expected behavior

Briefcase should present a list of available simulator images on first run.

Environment:

  • Operating System: macOS (any)
  • Python version: any
  • Software versions:
    • Briefcase: 0.3.8

Additional context

The problem appears to be caused by stray content in the output being parsed. From the log above:

>>> Running Command:                                                                                                                                    subprocess.py:434
>>>     xcrun simctl list -j                                                                                                                            subprocess.py:435
>>> Command Output:                                                                                                                                     subprocess.py:453
>>>     Install Started                                                                                                                                 subprocess.py:455
>>>     1%.........20.........40.........60.........80.........Install Succeeded                                                                        subprocess.py:455
>>>     {                                                                                                                                               subprocess.py:455
>>>       "devicetypes" : [                                                                                                                             subprocess.py:455
>>>         {                                                                                                                                           subprocess.py:455
>>>           "productFamily" : "iPhone",                                                                                                               subprocess.py:455
>>>           "bundlePath" :                                                                                                                            subprocess.py:455
...

Briefcase currently takes the literal output of the command, and attempts to parse it as JSON. The stray content in the first two lines ("Install started, 1%... ") isn't valid JSON, so the parse fails.

When you run a second time, the stray content isn't present; the entire command output is parseable JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.good first issueIs this your first time contributing? This could be a good place to start!iOSThe issue relates to Apple iOS mobile support.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions