Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Framework/install_handler/ios/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ async def _create_default_device() -> bool:
await _send_status("error", f"Auto-creation of device failed: {e}")
return False


def fallback_is_xcode_installed() -> bool:
try:
result = subprocess.run(
["xcode-select", "-p"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
check=True
)
return bool(result.stdout.strip())
except (subprocess.CalledProcessError, FileNotFoundError):
return False


async def check_status() -> bool:
"""Check if iOS Simulator is installed and available."""
print("[simulator] Checking status...")
Expand All @@ -125,7 +140,7 @@ async def check_status() -> bool:
await _send_status("error", "Unsupported OS. iOS Simulator is only available on macOS.")
return False

if not os.path.exists("/Applications/Xcode.app"):
if not os.path.exists("/Applications/Xcode.app") and not fallback_is_xcode_installed():
await _send_status("not installed", "Xcode must be installed before using iOS Simulator.")
return False

Expand Down
15 changes: 14 additions & 1 deletion Framework/install_handler/ios/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,21 @@ def _get_webdriver_path() -> Path:
home = Path.home()
return home / ".zeuz" / "WebDriverAgent"

def fallback_is_xcode_installed() -> bool:
try:
result = subprocess.run(
["xcode-select", "-p"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
check=True
)
return bool(result.stdout.strip())
except (subprocess.CalledProcessError, FileNotFoundError):
return False

async def _check_xcode_installed() -> bool:
if not os.path.exists("/Applications/Xcode.app"):
if not os.path.exists("/Applications/Xcode.app") and not fallback_is_xcode_installed():
return False
return shutil.which("xcodebuild") is not None

Expand Down
16 changes: 15 additions & 1 deletion Framework/install_handler/macos/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ async def _send_status(category, status: str, comment: str):
)


def fallback_is_xcode_installed() -> bool:
try:
result = subprocess.run(
["xcode-select", "-p"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
check=True
)
return bool(result.stdout.strip())
except (subprocess.CalledProcessError, FileNotFoundError):
return False


async def xcode_check_status(category) -> bool:
"""Check if Xcode is installed and license is accepted."""
print("[xcode] Checking status...")
Expand All @@ -32,7 +46,7 @@ async def xcode_check_status(category) -> bool:
return False

xcodebuild_path = shutil.which("xcodebuild")
if not xcodebuild_path or not os.path.exists("/Applications/Xcode.app"):
if not xcodebuild_path and not os.path.exists("/Applications/Xcode.app") and not fallback_is_xcode_installed():
await _send_status(category, "not installed", "Xcode is not installed.")
return False

Expand Down
Loading