iOStext inputinputTextimeApiShortcuts

Three Levels of Text Input for iOS Scripts: Agent, Input Method, and Shortcuts

Three ways for an iOS script to enter text: inputText on an agent IPA, the imeApi input method in the EC offline main program, and the Shortcuts helper paste method, with a comparison of when each fits and the setup flow, including the no-signing case.

7 min read

Why entering text is hard, and an overview of the three levels

Taps, swipes, and screenshots already have mature methods. Typing into a text field is much harder on iOS: the system does not allow a third-party app to write text freely. Android can enter text directly through an accessibility service or an IME. iOS has no equivalent open interface. The EasyClick iOS USB edition lines up three levels of input by what you already have:

Level Setup What you need Function / module Experience
First Agent input Agent IPA inputText Most direct and efficient
Second Custom input method EC offline main program imeApi module Close to a native input method
Third Shortcuts helper Computer-side helper program + Shortcuts Clipboard paste Fussy to configure, and reusable

The three levels are ordered by what is available. If an earlier condition is met, use the earlier setup. If it is not, drop down. The three setups can exist at the same time: in one central control, devices with an agent use inputText, and devices without an agent use imeApi or the Shortcuts helper.

EasyClick mirroring screen showing text-input interaction on an iOS device

How to set up the three levels

The first level is inputText in agent mode. When you have an agent IPA and can start automation, one line enters text:

inputText('text to enter');

It needs no extra setup. It can write into any editable text field, and it can be used with agent-mode capabilities such as nodes and the photo library. The condition is that the agent IPA is installed and the automation service is started, which depends on signing. With no signing and no agent IPA, this level is unavailable and you drop to the next two. If you sign it yourself with an Apple individual developer account, the annual fee is 688 yuan, it can sign 100 devices, and the system requirement is iOS 12 or above. That fee is Apple’s signing fee, not the EasyClick software price. Give the text field focus first, then call inputText. Special fields such as password fields may be limited, so test them. When entering Chinese, confirm the encoding so it does not turn into garbage. Watch the timeout on long text, so a long input does not interrupt the script. Through the system-level permission of the agent IPA, it writes text straight into the control that currently has focus and skips keyboard interaction, so it is the fastest and also the most compatible.

The second level is the imeApi custom input method. With no agent IPA, and with the EC offline main program installed as an input method, you can use the imeApi module. The offline setup supports iOS 15 and above only. From v7.2.0 the main program can act as the USB automation program, so you do not also have to install an agent IPA. The official download page has a pre-signed IPA for testing. Below iOS 15 you cannot use it this way. From 7.0.0, single-app mode installs only the main program. Dual-app mode also installs an agent IPA. The steps are: install the EC offline main program on the phone; enable it in the input-method list (Settings → General → Keyboard → Add New Keyboard); start the forwarding service with imeApi.forwardImeServer();, then call the other imeApi functions to finish the input. You can enter text without an agent. You do not need a signed IPA, only the offline main program, and it can also be installed with a free signing setup. The feel is close to the system input method. Call forwardImeServer once during script init. You do not call it before every input. The input method has to be switched to the EC offline main program, or the input fails. If nothing happens, first check whether the system switched the input method back to the native keyboard. iOS may prompt Allow Full Access, which has to be turned on in the input-method settings. After the main program is registered as a system input method, forwardImeServer starts a local forwarding service on the phone. When the script calls an input function, the command goes through the forwarding service to the input method, and is written into the focused control as a system input method. It uses the iOS input-method framework and does not use the system permission of the agent IPA.

The third level is the Shortcuts helper. Use it when you have neither of the first two. The method is copy to the clipboard, then paste: an iOS Shortcut requests an interface on the computer, writes the content to the clipboard, and triggers a paste. Download iOS Shortcuts helper.zip from the iOS resources on the official EC cloud drive, unzip it, and double-click it on the computer. On the phone, create a new Shortcut, request the contents of a website, then copy to the clipboard. The interface address looks like http://192.168.2.26:8696. key=4eb2e1c1 is the phone’s unique id, and a Bluetooth MAC address can tell devices apart. Add a device vibration so the data can still be fetched in the background. Finally call back the suc interface to report that it succeeded. On the phone, under Settings → Accessibility → Keyboards and Typing → Full Keyboard Access → Commands, bind a shortcut to this Shortcut. In the central control, right-click, open Bluetooth or OTG HID settings, add a keyboard shortcut, bind a combination (such as gui+u), and click send. Enter add shortcut again, type the same combination, and send, and you should see the Shortcut run. In the script, call the matching event function to trigger it. Setup points:

Item Note
Computer IP LAN IP of the computer running the Shortcuts helper
key parameter Unique phone id. Use the Bluetooth MAC address to tell phones apart
Device vibration Makes sure the Shortcut can still run in the background and fetch the data
suc callback Tells the program it succeeded, so the script can tell whether the input finished
Shortcut binding Bind it in Full Keyboard Access commands, and map it in the central control to a gui+character combination

There are more setup steps. After it is configured, it can be shared to other phones. Without an agent, inserting a video or picture into the photo library can also use Shortcuts: create a Shortcut that calls Get Contents of URL twice, the first time for the real resource address and the second time for the resource content, bind the gui+i shortcut, and trigger it in the script to insert into the photo library. Run the whole chain on one phone first, then copy it to the other devices.

Shortcut flow:
Get Contents of URL (interface address) → real resource URL
    ↓
Get Contents of URL (real resource URL) → resource content
    ↓
Save to photo library → call back suc

How to choose, how to mix, and how to troubleshoot

Your environment Recommended setup Reason
Agent IPA inputText Most direct and efficient. One line finishes the input
No agent, offline main program imeApi Type without signing. The feel is close to native
Neither Shortcuts helper A zero-install fallback that can be shared and reused
A mixed device group Mix by device The setups do not conflict. The central control picks by device type

When a device group has different conditions, the script can pick an input setup by device type:

// Pseudocode: pick an input setup by device condition
if (hasAgent) {
    inputText('text content');           // has an agent
} else if (hasMainApp) {
    imeApi.forwardImeServer();      // has the offline main program
    imeApi.inputText('text content');
} else {
    bleEvent.keyPressChar('u');     // Shortcuts helper
}

This design lets one central control manage devices with different conditions, each on the setup that fits it. In a real deployment, mark the input setup each device supports in the device ledger, and match it automatically when the script runs, so a mismatch does not make the input fail. When input fails, check item by item in the order above:

Symptom Likely cause What to do
inputText does nothing Agent not started, or the text field has no focus Confirm the agent is running, and tap the text field first
imeApi does nothing Forwarding service is off, or the input method was not switched Call forwardImeServer and switch to the EC input method
Shortcut does not trigger Shortcut not bound, or the helper is not running Check the shortcut binding in the central control and confirm the helper is running on the computer
Garbage characters Encoding Make sure the script file is UTF-8
Cannot enter text in the background The Shortcut was suspended by the system Confirm the device-vibration action was added

A side-by-side of the three setups:

Dimension inputText imeApi Shortcuts helper
Needs an agent Yes No No
Needs the main program No Yes No
Setup complexity Lowest Medium Higher
Input speed Fastest Fast Slower (a network request)
Reuse Available on every phone Install the main program on every phone Share it after it is configured
Where it fits Signed devices No signing, with the main program Zero-install fallback

With signing, use inputText. With only the offline main program, use imeApi. With neither, put the text on the clipboard and paste it. A mixed device group uses each setup for its own device type.

About EasyClick: A mobile automation script development platform covering three phone ecosystems: Android without root, iOS without jailbreak, and HarmonyOS. It also offers Apple script writing, Apple cluster control, Android cluster control, remote cloud control, and AI phone cluster control. → Explore all products

Ready to build it for real?

Every approach in this article can be built on the EasyClick phone automation platform — full documentation, developer tools and cluster/cloud-control products, free to try.

Visit EasyClick →