Repository navigation
Command Line
ClusterTune contains a clustertune command line for ADB. It needs no root and no setup on the device beyond allowing ADB once, and nothing is left behind 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/clustertune, refreshed whenever the app starts (also after updates and reboots). - Enable USB or wireless debugging and connect with
adb. - Run any command. The first one asks on the device: Allow ADB shell to control ClusterTune? Tap the notification, then Allow; the waiting command then finishes. To skip the question, switch on ADB shell under Settings → App access beforehand.
On your computer, an alias makes commands short:
alias ct='adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune'
ct profile apply mediumAdd -s SERIAL after adb when several devices are connected.
Commands are the API methods with a space instead of the dot, and a resource alone runs its read command. The dotted form (profile.apply) works too.
| Command | Does |
|---|---|
state |
What is applied now, and who applied it |
tuning |
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 |
Apply a profile while an app is visible |
app set PACKAGE SETTING... |
Apply custom values while an app is visible |
app set PACKAGE autotune=FPS |
Let Auto Tune hold FPS while an app is visible |
app clear PACKAGE |
Remove an app's assignment |
device |
CPU policies, frequency steps, governors, GPU |
api |
API version, methods and shortcuts |
help |
Usage |
state get, tuning get, profile list, app list, device get and api info are the same as the bare resource.
Settings use the short syntax: cpu6.max=2.4GHz gpu.max=600 cpu.gov=schedutil cpu0.min=stock. Frequencies are MHz unless they carry a unit, and snap to the nearest supported step (maximums down, minimums up); each snapped value is printed. Profile names match by a unique start of a word, so medium, large u and stock work, and names with spaces need no quotes.
| Option | Effect |
|---|---|
--json |
Print the raw reply object instead of the summary |
--if-revision REV |
For profile apply and tuning set: apply only if the saved settings still have revision REV (from tuning); otherwise fail with conflict
|
-h, --help
|
Usage |
| Status | Meaning |
|---|---|
| 0 | Success |
| 1 | API error; clustertune: CODE: message on stderr |
| 2 | Usage error (the request was not sent) |
| 3 | ADB access denied, or waiting for approval |
| 4 | ClusterTune did not answer (not installed, never opened, or no reply in time) |
Output from an AYN Odin 3; com.example.game stands for any installed app.
$ 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
$ ct tuning
Profile Medium Underclock
CPU 0 min stock · max 2227.2 MHz · gov default
CPU 6 min stock · max 2246.4 MHz · gov default
GPU max 1100 MHz · gov default
Revision 7e5f24cdc5c80ef4
state shows live limits (they can differ from tuning while an app assignment, the sleep profile or Auto Tune is active). tuning shows what ClusterTune keeps applied otherwise.
$ 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 profile apply underclock
clustertune: ambiguous_profile: "underclock" matches several profiles: Small Underclock, Medium Underclock, Large Underclock. Use more of the name or the ID.
$ 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
More settings:
ct tuning set cpu.gov=schedutil # every CPU policy
ct tuning set cpu0.min=1GHz cpu0.max=stock # explicit floor, Stock ceiling
ct tuning set cpu0.min=stock cpu.gov=default # back to automatic floor and Default governors
ct profile apply stock # everything back to Stock$ 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 full reply; combine it with the exit status:
rev=$(adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune tuning --json | jq -r .data.revision)
ct tuning set cpu6.max=2.4GHz --if-revision "$rev" || echo "settings changed meanwhile, re-read and retry"The launcher is a three-line shell script. On every run it looks up ClusterTune's current APK with pm path and starts the command line from inside it with Android's app_process, as the ADB shell user. So the command line always matches the installed version, needs no root, and is deleted with the app (Android removes Android/data/com.aure.clustertune on uninstall).
Shared storage does not allow running files directly, hence sh. ADB's shell has no writable directory on its PATH, so a bare adb shell clustertune is not possible without root.
The command line sends each request through ClusterTune's broadcast entry point, which works even on firmware without Android's content command; the first-use question therefore waits up to 45 seconds. See Raw ADB commands for calling the API without it.
External API
Project