Skip to content

[feat] Add interactive device selection when multiple iOS or Android devices are available #15932

Description

@luissince

Describe the problem

When running Tauri mobile development commands and multiple physical devices or simulators are available, Tauri may automatically select one device instead of interactively asking the developer which device should be used.

This can be inconvenient when both a physical device and a simulator are available.

Example: iOS

My development machine had both a physical iPhone and an iOS Simulator available:

== Devices ==

MacBook Pro de Luis
iPhone de Luis (17.7.1)

== Simulators ==

iPhone 15 (26.3.1)

The iPhone simulator had the identifier:

76BDA1C1-2D8E-415A-A57B-939EE4C71599

The physical iPhone was also available to Xcode, including wireless connectivity.

Running:

npm run tauri ios dev

could select the physical device automatically.

To use the simulator, I had to explicitly provide the device:

npm run tauri ios dev -- "76BDA1C1-2D8E-415A-A57B-939EE4C71599"

Expected behavior

When multiple compatible destinations are available, Tauri could optionally display an interactive selection:

Multiple devices found:

1. iPhone de Luis (iOS 17.7.1) [physical]
2. iPhone 15 (iOS 26.3.1) [simulator]

Select device:
>

The selected destination would then be used for the development session.

Why this is useful

Physical iOS devices can remain available to Xcode over Wi-Fi even after the USB cable has been disconnected.

For example:

Physical iPhone: connected
iOS Simulator: booted

In this situation, automatic selection may not match the developer's intention.

The same situation can occur with multiple Android devices/emulators.

Desired behavior

When more than one valid device is detected:

  1. Detect all available devices.
  2. Show their platform, type and name.
  3. Allow the developer to select one interactively.
  4. Continue normally after selection.

A non-interactive option should still be available for scripts/CI, for example:

tauri ios dev "<UDID>"

which already provides an explicit way to select a destination.

Cross-platform scope

This would be useful for both:

iOS
- physical devices
- simulators

Android
- physical devices
- emulators

Related discussion

There is already a Tauri discussion proposing simulator/device pre-selection via the command line, including the problem of working with multiple simulators:

#9664

Expected outcome

Tauri should provide a convenient interactive destination-selection experience when multiple mobile devices are available, while preserving explicit device selection for automation and CI.

Describe the solution you'd like

My development machine had both a physical iPhone and an iOS Simulator available:

Multiple devices found:

  1. iPhone de Luis (iOS 17.7.1) [physical]
  2. iPhone 15 (iOS 26.3.1) [simulator]

Select device:

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions