The command line interface provides a simple way to script the emulator, however it does not provide control flow and other more complex features. The command line interface therefore supports scripting with Python.
The scripting support is based on wrapping the C-API of the emulator using the
ctypes Python package.
Therefore it is possible to pass in Python functions where the API expects C-function pointers, for more details of how to do this, please consult the
ctypes documentation on https://www.python.org::
The wrappers are installed in:
The location is automatically detected by TEMU, so it is possible to use the wrappers by simply importing the packages from your python script.
Scripting wrappers typically strip the
Python scripts can be executed via the
script-run command from the CLI.
The command takes either a file using the
file argument, or a literal string using the
Another way to run a Python script is to start the CLI with the
--run-script option, using this option a non-interactive execution of TEMU will be started (which stops after the script finishes).
It is possible to run multiple script by specifying the
--run-script option multiple times.
As argument, pass a name of the script you want to execute.