Skip to content

[Bug]: cap run android --list fails with no error message when no devices are available #8003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
Pyroglyph opened this issue May 11, 2025 · 2 comments · May be fixed by #8015
Open
3 tasks

[Bug]: cap run android --list fails with no error message when no devices are available #8003

Pyroglyph opened this issue May 11, 2025 · 2 comments · May be fixed by #8015
Labels
cli type: bug A confirmed bug report

Comments

@Pyroglyph
Copy link

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0

[success] Android looking great! 👌

Other API Details

Bun 1.2.12
Node 23.11.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

cap run android --list fails with no error message when no devices are connected:

$ bunx cap run android --list
[fatal] native-run failed with error

  
  
        More details for this error may be available online: https://github.com/ionic-team/native-run/wiki/Android-Errors

Directly calling native-run works normally:

$ bunx native-run android --list

Connected Devices:

  No connected devices found

Virtual Devices:

  No virtual devices found

When connecting a device, the original command works:

$ bunx cap run android --list
Name           API      Target ID
----------------------------------
Sony XQ-BQ52   API 33   <redacted>

Expected Behavior

I expect cap run android --list to not fail when no devices are present. Or at the very least, have an actual error message.

Project Reproduction

You can just use the blank project created with @capacitor/app

Additional Information

No response

@jcesarmobile jcesarmobile added cli type: bug A confirmed bug report and removed triage labels May 15, 2025
Copy link

ionitron-bot bot commented May 15, 2025

This issue has been labeled as type: bug. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.

@jcesarmobile
Copy link
Member

Yeah, native-run doesn't return any errors when there are no devices, but Capacitor CLI assumes that if there are no devices then there are errors, so it shows an empty error message because there are no devices and no errors.
The CLI should show if there are any errors instead of assuming there are.

@Chuckytuh Chuckytuh linked a pull request May 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli type: bug A confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants