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 examplebutton.png, inDocuments\AppsMobs\Scripts(see the "Crop the button" step of the previous page).
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
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
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
5and 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
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:
- ⭐ Find & Click (category Image Detection): waits for the image, then taps it.
- Log (category Utilities): writes a message in the Output.
- 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
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.85is the confidence: the higher it is, the more the image must look like the screen. If the button is not recognised, lower it to0.7.On each block, ⧉ duplicates it and ✕ deletes it.
- ⭐ Find & Click: Image =
- 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
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
Save
Press Ctrl + S. The script is saved as
.pyinDocuments\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 inScripts\img.
The most useful blocks and the Python they write
| Block | Generated Python |
|---|---|
| Single Click | tap(540, 960) |
| Double Click | double_tap(540, 960) |
| Long Press | long_press(540, 960, 1000) |
| Swipe Up | swipe_up() |
| Custom Swipe | swipe(x1, y1, x2, y2, duration_ms) |
| Back | press_back() |
| Home | press_home() |
| Block | Generated Python |
|---|---|
| Type text | type_text('Votre texte ici') |
| Click text | tap_text('Submit') |
| Wait for text | wait_text('Texte', timeout=30) |
| ⭐ Find & Click | tap_image("button.png", 0.85) |
| Find image | find_image("image.png", 0.8) |
| Image visible? | if image_visible("image.png", 0.8): then log(...) |
| Wait until visible | if wait_image("done.png", 0.9, timeout=10): then log(...) |
| Block | Generated Python |
|---|---|
| For loop | for i in range(5): |
| While loop | while condition: |
| If condition | if condition: |
| If/Else condition | if condition: … else: |
| Try/Except | try: … except Exception as e: |
| Block | Generated Python |
|---|---|
| Wait | wait(1.0) |
| Random delay | random_wait(0.5, 2.0) |
| Log | log("Message de log") |
| Screenshot | screenshot("screenshots/capture.png") |
| Restart app | restart_app("com.example.app") |
| WiFi (ON/OFF) | set_wifi(True) |
screenshots folder next to your script. Up to and including version 1.2.6, it went to an internal app folder: on those versions, switch to the Script view and write screenshot(f"{SCRIPT_DIR}/screenshots/capture.png").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:
- Pick the type: Image, Text, Variable or Custom.
- Pick the operator: Exists, Does not exist, Equals, Not equals, Greater than, Less than.
- 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 see | Likely cause | What 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 button | The image is not recognised. | Lower Confidence (0.7), redo a tighter capture. |
| The block runs too fast or too often | No pause. | Add Wait or Random delay inside the loop. |
| Nothing happens when you click a block | You are in Code mode. | Click Blocks at the top. In Code mode, clicking a block inserts code. |
| Blocks are gone after reopening | The script was saved without its blocks. | Save with Ctrl + S from Blocks mode. |
What next
- Writing a Python script: edit the generated code, add conditions.
- Function reference: every possible action.
- Write scripts with Claude or Grok: describe what you want, read, adjust.