Skip to content
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

chore(run-android): deprecate --deviceId in favour of --device #2377

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

To avoid confusion between run-android and run-ios, I deprecated --device-id in favour of --device. When someone will use --device-id` a warning will be presented, so that users can migrate their scripts.

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. Run this command:
node /path/to/react-native-cli/packages/cli/build/bin.js run-android --deviceId "asdf"

Should give the warning and pass id the same way as before.
3. Run this command:

node /path/to/react-native-cli/packages/cli/build/bin.js run-android --device "asdf"

Should launch an app on passed id.

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@github-actions github-actions bot added docs Documentation change infra Internal work not facing public APIs labels May 6, 2024
@szymonrybczak
Copy link
Collaborator Author

Unfortunately, to my knowledge, adb devices doesn't provide as much information about emulators/physical devices as Apple's commands do, so I had to limit the options' features compared to run-ios's.

@@ -122,6 +123,13 @@ async function getAvailableDevicePort(

// Builds the app and runs it on a connected emulator / device.
async function buildAndRun(args: Flags, androidProject: AndroidProject) {
if (args.deviceId) {
logger.warn(
'The `deviceId` parameter is deprecated. Please use `device` instead.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'The `deviceId` parameter is deprecated. Please use `device` instead.',
'The `deviceId` parameter is renamed to `device`. Please use the new `device` argument next time to avoid this warning.',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation change infra Internal work not facing public APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants