Skip to content

Run a command when an apk is updated #59

Closed

Description

@alvaromb

I'm having problems to make watchman work. What I want to do is that everytime I drop an updated version of an *.apk file into a folder, I want to send that apk to my device.

Here's watchman trigger-list output:

{
    "version": "2.9.8",
    "triggers": [
        {
            "name": "sendtodevice",
            "expression": [
                "pcre",
                "/Users/myuser/apk-builds/My.android.apk"
            ],
            "command": [
                "adb",
                "install",
                "-r",
                "/Users/myuser/apk-builds/My.android.apk"
            ]
        }
    ]
}

But every time I overwrite My.android.apk, nothing happens and the log doesn't even update.

Activity

  1. wez commented on Oct 9, 2014

    @wez
    Contributor

    File names in watchman queries, expressions and results are always relative to the watched root.
    In addition, triggers are executed with the cwd set to the watched root.

    I think you can simplify the trigger expression to:

    "expression": [ "name", "My.android.apk", "wholename" ],
    "command": ["adb", "install", "-r"],
    "append_files": true
    
  2. wez commented on Oct 14, 2014

    @wez
    Contributor

    I'm going to close this out because it doesn't sound like a watchman issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions