Skip to content
Back to the docs

Build without code: the block editor

Build a script by snapping blocks together (loop, image to tap, wait, message) and watch AppsMobs write the Python for you.

Last reviewed 2 November 2026

By the end of this page you will have built a block script that taps a button several times, seen the Python it generates, and run it on your phone. ⏱ 10 minutes.

Before you start

  • You followed Your first script in 10 minutes (run a script, read the Output, capture an image).
  • A device is plugged in and Free: Connect a phone or an emulator.
  • You have a button image as a .png, for example button.png, in Documents\AppsMobs\Scripts (see the "Crop the button" step of the previous page).
Assemble a script with blocks0:50

How it works

Each block is one action: tap, wait, look for an image, write a message. You stack them in a workspace, in the order you want them to run. AppsMobs turns the stack into a Python script that you can read, copy or edit afterwards.

  1. 1

    Switch to Blocks mode

    Open the Playground (sidebar, under Build), then create a script with More actions (the ⋯ button), New script (Ctrl + N).

    At the top of the editor, click Blocks (next to Code). The title Blocks Mode · No-Code shows up and the Code Blocks library opens on the left.

    In the middle you read No blocks yet. That is normal: the workspace is empty.

  2. 2

    Add a loop

    In the library, open the Loops category and click For loop.

    A window Configurer: For loop opens (the field labels of this window are in French). Leave Nombre de répétitions (number of repetitions) at 5 and click Save.

    The block For loop (5 fois) appears in the workspace. Under it, a zone says Glissez des blocs ici pour les ajouter à l'intérieur ("drag blocks here to add them inside").

    Find a block quickly

    Type a word in Search for a block (e.g., click, image, swipe) at the top of the library. The book button on the right shows a block's documentation.

  3. 3

    Drag blocks into the loop

    What is inside the loop repeats. Drag, one by one, these blocks from the library to the zone under the loop, in this order:

    1. ⭐ Find & Click (category Image Detection): waits for the image, then taps it.
    2. Log (category Utilities): writes a message in the Output.
    3. Wait (category Utilities): pauses.

    If you click a block instead of dragging it, it is added at the end of the workspace, not in the loop. In that case, drag it to move it.

  4. 4

    Set each block's fields

    Each block has its own fields, shown under its title (the 🔼 / 🔽 button hides or shows them). Fill in:

    • ⭐ Find & Click: Image = button.png, Confidence = 0.85.
    • Log: Message = Button handled.
    • Wait: Secondes (seconds) = 1.

    0.85 is the confidence: the higher it is, the more the image must look like the screen. If the button is not recognised, lower it to 0.7.

    On each block, ⧉ duplicates it and ✕ deletes it.

  5. 5

    Look at the generated script

    The Generated script panel shows the matching Python. It looks like this:

    for i in range(5):
        tap_image("button.png", 0.85)
        log("Button handled")
        wait(1)
    

    (AppsMobs also adds # block-… comment lines. They help it find which block caused a problem: do not delete them.)

    The panel's buttons: Refresh regenerates the code, Copy copies it, Send to editor puts it in Code mode so you can edit it by hand. Three layout buttons in the bar above (tooltips: Blocks + Script, Blocks only, Script only) choose what you see: blocks and script, blocks alone, or script alone.

  6. 6

    Choose the device and run

    Click Run on and tick your device, then click Run (F5).

    What happens: the Output panel shows Launching on, then five times Button handled, and the status ends with Finished in followed by the duration.

    If the script is refused, it is the safety check: see below.

  7. 7

    Save

    Press Ctrl + S. The script is saved as .py in Documents\AppsMobs\Scripts, and your block layout is kept next to it: you can reopen the script in Blocks mode. The image must stay in the same folder as the script, or in Scripts\img.

The most useful blocks and the Python they write

BlockGenerated Python
Single Clicktap(540, 960)
Double Clickdouble_tap(540, 960)
Long Presslong_press(540, 960, 1000)
Swipe Upswipe_up()
Custom Swipeswipe(x1, y1, x2, y2, duration_ms)
Backpress_back()
Homepress_home()

The full list, with the 12 categories of the library (Basic Actions, Text & Input, Navigation, Image Detection, Smart Detection (YOLO), Loops, Utilities, Apps Management, System & Device, Network, Volume & Media, Communication), is in the library itself. The matching Python functions are in the function reference.

Making an "if" with a condition

To act only when something is on screen, use If condition or If/Else condition. The configuration window offers a no-code condition builder:

  1. Pick the type: Image, Text, Variable or Custom.
  2. Pick the operator: Exists, Does not exist, Equals, Not equals, Greater than, Less than.
  3. Enter the value, for example popup.png. The Generated code line shows the result.

Then drag into the "if" the blocks to run. With If/Else condition, one part runs if the condition is true, the other otherwise.

What Blocks mode forbids

In Blocks mode, before each run, AppsMobs checks that the script only uses AppsMobs functions (and a few safe Python tools like time, random, math, json). Otherwise you get the Execution blocked window: For your security, this script cannot be executed., with the reason Unauthorized functions detected (whitelist mode).

This is intended: Blocks mode is the safest, it only lets device actions through.

Limits to know

  • The Smart Detection (YOLO) blocks are being reworked: do not rely on them for now.
  • A loop or a condition cannot be dropped inside another loop or condition. The message is Vous ne pouvez pas imbriquer des boucles/conditions directement. (French, whatever the app language). To nest, use Send to editor and write the Python.
  • The Configurer windows and the small drop-zone texts stay in French whatever the app language.
  • Some advanced blocks (for example Compare images or Search shape) rely on old function names: they work, but they are not in the official reference.

Not working?

What you seeLikely causeWhat to do
No device connected: plug a phone in (USB debugging on) or start an emulator, then press Run again.No device chosen or detected.Choose it in Run on; otherwise Connect a phone or an emulator.
Execution blocked, reason Unauthorized functions detected (whitelist mode)A block, or code sent to the editor, calls a function outside the list.Replace it with an equivalent block, or work in Code mode (Writing a Python script).
image introuvable : button.png (cherchée dans le dossier du script et dans Scripts/img)The image is not next to the script nor in Scripts\img.Save the script, copy the .png to the right place, fix the Image field.
The script ends without tapping the buttonThe image is not recognised.Lower Confidence (0.7), redo a tighter capture.
The block runs too fast or too oftenNo pause.Add Wait or Random delay inside the loop.
Nothing happens when you click a blockYou are in Code mode.Click Blocks at the top. In Code mode, clicking a block inserts code.
Blocks are gone after reopeningThe script was saved without its blocks.Save with Ctrl + S from Blocks mode.

What next

Stuck on a step? Ask on Discord, someone has probably hit it before.Ask on Discord