-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(cli): Select a cap run target by target name #8199
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, working for iOS, but I'm getting this problem when I try to use this with an Android device.
If I run npx cap run android I get the device as an option, and can select it to run a build - but once I provide it npx cap run android --target-name <targetName>, the command fails, seems it can't find that target name, and undefined appears as an option instead of the actual device name. For emulators it seems fine.
[error] Invalid target name: HMD Global Nokia 5.3.
Valid targets are: undefined [...], ...Is there any difference between the device names showing up as options in npx cap run and the ones used to filter for target-name?
This PR adds a
--target-nameflag tocap run ios|androidto select a run target by name instead of its ID.example:
Its up to the developer to make sure their emulators / simulators have unique names.
To target emulators / simulators with similar names but different OS versions:
closes: #8111