Skip to content

feat: Added support to set portrange for systemPort,mjpegServer,wdaLocalPort#1885

Merged
saikrishna321 merged 4 commits intomainfrom
1873
Oct 13, 2025
Merged

feat: Added support to set portrange for systemPort,mjpegServer,wdaLocalPort#1885
saikrishna321 merged 4 commits intomainfrom
1873

Conversation

@saikrishna321
Copy link
Member

This pull request introduces support for specifying port ranges for system ports, WDA local ports, and MJPEG server ports in both Android and iOS device management. This allows users to control which ports are allocated for device communication, improving flexibility and avoiding port conflicts. The changes update the capability and device manager logic to use these ranges, extend plugin arguments, and add tests to ensure correct behavior.

Port Range Support for Device Management

  • Added new plugin arguments (systemPortRange, wdaLocalPortRange, mjpegServerPortRange) to IPluginArgs and updated the schema in package.json to allow users to specify port ranges for device communication. [1] [2]
  • Updated Android and iOS device managers (AndroidDeviceManager.ts, IOSDeviceManager.ts) and their respective capability management functions to use the specified port ranges when allocating ports, falling back to defaults if not provided. [1] [2] [3] [4] [5] [6] [7] [8]

Helpers and Utility Updates

  • Refactored the getFreePort helper to accept an optional port range, using getPort.makeRange when a range is provided.

Testing Enhancements

  • Updated and added unit tests for Android and iOS device managers to verify that the correct port ranges are passed and used, and added a new test for the helper to check port range handling. [1] [2] [3] [4] [5] [6]

Code Style Improvements

  • Made minor formatting and consistency improvements in test files for better readability and maintainability. [1] [2] [3] [4] [5] [6]

#1873

Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces support for specifying port ranges for system ports, WDA local ports, and MJPEG server ports in both Android and iOS device management to improve flexibility and avoid port conflicts.

  • Added new plugin arguments (systemPortRange, wdaLocalPortRange, mjpegServerPortRange) to allow users to specify custom port ranges
  • Updated device managers and capability management to use specified port ranges with fallback to defaults
  • Enhanced the getFreePort helper to accept optional port ranges using getPort.makeRange

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/interfaces/IPluginArgs.ts Added new port range arguments to the plugin interface
src/helpers.ts Enhanced getFreePort function to support optional port ranges
src/device-utils.ts Updated device allocation to pass port ranges to capability management
src/device-managers/AndroidDeviceManager.ts Modified to use systemPortRange when allocating system ports
src/device-managers/IOSDeviceManager.ts Updated to use wdaLocalPortRange and mjpegServerPortRange for iOS devices
src/CapabilityManager.ts Enhanced capability functions to use port ranges with getPort.makeRange
package.json Added schema definitions for the new port range arguments
test/unit/helpers.spec.ts Added unit tests for the enhanced getFreePort function
test/unit/AndroidDeviceManager.spec.ts Updated tests to verify systemPortRange usage
test/unit/IOSDeviceManager.spec.ts Updated tests to verify port range usage and improved formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
@saikrishna321 saikrishna321 requested a review from Copilot October 12, 2025 03:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
@saikrishna321 saikrishna321 requested a review from Copilot October 12, 2025 12:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@saikrishna321 saikrishna321 requested a review from Copilot October 12, 2025 13:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
@saikrishna321 saikrishna321 merged commit 67c3add into main Oct 13, 2025
5 checks passed
saikrishna321 pushed a commit that referenced this pull request Oct 13, 2025
## [11.1.0](v11.0.8...v11.1.0) (2025-10-13)

### Features

* Added support to set portrange for systemPort,mjpegServer,wdaLocalPort ([#1885](#1885)) ([67c3add](67c3add))
@github-actions
Copy link

🎉 This PR is included in version 11.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@saikrishna321 saikrishna321 deleted the 1873 branch December 12, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants