Skip to content

feat: add env_str to snippet_client_v2.Config to allow am instrument command prefix (fixes #1004)#1008

Open
devimano2011 wants to merge 1 commit intogoogle:masterfrom
devimano2011:feat/add-env-str-snippet-client-v2-1004
Open

feat: add env_str to snippet_client_v2.Config to allow am instrument command prefix (fixes #1004)#1008
devimano2011 wants to merge 1 commit intogoogle:masterfrom
devimano2011:feat/add-env-str-snippet-client-v2-1004

Conversation

@devimano2011
Copy link
Copy Markdown
Contributor

Fixes #1004

Problem

Users who need to prepend environment variables or command wrappers (e.g. ENV_VAR=value or a wrapper command) to the am instrument command in snippet_client_v2 had no way to do so.

Solution

Add an env_str field to snippet_client_v2.Config that, when set, is prepended to the am instrument command. This allows users to:

  • Set environment variables: config.env_str = 'MY_VAR=value'
    • Use command wrappers: config.env_str = 'wrapper_cmd'

Changes

  • Added env_str: str = '' field to the Config dataclass with documentation
    • Updated _LAUNCH_CMD template to support {env_str} prefix
    • Pass env_str value when building the launch command in _start_server()

Usage

config = snippet_client_v2.Config(env_str='MY_VAR=hello')
ad.load_snippet('maps', 'com.example.maps', config=config)

fixes google#1004)

Add optional environment variable string to launch command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants