Android automation

How to click an image in an Android emulator macro

Configure EmuloAgent to find a reference image and click its current position, with a focused detection region, one-or-all match modes, click styles, and a practical test plan.

By Sertta 7 min read
click image in Android emulator image-based click macro Android emulator auto click visual macro action EmuloAgent

A fixed-coordinate tap assumes that the target will return to the same point. A button inside a changing list, a card that follows dynamic content, or an icon that moves after a message appears can break that assumption even though the target still looks the same.

EmuloAgent has a Click on image action for this situation. You capture the visual target, define where the macro should search for it, and let the action tap the position found in the current emulator frame. You can click one result or every matching occurrence and choose a simple, double, hold, or repeated click.

Use automation only where the app, game, or service allows it. Finding a target by image makes positioning more adaptable; it does not override third-party rules.

Choose Click on image when the target moves

Use Tap when the point itself is stable and meaningful. Use Click on image when the target’s appearance is stable but its position can change.

Typical examples include:

  • a button that moves vertically when optional content appears;
  • the same icon repeated in a fixed grid or list;
  • a control that can occupy different slots between runs;
  • a visual target without a reliable text label;
  • a button whose current location matters more than its saved coordinates.

This action is different from an image condition. A condition answers whether a reference is present and decides whether an associated action may run. Click on image both searches for the reference and taps the location it finds. If you need to make a separate action depend on image presence, use an image condition instead.

Prepare a clean reference frame

Before opening the macro builder, connect the intended emulator profile and place the emulator on a representative screen. Keep the profile at the resolution in which the macro will run.

Choose a target with enough distinctive detail to separate it from nearby controls. A compact icon or button is usually better than an entire row containing changing text, counters, timestamps, or animation. Avoid capturing shadows and background areas that may vary while the target itself stays stable.

If the target is animated, pause on a repeatable frame or choose a stable part of it. The macro compares the saved reference with the current screen; a reference dominated by changing pixels is harder to match consistently.

How to add a Click on image action

Open the automation and follow these steps:

  1. Select Add Action.
  2. In the Gesture section, choose Click on image.
  3. Draw a tight rectangle around the target in the emulator capture.
  4. Set the Threshold high enough to reject similar elements while still accepting normal rendering differences.
  5. Confirm the reference image.
  6. Review the new action card and save the macro.

The action starts with a detection region around the captured target. During execution, EmuloAgent searches that region for the saved reference and taps the center of a match instead of replaying the original capture coordinates.

Run a short test with the target in its captured position first. Then reproduce the expected layout change and confirm that the action follows the target inside the detection region.

Separate the reference image from the detection region

The two rectangles solve different problems:

  • the reference image describes what EmuloAgent should find;
  • the detection region limits where it is allowed to search.

Open the action menu and use Edit image to trim the saved reference or Edit Detection Region to change the search area. You can also select a new image when the target’s appearance has genuinely changed.

Keep the search region large enough to include every valid position, but no larger. A region restricted to the relevant panel avoids unrelated copies of the same icon and reduces the amount of screen that needs to be compared. Searching the whole screen is useful only when the target can truly appear anywhere and no similar element exists elsewhere.

For a deeper treatment of reference crops and thresholds, read how to fine-tune image, color, and text detection.

Choose one match or all matches deliberately

In Edit Action, choose what should happen when the reference appears more than once:

  • Click only the first uses one best matching result;
  • Click each one (one by one) finds every result above the threshold and clicks them sequentially.

The all-matches mode uses the matches found in the same macro iteration. Use it when the layout stays in place while the clicks are performed, such as a fixed grid of identical checkboxes. Avoid it when each click immediately reorders, removes, or shifts the remaining targets. In that case, click one result, wait for the new screen state, and let a later iteration search again.

Do not confuse this choice with the Image counter condition. The counter compares a quantity and gates another action; all-matches mode performs a click on each occurrence it found.

Configure the click style and timing

The same Edit Action window provides four styles:

  • Simple sends one tap to each selected match;
  • Double sends two taps;
  • Hold presses the match for the configured duration;
  • Repeat distributes a chosen number of taps across a time window.

It also provides delays before and after the action. Use a pre-delay when the interface needs a short settling period before the search and a post-delay when the screen needs time to react before the flow continues.

Remember that the style applies to every result in all-matches mode. If three targets are found with the Double style, the action sends two taps to each target. Start with Simple, verify the target selection, and only then add a more forceful interaction when the interface actually requires it.

Practical example: select identical items in a fixed grid

Suppose a test screen contains several identical unchecked boxes in a grid. Their number changes, but the grid does not reflow when a box is selected. The macro should select every visible unchecked box before continuing.

Configure the action like this:

  1. capture one unchecked-box icon without its surrounding label;
  2. expand the detection region to cover only the grid;
  3. keep the click style on Simple;
  4. choose Click each one (one by one);
  5. add a post-delay long enough for the final state to render;
  6. save and test with one, several, and no unchecked boxes visible.

When no result is found, the image click does not succeed. Design the surrounding flow for that state instead of assuming the target is always present. For example, a separate condition can release the next step only after the checked state or a completion message appears.

Troubleshoot missed or wrong clicks

If the action misses the target, check these variables one at a time:

  • confirm that the target is fully inside the detection region;
  • recapture a stable reference without changing text or animation;
  • lower the threshold gradually if normal rendering differences are rejected;
  • keep the same emulator resolution used during capture;
  • verify that an overlay or dialog is not covering part of the target.

If the action clicks the wrong element:

  • trim generic background from the reference;
  • raise the threshold gradually;
  • narrow the detection region to the correct panel;
  • switch from all matches to one match;
  • add a condition that identifies the intended screen state.

When several signals are required to identify the right context, use AND and OR condition groups on the action. This protects the image click from running on another screen that happens to reuse the same icon.

Test the action before scaling execution

Use a compact verification sequence:

  1. test the captured position;
  2. test every valid moved position inside the detection region;
  3. place a similar icon outside the region and confirm it is ignored;
  4. test one match and multiple matches if both can occur;
  5. verify that the next step waits for an observable screen change;
  6. save, reopen, and run the macro on one profile before using more profiles.

The macro stabilization checklist covers starting states, waits, stopping behavior, and resolution checks for the next stage.

Make the click follow the visual target

Click on image replaces a positional assumption with an observable target. Capture a stable reference, constrain the search region, choose one or all results according to how the screen behaves, and test both target selection and the transition after the click. The macro can then act where the element is now, not merely where it was recorded.

Get EmuloAgent from the Microsoft Store and create image-guided macros for Android emulators.