Support simulators in a custom device set (simctl --set / -DVTSimulatorSetLocation)

Ouverte
#571 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
mobile-dev, tooling

Piste de recherche

Start by reading build/utils/infer-platform.js and build/utils/simulator-utils.js, then trace the simulator tool calls named in the issue, including get_sim_app_path.js and screenshot.js. Map how session defaults and per-call parameters reach simctl, xcodebuild, and AXe, and check whether AXe accepts a device-set path. Done means the simulator tools can operate on a custom device set across the listed flows; the issue does not specify a test file.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Summary

XcodeBuildMCP can build and test on a simulator that lives outside Xcode's default device set, but its device tools cannot find that simulator. Simulator-sharing tools such as simlock keep leased devices in their own set (~/.simlock/devices/ios by default) so agents running in parallel cannot touch each other's devices. Supporting a device-set path would let XcodeBuildMCP drive those devices end to end.

Tested with XcodeBuildMCP 2.7.0, Xcode 27.2, iOS 26.5 simulator, simlock 0.6.0.

What works today

build_sim and test_sim work once the session defaults carry the UDID, simulatorPlatform: "iOS Simulator" and extraArgs: ["-DVTSimulatorSetLocation=<set path>"]. In one run that built a 251-test app and passed every test on the leased device.

What fails

Every device operation shells out to plain xcrun simctl, which only sees the default set. Neither --set nor DVTSimulatorSetLocation appears anywhere in build/.

  1. Platform inference. Without an explicit simulatorPlatform, build and test stop with "Unable to determine the simulator platform", because inferPlatformFromSimctl lists only the default set (build/utils/infer-platform.js). Name lookup in build/utils/simulator-utils.js has the same limit.
  2. App path. get_sim_app_path reports the simulator as not found. It resolves build settings without the session's extraArgs (build/mcp/tools/simulator/get_sim_app_path.js), so the device-set flag never reaches xcodebuild -showBuildSettings.
  3. Device commands. install_app_sim, launch_app_sim, stop_app_sim, boot_sim, log capture and screenshot call xcrun simctl install|launch|terminate|boot|spawn|io without --set. screenshot first resolves the device through xcrun simctl list devices -j (build/mcp/tools/ui-automation/screenshot.js) and reports it missing.
  4. UI snapshot. snapshot_ui passes the UDID to AXe (build/mcp/tools/ui-automation/snapshot_ui.js), which also looks only in the default set.

The tools' suggested next steps compound this. After build_sim the server suggests get_sim_app_path, and after get_app_bundle_id it suggests install_app_sim and launch_app_sim, all of which fail on such a device.

Proposal

A simulatorDeviceSet session default (and per-call parameter) that, when set:

  • adds --set <path> to every xcrun simctl call, including the list calls used for platform inference and name lookup;
  • adds -DVTSimulatorSetLocation=<path> to every xcodebuild call, including the build-settings call behind get_sim_app_path;
  • passes the set to AXe, if AXe supports one.

An environment-variable fallback (for example SIMULATOR_DEVICE_SET) would let a lease wrapper hand the path over without an extra session_set_defaults call.

Related, smaller

test_sim returns every test case in its result even with progress: false (about 12k tokens for 251 tests). An option to return only the counts and failures would help agents running large suites.

Langage dominant
TypeScript
Étoiles
6.6k
Forks
329
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de getsentry/MobileBuildMCP

Toutes les issues de getsentry/MobileBuildMCP

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.