> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan.md).

# ACTION 使用指南

- [📦一些 Default Values](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/some-default-variables.md): Automate 中使用的一些默认变量
- [🧱各种 Block](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks.md)
- [Normal block](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks/normal-block.md): 顺序指令块 (Normal block)
- [For](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks/for.md): For 是一个用于将一组操作按照预先设定的次数重复执行的代码块。该循环使用一个默认名为 $loopIndex 的计数变量来跟踪循环的进度。
- [While](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks/while.md): While 是一个用于连续重复执行一组操作的语句块，直到满足某个条件（Condition）时才会停止。
- [If、Else if 和 Else](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks/if-else-if-and-else.md)
- [条件编写指南](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/blocks/writing-conditions.md): 当使用像 If、Else if 或 While 这样的导航区块时，你需要设置 一个条件表达式，让系统在运行时进行检查。此表达式将返回 真（true）或假（false）的结果。
- [📊Variables](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables.md)
- [Set variable](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables/set-variable.md)
- [Increase variable](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables/increase-variable.md): Increase variable 用于将一个数值（在 Increase by 中指定）加到一个变量中。
- [Decrease variable](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables/decrease-variable.md): Decrease variable 用于从一个变量中减去一个数值（该数值在 Decrease by 中设定）。
- [Count](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/variables/count.md)
- [⚙️Workflow](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow.md)
- [Exit loop](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow/exit-loop.md)
- [Next loop](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow/next-loop.md)
- [Stop](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow/stop.md)
- [Throw](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow/throw-is-already-an-english-word.md)
- [Delay](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/workflow/delay.md): 在一段时间内停止等待。
- [🔤Text & number](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number.md)
- [Random text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/random-text.md)
- [Split text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/split-text.md)
- [Read json](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/read-json.md)
- [Regex](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/regex.md)
- [Random number](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/random-number.md)
- [Math execute](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/math-execute.md)
- [2FA code](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/text-and-number/2fa-code.md)
- [📁File & Folder](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder.md)
- [File exists](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-exists.md)
- [Copy file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/copy-file.md)
- [Move/rename file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/move-rename-file.md)
- [Delete file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/delete-file.md): 根据文件路径删除文件。
- [File read all text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-read-all-text.md)
- [File read all lines](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-read-all-lines.md)
- [File read random line](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-read-random-line.md)
- [File write all text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-write-all-text.md)
- [File append line](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/file-append-line.md)
- [Create empty excel](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/create-empty-excel.md)
- [Read excel file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/read-excel-file.md)
- [Write excel file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/write-excel-file.md)
- [Append excel file](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/append-excel-file.md): 在不覆盖现有内容的情况下，向现有的 Excel 文件末尾追加新数据。
- [Folder exists](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/folder-exists.md)
- [Create folder](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/create-folder.md)
- [Move / rename folder](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/move-rename-folder.md)
- [Delete folder](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/delete-folder.md)
- [Folder get file list](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/file-and-folder/folder-get-file-list.md)
- [📋Clipboard](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/clipboard.md)
- [Get clipboard text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/clipboard/get-clipboard-text.md): 获取剪贴板中现有的文本内容。
- [Set clipboard text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/clipboard/set-clipboard-text.md)
- [🌐HTTP](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/http.md)
- [HTTP Request](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/http/http-request.md)
- [HTTP Download](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/http/http-download.md): 通过 HTTP 协议将文件下载到计算机上。
- [🖼️Image Search](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search.md)
- [Wait to image](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/wait-to-image.md)
- [Image exists](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/image-exists.md)
- [Image search](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/image-search.md)
- [Image 组合使用示例](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/combined-example-for-image.md)
- [Image to Base64](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/image-to-base64.md)
- [🤖AI](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/ai.md)
- [ChatGPT](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/ai/chatgpt.md)
- [DeepSeek](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/ai/deepseek.md)
- [📧Mail](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mail.md)
- [Read mail code](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mail/read-mail-code.md)
- [Read outlook (Oauth2)](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mail/read-outlook-oauth2.md)
- [🧭Navigation](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation.md)
- [New tab](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/new-tab.md)
- [Active tab](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/active-tab.md)
- [Close tab](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/close-tab.md)
- [Close all tab](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/close-all-tabs.md)
- [Go to URL](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/go-to-url.md)
- [Back URL](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/back-url.md)
- [Reload](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/reload.md)
- [Get URL](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/get-url.md)
- [Wait URL Changed](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/wait-url-changed.md)
- [🎯Element](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/element.md)
- [Wait element](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/element/wait-element.md)
- [Get element attribute](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/element/get-element-attribute.md)
- [Get element text](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/element/get-element-text.md)
- [Count element](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/element/count-element.md)
- [🖱️Mouse](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse.md)
- [Mouse click](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-click.md): 点击鼠标到某个 element 上。
- [Mouse try to click](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-try-to-click.md)
- [Mouse move](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-move.md)
- [Mouse press and hold](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-press-and-hold.md)
- [Mouse release](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-release.md)
- [Mouse scroll](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/mouse/mouse-scroll.md)
- [⌨️Keyboard](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard.md)
- [Key press](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard/key-press.md): 在网页上输入一段内容。
- [File upload](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard/file-upload.md)
- [Select dropdown](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard/select-dropdown.md)
- [📜Scroll](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/scroll.md)
- [Random scroll](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/scroll/random-scroll.md)
- [Scroll to top](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/scroll/scroll-to-top.md)
- [Scroll to bottom](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/scroll/scroll-to-bottom.md)
- [Scroll to element](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/scroll/scroll-to-element.md)
- [🔀Switch](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/switch.md)
- [Switch to default](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/switch/switch-to-default.md)
- [Switch to frame](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/switch/switch-to-frame.md)
- [Switch to popup](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/switch/switch-to-popup.md)
- [🍪Cookie](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/cookie.md)
- [Import cookie](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/cookie/import-cookie.md)
- [Export cookie](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/cookie/export-cookie.md)
- [⚠️Alert](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/alert.md)
- [Accept alert](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/alert/accept-alert.md)
- [Cancel alert](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/alert/cancel-alert.md)
- [📑Tab & Popup](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/tab-and-popup.md)
- [Wait popup](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/tab-and-popup/wait-popup.md)
- [Has popup](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/tab-and-popup/has-popup.md)
- [💻Javascript](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/javascript.md)
- [Execute JS code](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/javascript/execute-js-code.md)
- [Get extension id](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/javascript/get-extension-id.md)
- [Screenshot](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/javascript/screenshot.md)
- [🔗References](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/references.md)
- [Call workflow](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/references/call-workflow.md)
- [📊Google service](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/google-service.md): 读取和写入 Google Sheets 上的内容
- [Read google sheet](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/google-service/read-google-sheet.md)
- [Write google sheet](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/google-service/write-google-sheet.md): 将数据写入 google sheet
- [📱电话 - 应用](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app.md)
- [安装应用](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/install-app.md): 从计算机将应用程序文件 (.apk) 安装到手机设备上。
- [检查应用是否已安装](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/app-installed.md): 检查设备上是否已安装应用程序。
- [卸载应用](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/uninstall-app.md): 从设备中根据包名卸载应用程序。
- [启动应用](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/start-application.md): 打开（启动）设备上已安装的应用程序。
- [停止应用](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/stop-application.md): 强制停止正在设备上运行的应用程序。
- [清理应用数据](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-app/clean-application-data.md): 删除应用程序的所有数据，将应用恢复到初始安装状态。
- [📲电话 - 设备](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone.md)
- [锁定设备](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone/lock-device.md): 锁定设备屏幕。
- [解锁设备](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone/unlock-device.md): 唤醒并解锁设备屏幕。
- [切换服务](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone/toggle-service.md): 开关设备上的系统服务（飞行模式、Wi-Fi、移动数据、位置）。
- [检查网络](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone/check-network.md): 通过 ping Google 检查设备的网络连接。
- [重新连接](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone/reconnect.md): 重新连接 ADB — 重置手机与电脑之间的 ADB 连接。
- [🧭电话 - 导航](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-navigation.md)
- [按下返回](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-navigation/press-back.md): 按下设备上的返回按钮。
- [按下主页](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-navigation/home-button.md): 按下主页按钮返回主屏幕。
- [按下菜单](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-navigation/menu.md): 按下设备的菜单键。
- [📁电话 - 文件](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-file.md)
- [推送文件](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-file/push-file.md): 将一个文件从计算机推送到手机设备。
- [拉取文件](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-file/pull-file.md): 从手机设备将文件拉取到计算机。
- [📋电话 - 剪贴板](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-clipboard.md)
- [复制剪贴板](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-clipboard/copy-clipboard.md): 读取设备剪贴板的内容并保存到变量中。
- [设置剪贴板](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-clipboard/set-clipboard.md): 将一段文本放入设备的剪贴板中。
- [粘贴剪贴板](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-clipboard/paste-clipboard.md): 将剪贴板内容粘贴到屏幕上的元素中，按照XPath进行操作。
- [👆电话 - 动作](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action.md)
- [确定 XPath 和坐标的指南](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/xpath-and-coordinates-guide.md): 使用 GPM UI Automator 工具获取手机屏幕上元素的 XPath 或坐标。
- [触摸](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/touch.md): 通过 XPath 或屏幕坐标触摸一个元素。
- [滚动](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/scroll.md): 根据起点和终点坐标滚动/滑动设备屏幕。
- [截图](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/screenshot.md): 捕捉设备屏幕并保存到计算机。
- [按下按键](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/key-press.md): 发送一个按键事件到设备。
- [输入文本](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-action/text-type.md): 在指定的输入框中通过XPath输入一段文本。
- [🎯电话 - 元素](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-element.md)
- [获取元素数据](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-element/get-element-data.md): 获取屏幕上元素的属性并将其存储到变量中。
- [判断元素是否存在](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-element/has-element.md): 检查一个元素是否存在于屏幕上，并将结果返回给变量。
- [💻电话 - Shell](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-case.md)
- [执行 ADB](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-case/execute-adb.md): 运行一个针对设备的 ADB 命令并将结果保存到变量中。
- [执行 CMD](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/phone-case/execute-command.md): 在设备内执行 shell 命令（通过 adb shell）并将结果保存到变量中。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
