AutoPie includes a Termux-based environment, so you can now install packages from the terminal with pkg install package-name.
AutoPie is your own power tool-kit for Android.
autopie-feature-demo1.mp4
- Build from source yourself or get the prebuilt APK from the releases section.
- Install the APK and accept Play Protect Dialogs if any.
- Open AutoPie once and wait for the embedded Termux bootstrap to finish installing.
- Grant necessary permissions.
- Optional: Disable Battery Optimization for AutoPie.
- Open AutoPie App
- There are currently three types of commands.
Share Sheet Commands,Folder Observer CommandsandCron Commands. - Add your desired Commands in the AutoPie App by clicking on Add Button or Edit an already existing command.
- Open the Terminal inside AutoPie
- Install Termux packages with
pkg install package-name - Install Python packages with
pip install package-name
- If
pkg installfails immediately after installation, open the AutoPie terminal once more and let the bootstrap finish before retrying. - Check that the
AutoSecfolder containsobservers.jsonfor Folder Observation Automation,shares.jsonfor Share Sheet Configuration andcron.jsonfor Cron Configuration. If not or if your commands list is empty, delete theAutoSecfolder and reopen the application.
| PLACEHOLDER | DESCRIPTION |
|---|---|
| ${INPUT_FILE} | Use it to pass input file path or url in the command |
| ${INPUT_FILES} | If multiple files are needed as input to the command Example : magick combine two images |
| ${INPUT_FILES_ARR} | Input files as Shell array Example : magick "${INPUT_FILES_ARR[@]}" |
| ${INPUT_URL} | If the program takes a single URL |
| ${INPUT_URLS} | If the program takes multiple URLs |
| ${INPUT_TEXT} | If program takes raw TEXT as input |
| ${FILENAME} | Filename without path |
| ${DIRECTORY} | Parent Directory of file |
| ${FILENAME_NO_EXT} | Filename without path and extension |
| ${FILE_EXT} | File extension |
| ${RAND} | Random 4 digit number |
| ${HOST} | URL host (Only available if the input is a URL) |
| USE | COMMAND |
|---|---|
| Ffmpeg Extract Audio from Video | ffmpeg -i ${INPUT_FILE} -b:a 192K -vn ${INPUT_FILE}.mp3 |
| ImageMagick combine horizontal | magick ${INPUT_FILES} +append ${INPUT_FILE}-horiz-${RAND}.jpeg |
AutoPie supports starting command dialogs from other apps through intents. Other apps cannot directly run commands without user prompt.
Extend the functionality of your apps by adding RunCommandButton().
@Composable
fun RunCommandButton(){
val context = LocalContext.current
val intent = Intent(Intent.ACTION_MAIN).apply {
setClassName(context, "com.autopi" + ".DirectCommandActivity")
component = ComponentName(
"com.autopi", // target app package
"com.autopi.DirectCommandActivity" // full class name
)
putExtra("commandId", "YT-DLP Generic Downloader")
putExtra("input", "https://www.youtube.com/watch?v=7N74-JBHk3g")
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
Button(onClick = {
try {
context.startActivity(intent)
}catch (e: Exception){
Log.e("ERROR",e.toString())
}
}) {
Text("Run Command")
}
}With AutoPie, you can define custom arguments called (extras) for commands.
This will show a card where you can input details to customize the behaviour of the command.
For Example,
Defining extra items such as options for codecs etc will look like this.
-
A package manager powered by the embedded Termux environment.
-
A repository where users can search and add pre-made AutoPie command snippets is in the works.
AutoPie now comes with your own MCP server that you can use to automate your phone with AI Tools.
The server is easily extensible by adding your scripts to the /ExternalStorage/AutoSec/mcp_modules folder.
The scripts inside this folder will be included as tools in the MCP server.
You can add any kind of functionality on your phone with this by just writing a Python script.
The MCP tool scripts should be in this format.
import os
from typing import Dict, Any
from pydantic import BaseModel
class CreateFileInput(BaseModel):
filepath: str
content: str
class MCPTool:
path = "/create_file"
name = "create_text_file"
methods=["POST"]
async def run(self, input: CreateFileInput) -> Dict[str, Any]:
"""Creates a text file with the specified content."""
try:
# Create directory if it doesn't exist
os.makedirs(os.path.dirname(os.path.abspath(input.filepath)), exist_ok=True)
# Write content to file
with open(input.filepath, "w") as f:
f.write(input.content)
return {
"status": "success",
"message": f"File '{input.filepath}' created successfully"
}
except Exception as e:
return {
"status": "error",
"message": f"Failed to create file: {str(e)}"
}You can build the app by opening the project with Android Studio and running the
normal Gradle build tasks. For a clean command-line build that prepares the
embedded Termux source and bootstrap, use build_with_termux.sh.
The Termux modules are generated rather than stored as a git submodule. To clone the latest official Termux source, apply the AutoPie patch series, and build a debug APK, run:
./build_with_termux.shPass Gradle tasks as arguments for another build, for example
./build_with_termux.sh :app:assembleRelease. Set TERMUX_REF to pin a
specific upstream tag or commit.
The build script also downloads Termux's pinned bootstrap, injects AutoPie's
required packages from termux repo, patches package paths for com.autopi, and writes the final
bootstrap archive to app/src/main/assets/bootstrap-aarch64.zip.
Run ./scripts/prepare-termux-app.sh when you only want to refresh the patched
Termux checkout for Android Studio. Run ./scripts/prepare-termux-bootstrap.sh
when you only want to regenerate the bootstrap asset.
The current bootstrap includes python, pip, binutils, openssh, and
sshpass so package installation works from a fresh app install without Docker
or the old Python/busybox build scripts.
- Supports only aarch64/arm-v8 as of now. It should run on most newer phones.




