Skip to content

[BUG] appId/-launchApp: appId: doesn't correctly parse default value #50

@trenslow

Description

@trenslow

Description

When setting a appId value with a default value, the appId is not properly parsed

Steps to Reproduce

  1. Create a flow with an appId that has a default fallback, e.g. appId: ${APP_ID || "com.example.app"}
  2. Run maestro-runner with either UiAutomator2 or DeviceLab drivers
  3. Observe error
  4. Compare with successful run on Maestro Studio

Expected Behavior

I can define a dynamic APP_ID with a fallback default behavior and run the tests without setting APP_ID

Actual Behavior

maestro-runner inserts as the -appId value the whole conditional, e.g. ${APP_ID || "com.example.app"}

Environment

  • OS: macOS 26.3
  • Go version: go version go1.26.2 darwin/arm64
  • maestro-runner version: 1.1.1
  • Executor: UIAutomator2
  • Device/Simulator: Pixel 7 pro emulator

Flow File

appId: ${APP_ID || "com.example.app"}
---
- launchApp:
    appId: ${APP_ID || "com.example.app"}

Error Output

    ✗ runFlow (907ms)
      ╰─ launchApp: failed to clear app state for '${APP_ID || "com.example.app"}' — is the app installed?
      ✗ launchApp (38ms)
        ╰─ adb shell pm clear ${APP_ID || "com.example.app"}: exit status 1: /system/bin/sh: ${APP_ID || "com.example.app"}: bad substitution

Additional Context

This issue occurs on both android drivers. Likely related to #49

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions