Skip to content

feat: add iOS launchAppWithArguments#204

Open
Dor-bl wants to merge 2 commits intomainfrom
feat/ios-launchapp-args-tests
Open

feat: add iOS launchAppWithArguments#204
Dor-bl wants to merge 2 commits intomainfrom
feat/ios-launchapp-args-tests

Conversation

@Dor-bl
Copy link
Copy Markdown
Owner

@Dor-bl Dor-bl commented Mar 27, 2026

Summary

  • add iOS helper and driver method for mobile:launchApp with arguments/env
  • add integration test covering LaunchAppWithArguments
  • adjust test to use installed UICatalog bundle id

Testing

  • dotnet test test/integration/Appium.Net.Integration.Tests.csproj -f net8.0 --nologo --filter FullyQualifiedName~CanLaunchAppWithArguments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 27, 2026 10:26
@github-actions github-actions bot added the enhancement New feature or request label Mar 27, 2026
Copy link
Copy Markdown

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

Adds an iOS-specific driver/helper API for executing mobile: launchApp with process arguments and environment variables, and introduces an integration test to validate launching UICatalog via the new method.

Changes:

  • Added IOSDriver.LaunchAppWithArguments convenience method.
  • Implemented IOSCommandExecutionHelper.LaunchAppWithArguments to execute the underlying mobile: launchApp script with args/env.
  • Added an iOS integration test CanLaunchAppWithArguments using the installed UICatalog bundle id.

Reviewed changes

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

File Description
test/integration/IOS/Device/AppTests.cs Adds an integration test that terminates and relaunches UICatalog with arguments/env and verifies foreground state + an element lookup.
src/Appium.Net/Appium/iOS/IOSDriver.cs Exposes a new public driver method delegating to the iOS command execution helper.
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs Adds the execute-script implementation for mobile: launchApp with optional arguments and environment variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


executeMethod.Execute(DriverCommand.ExecuteScript, new Dictionary<string, object>
{
["script"] = "mobile:launchApp",
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The script name uses "mobile:launchApp" (no space) while the XML docs and other app-management helpers in this codebase use the spaced form (e.g., "mobile: installApp"). Aligning the script string with the documented command name ("mobile: launchApp") would avoid confusion and reduce the risk of incompatibility with servers that expect the canonical format.

Suggested change
["script"] = "mobile:launchApp",
["script"] = "mobile: launchApp",

Copilot uses AI. Check for mistakes.
public static void LaunchAppWithArguments(
IExecuteMethod executeMethod,
string bundleId,
IReadOnlyCollection<string> processArguments = null,
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

Command-line arguments are inherently ordered. Using IReadOnlyCollection for processArguments allows unordered implementations (e.g., HashSet), which could scramble argument order when serialized. Consider changing this to IReadOnlyList (or IEnumerable but documented as ordered) to better represent the required semantics.

Suggested change
IReadOnlyCollection<string> processArguments = null,
IReadOnlyList<string> processArguments = null,

Copilot uses AI. Check for mistakes.
/// <param name="environmentVariables">Optional environment variables for the app.</param>
public void LaunchAppWithArguments(
string bundleId,
IReadOnlyCollection<string> processArguments = null,
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

Command-line arguments are inherently ordered. Using IReadOnlyCollection for processArguments allows unordered implementations (e.g., HashSet), which could scramble argument order when serialized. Consider changing this to IReadOnlyList (or another ordered type) to reflect the expected semantics.

Suggested change
IReadOnlyCollection<string> processArguments = null,
IReadOnlyList<string> processArguments = null,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants