Skip to content

Conversation

@MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Jan 28, 2025

If you want to pass string "extras" into an Android intent via am start, call x run ... -- -e extraKey "extra string" (and similar for other types like --ez key bool for booleans, or -d URI for data URIs). All arguments listed by am help under the start command (including the INTENT specification) are supported.

On the host, this passes the arguments as-is to the running executable, similar to cargo run .. -- <launch_args>.

For iOS, these are passed to idevicedebug run.

@MarijnS95 MarijnS95 requested a review from maxded January 29, 2025 16:11
@MarijnS95 MarijnS95 changed the title HACK: Pass arbitrary arguments to adb shell am start ... via -- suffix Pass arbitrary arguments to adb shell am start ... via -- suffix Jan 29, 2025
@MarijnS95 MarijnS95 marked this pull request as ready for review January 29, 2025 16:11
@MarijnS95 MarijnS95 marked this pull request as draft January 29, 2025 16:11
@MarijnS95 MarijnS95 marked this pull request as ready for review January 29, 2025 16:11
Copy link
Member

@Jasper-Bekkers Jasper-Bekkers left a comment

Choose a reason for hiding this comment

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

Approving, but could you document in the PR description (and the x help`) exactly how to use this feature?

@MarijnS95 MarijnS95 changed the title Pass arbitrary arguments to adb shell am start ... via -- suffix Pass arbitrary arguments in x run via -- suffix Jan 30, 2025
@MarijnS95 MarijnS95 changed the title Pass arbitrary arguments in x run via -- suffix Pass trailing x run -- arguments to launch command Jan 30, 2025
@MarijnS95
Copy link
Member Author

@Jasper-Bekkers this was already somewhat explained in the PR description but the --help text now elaborates where these arguments end up at runtime, per platform, and links to the platform-specific documentation.

MarijnS95 and others added 3 commits January 30, 2025 16:38
Starting today (January 30th, 2025), v3 is no longer available to use
after a long deprecation period:
https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
If you want to pass string "extras" into an Android intent via `am
start`, call `x run ... -- -e extraKey "extra string"` (and similar
for other types like `--ez key bool` for booleans, or `-d URI` for data
URIs).  [All arguments listed by `am help` under the `start` command]
(including the `INTENT` specification) are supported.

On the host, this passes the arguments as-is to the running executable,
similar to `cargo run .. -- <launch_args>`.

For iOS, these are passed to [`idevicedebug run`].

[All arguments listed by `am help` under the `start` command]: https://developer.android.com/tools/adb#am
[`idevicedebug run`]: https://manpages.debian.org/testing/libimobiledevice-utils/idevicedebug.1.en.html
@MarijnS95 MarijnS95 merged commit f2afad4 into for-traverse Jan 30, 2025
4 checks passed
@MarijnS95 MarijnS95 deleted the hack-pass-intent branch January 30, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants