From 7280822a4da35c0f8035ee5fb3251223373a8b5a Mon Sep 17 00:00:00 2001 From: Michael Dahlberg Date: Mon, 19 May 2025 15:49:36 -0400 Subject: [PATCH] Briefcase Issue 2286 Unless an Apple Simulator Control Device is installed, a 'briefcase build iOS' will fail. It can be determined from the command `xcrun simctl list devices`. A successful output will return a number of iOS devices. --- src/briefcase/integrations/xcode.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/briefcase/integrations/xcode.py b/src/briefcase/integrations/xcode.py index a9d4e7b24..cf9d92bfb 100644 --- a/src/briefcase/integrations/xcode.py +++ b/src/briefcase/integrations/xcode.py @@ -202,6 +202,19 @@ def ensure_xcode_is_installed( """ ) from e + try: + # Check for iOS simulated devices + result = subprocess.run(['xcrun', 'simctl', 'list', 'devices'], + capture_output=True, text=True, check=True) + output = result.stdout + if re.search(r"== Devices ==\s*$", output): + raise BriefcaseCommandError( + preamble = """\ +There are no Apple Simulator Control devices installed. They are usually +part of the Xcode iOS Component installation. It can be installed +from the Xcode GUI, settings -> Components -> iOS. +""" + ) from e class XcodeCliTools(Tool): name = "xcode_cli"