Repository navigation
Command Line
ClusterTune comes with a clustertune command line for ADB. There's nothing to install on the device, it needs no root, and it disappears when ClusterTune is uninstalled.
adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune help-
Install ClusterTune and open it once. From then on ClusterTune keeps the launcher at
/sdcard/Android/data/com.aure.clustertune/files/clustertuneand refreshes it whenever it starts, including after updates and reboots. - Connect with ADB (USB or wireless debugging).
- Run a command. The first one asks on the device: Allow ADB shell to control ClusterTune? Tap the notification, then Allow, and the waiting command finishes. To skip the question, switch on ADB shell under Settings → App access beforehand.
The path is long, so give it a short name on your computer:
# Linux, macOS (bash, zsh)
alias ct='adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune'# Windows PowerShell
function ct { adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune @args }The rest of this page uses ct. With several devices connected, put -s SERIAL after adb.
$ ct profile
NAME ID SOURCE
Small Underclock bundled_cq8725s_small bundled
Medium Underclock bundled_cq8725s_medium bundled
Large Underclock bundled_cq8725s_large bundled
Stock virtual_stock virtual
$ ct profile apply medium
Applied Medium Underclock
CPU 0 max 2227.2 MHz
CPU 6 max 2246.4 MHz
GPU max 1100 MHz
Revision 7e5f24cdc5c80ef4
$ ct state
Profile Medium Underclock
CPU 0 1996.8 MHz – 2227.2 MHz walt
CPU 6 1017.6 MHz – 2246.4 MHz walt
GPU max 1100 MHz msm-adreno-tz
Applied by normal: Medium Underclock
Auto Tune off
App detection connected
Output from an AYN Odin 3. state shows the live limits, which can differ from your saved settings (ct tuning) while an app assignment, the sleep profile or Auto Tune is active.
A command is an API method with a space instead of the dot. A resource on its own runs its read command, and the dotted form (profile.apply) works too.
| Command | Does |
|---|---|
state |
Show what is applied now, and who applied it |
tuning |
Show the saved settings and their revision |
tuning set SETTING... |
Change part of the saved settings and apply them |
profile |
List profiles |
profile apply NAME |
Apply a profile by name or ID |
app |
List per-app assignments |
app set PACKAGE PROFILE |
Use a profile while an app is visible |
app set PACKAGE SETTING... |
Use custom values while an app is visible |
app set PACKAGE autotune=FPS |
Let Auto Tune hold an FPS target while an app is visible |
app clear PACKAGE |
Remove an app's assignment |
device |
Show CPU policies, frequency steps (MHz), governors and GPU |
api |
Show the API version, methods and shortcuts |
help |
Show usage |
state get, tuning get, profile list, app list, device get and api info are the long forms of the bare resources.
Settings use the short syntax: cpu6.max=2.4GHz gpu.max=600 cpu.gov=schedutil cpu0.min=stock. Numbers are MHz unless they carry a unit, and snap to the nearest supported step (maximums down, minimums up); the output lists every snapped value.
Profile names match by a unique start of a word: medium, large u and stock all work, and names with spaces need no quotes (ct profile apply Large Underclock).
| Option | Effect |
|---|---|
--json |
Print the raw reply object instead of the summary. Failures that happen before ClusterTune answers are printed the same way, with code usage_error or unreachable, so scripts can always parse stdout (only help prints plain usage) |
--if-revision REV |
For profile apply and tuning set: apply only if the saved settings still have revision REV (from ct tuning); otherwise fail with conflict
|
-h, --help
|
Show usage |
| Status | Meaning |
|---|---|
| 0 | Success |
| 1 | API error: clustertune: CODE: message on stderr, or the reply object on stdout with --json
|
| 2 | Usage error; nothing was sent (usage_error with --json) |
| 3 | ADB access denied, or waiting for the user to answer |
| 4 | ClusterTune didn't answer (unreachable with --json) |
$ ct device
CPU 0 (cores 0)
max steps (MHz) 384 556.8 748.8 960 1152 1363.2 1555.2 1785.6 1996.8 2227.2 2400 2745.6 2918.4 3072 3321.6 3532.8
min steps (MHz) 384 556.8 748.8 960 1152 1363.2 1555.2 1785.6 1996.8 2227.2 2400 2745.6 2918.4 3072 3321.6 3532.8
governors walt, conservative, powersave, performance, schedutil
CPU 6 (cores 6)
max steps (MHz) 1017.6 1209.6 1401.6 1689.6 1958.4 2246.4 2438.4 2649.6 2841.6 3072 3283.2 3513.6 3801.6 4089.6 4204.8 4320
…
GPU
max steps (MHz) 160 222 342 389 443 525 607 660 734 832 900 967 1050 1100
governors msm-adreno-tz
$ ct tuning set cpu6.max=2.3GHz gpu.max=600
Applied settings
CPU 0 max 2227.2 MHz
CPU 6 max 2246.4 MHz
GPU max 525 MHz
cpu6.max=2.3GHz snapped to 2246.4 MHz
gpu.max=600 snapped to 525 MHz
Revision 0ef8bb99a0bc1aca
$ ct tuning
Profile custom values
CPU 0 min stock · max 2227.2 MHz · gov default
CPU 6 min stock · max 2246.4 MHz · gov default
GPU max 525 MHz · gov default
Revision 0ef8bb99a0bc1aca
More settings:
ct tuning set cpu.gov=schedutil # schedutil on every CPU policy
ct tuning set cpu0.min=1GHz cpu0.max=stock # a fixed floor, and the Stock ceiling
ct tuning set cpu0.min=stock cpu.gov=default # back to the automatic floor and default governors
ct profile apply stock # everything back to Stockcom.example.game stands for any installed app.
$ ct app set com.example.game large
Assigned Example Game (com.example.game): Large Underclock
$ ct app set com.example.game cpu6.max=2.4GHz gpu.max=607
Assigned Example Game (com.example.game): cpu6.max=2246.4 gpu.max=607
cpu6.max=2.4GHz snapped to 2246.4 MHz
$ ct app
PACKAGE APP SETTINGS
com.example.game Example Game cpu6.max=2246.4 gpu.max=607
$ ct app clear com.example.game
Assignment removed
--json prints the complete reply, so the exit status and jq cover most needs:
# Read the revision, then change settings only if nothing else changed them meanwhile
rev=$(ct tuning --json | jq -r .data.revision)
ct tuning set cpu6.max=2.4GHz --if-revision "$rev" || echo "Settings changed meanwhile: re-read and retry"
# Name of the profile that is live right now (null for custom values)
ct state --json | jq -r '.data.profile.name'| You see | What to do |
|---|---|
sh: /sdcard/…/clustertune: No such file or directory (or similar) |
ClusterTune hasn't run since it was installed: open it once |
clustertune: ClusterTune did not answer… (exit 4) |
Make sure ClusterTune is installed and has been opened once |
The command waits, then exits 3 with access_pending
|
Answer the question on the device (it arrives as a notification), then run the command again |
access_denied (exit 3) |
Allow ADB shell under Settings → App access |
unavailable: No PServer or root execution method is available… |
Set up PServer or root in ClusterTune first |
unavailable: The privileged host could not be reached… |
The privileged host may be restarting; try again after a few seconds. --json shows the details in data.host_error
|
ambiguous_profile |
Use more of the name, or the ID from ct profile
|
| Assignments don't take effect | Check App detection in ct state; open ClusterTune if it's disconnected |
The launcher is a short shell script. On every run it looks up ClusterTune's current APK with pm path and starts the command line from inside that APK with Android's app_process, as the ADB shell user. That's why it always matches the installed version and needs no root. Android removes Android/data/com.aure.clustertune when ClusterTune is uninstalled, launcher included.
Shared storage can't hold executables, hence the sh in front. ADB's shell also has no writable directory on its PATH, so a bare adb shell clustertune isn't possible without root.
Requests go through ClusterTune's broadcast entry point, which works even on firmware without Android's content command; that's also why the first-use question waits up to 45 seconds here. Raw ADB commands shows how to call the API directly.
External API
Project