use a script on android

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TheOriginalVapester
Posts: 1
Joined: 26 May 2022, 23:09

use a script on android

Post by TheOriginalVapester » 26 May 2022, 23:13

Is it possible to use a script on Android?
Last edited by gregster on 26 May 2022, 23:46, edited 1 time in total.
Reason: Topic was split from unrelated topic.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: use a script on android

Post by BoBo » 26 May 2022, 23:24

TheOriginalVapester wrote:
26 May 2022, 23:13
Is it possible to use a script on Android?
IMHO, yes. You can script directly under Android using an app like automagic4android.com, or you can trigger AHK scripts on your PC using apps like Matric or Touch Portal (or others) OR communicate with them via TCP/UDP.

http://automagic4android.com/action_script_en.html
https://matricapp.com/
https://www.touch-portal.com/

gregster
Posts: 8924
Joined: 30 Sep 2013, 06:48

Re: use a script on android

Post by gregster » 26 May 2022, 23:49

I guess it depends what you mean. AHK itself only runs on Windows.
But you can, for example, send keys and clicks to android emulators (eg BlueStacks) running on a Windows computer.

william_ahk
Posts: 482
Joined: 03 Dec 2018, 20:02

Re: use a script on android

Post by william_ahk » 14 Jan 2024, 23:15

The closest alternative to AutoHotkey on Android is definitely Auto.js. You can write Javascript to automate the UI, and even creating UIs. Best part is that it doesn't require root permission. I've used it quite intensively and it is an absolute gem. They don't even have a documentation in English so I guess that's why it's so unpopular. Also the original author no longer maintains the open source version, but there are forks like AutoX.js.

Here's a translation of the introduction:
The sections of this document are roughly divided into modules, which can be broadly categorized as "Automated Operations" modules (control operations, touch simulation, key simulation, etc.) and other modules (device, application, interface, etc.).

The "Automated Operations" section can be further divided into two main types: control-based operations and coordinate-based operations.

Coordinate-based operations involve specifying specific screen coordinates for actions such as clicking, for example, click(100, 200). This method is more feasible in game scripts and can achieve good compatibility when combined with features like image recognition, color detection, and coordinate scaling. However, this approach is not very efficient for general software scripts and requires Android 7.0 or higher or root permissions to execute.

For software scripts (e.g., batch adding contacts, automatically extracting SMS verification codes, etc.), we recommend using control-based simulated operations, combined with notifications, key events, etc., to achieve better workflow.

The other modules mainly include:
app: Application. Launching applications, uninstalling applications, using applications to view and edit files, access web pages, send inter-app broadcasts, etc.
console: Console. Recording runtime logs, errors, information, etc.
device: Device. Obtaining device screen dimensions, system version information, controlling device volume, brightness, etc.
engines: Script engines. Used to launch other scripts.
events: Events and listeners. Key listeners, notification listeners, touch listeners, etc.
floaty: Floaty. Used to display custom floating windows.
files: File system. File creation, information retrieval, read/write operations.
http: HTTP. Sending HTTP requests, such as GET, POST, etc.
websocket: Websocket client and server. Allows for active message pushing.
images, colors: Image and color processing. Screenshotting, image cropping, image recognition, reading and saving images, etc.
keys: Key simulation. For example, simulating volume keys, Home key, etc.
shell: Shell commands.
threads: Multithreading support.
ui: UI interface. Used to display custom UI interfaces and interact with users.

Post Reply

Return to “Ask for Help (v1)”