Skip to content

olef fault

CLI v3.0.2View Markdown

Generated from Olef 3.0.2. All commands · Capabilities and requirements

These entries describe available commands, not a sequence to run. Check prerequisites before changing app, device, or cloud state. Global options are listed in the command catalog.

Put the device or app into a failure condition on purpose — process death, no network, full storage, a moved clock, failing backend calls — and undo it reliably. Start with fault kinds

Terminal window
olef fault --help

Output: json.

List every fault kind: what it does, whether it is a one-off action or a state fault clear undoes, and what it needs. No device required

Terminal window
olef fault kinds --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.

Inject a fault. A state fault stays until fault clear or --duration-ms; an action fault happens once. Replies with the fault record, including its id and how it will be undone

Terminal window
olef fault inject --help

Output: json.

Background the app and kill its process as Android does under memory pressure; its task stays in recents so reopening restores saved state

Terminal window
olef fault inject process-death --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--relaunch Reopen the app afterwards like tapping its icon, then report the new pid
--timeout-ms <TIMEOUT_MS> How long to wait for Android to let the backgrounded process be killed Default: 10000.
--json Accepted for compatibility; output is always JSON.

Destroy activities as soon as the user leaves them

Terminal window
olef fault inject dont-keep-activities --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Deliver an onTrimMemory level to the app

Terminal window
olef fault inject low-memory --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--level <LEVEL> running-* levels need the app in the foreground; the others in the background Default: running-critical. Values: running-moderate, running-low, running-critical, ui-hidden, background, moderate, complete.
--json Accepted for compatibility; output is always JSON.

Revoke a granted runtime permission (Android kills the app)

Terminal window
olef fault inject revoke-permission --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--permission <PERMISSION> Required. Permission name, e.g. android.permission.CAMERA
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Lock the screen rotation

Terminal window
olef fault inject orientation --help

Output: json.

Argument Description
--rotation <ROTATION> Required. Values: 0, 90, 180, 270.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Switch the system dark theme

Terminal window
olef fault inject night-mode --help

Output: json.

Argument Description
--mode <MODE> Default: on. Values: on, off.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Change the system font scale

Terminal window
olef fault inject font-scale --help

Output: json.

Argument Description
--scale <SCALE> Required. Font scale, 0.5-3.0 (1.0 is the default size)
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Override the display size and/or density

Terminal window
olef fault inject display-size --help

Output: json.

Argument Description
--size <SIZE> Size as WIDTHxHEIGHT pixels, e.g. 1080x1200
--density <DENSITY> Density in dpi, e.g. 320
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Set the app’s own locale (per-app language)

Terminal window
olef fault inject app-locale --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--locales <LOCALES> Required. Language tags separated by commas, e.g. ar-EG or he,en-US
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Shrink the app’s task to part of the screen, as split screen does

Terminal window
olef fault inject split-screen --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--percent <PERCENT> Share of the screen height the app keeps, 20-80 Default: 50.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Leave the app (HOME) so it can enter picture-in-picture; reports whether it did

Terminal window
olef fault inject pip --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--json Accepted for compatibility; output is always JSON.

Force the device into deep Doze

Terminal window
olef fault inject doze --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Move the app to an App Standby bucket

Terminal window
olef fault inject standby-bucket --help

Output: json.

Argument Description
--app <APP> App package. Defaults to the configured app
--bucket <BUCKET> Required. Values: active, working-set, frequent, rare, restricted.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Report the battery as unplugged, optionally low and with Battery Saver

Terminal window
olef fault inject battery --help

Output: json.

Argument Description
--level <LEVEL> Battery level percent, 0-100 (default: keep the current level)
--saver Also turn Battery Saver on
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Report a thermal (overheating) status

Terminal window
olef fault inject thermal --help

Output: json.

Argument Description
--status <STATUS> Required. Values: light, moderate, severe, critical, emergency, shutdown.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Fill the data partition until only –free-mb remains

Terminal window
olef fault inject storage-full --help

Output: json.

Argument Description
--free-mb <FREE_MB> Space left free, in MiB Default: 50.
--allow-physical Allow this on a physical device (other apps run out of space too)
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Move the system clock

Terminal window
olef fault inject clock --help

Output: json.

Argument Description
--offset-ms <OFFSET_MS> Required. Milliseconds to move the clock; negative moves it back
--allow-physical Allow this on a physical device (turns automatic time off until clear)
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Change the system time zone

Terminal window
olef fault inject timezone --help

Output: json.

Argument Description
--tz <TZ> Required. Olson time zone id, e.g. Asia/Tokyo
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Keep CPU cores busy

Terminal window
olef fault inject cpu-load --help

Output: json.

Argument Description
--threads <THREADS> Busy loops to run (default: one per CPU core)
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Turn airplane mode on

Terminal window
olef fault inject airplane-mode --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Turn Wi-Fi off

Terminal window
olef fault inject wifi-off --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Turn mobile data off

Terminal window
olef fault inject mobile-data-off --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Toggle airplane mode on and off repeatedly

Terminal window
olef fault inject network-flap --help

Output: json.

Argument Description
--period-ms <PERIOD_MS> Time spent in each state, in milliseconds Default: 5000.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Make every DNS lookup fail

Terminal window
olef fault inject dns-failure --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Throttle the emulator link to a cellular speed (emulator only)

Terminal window
olef fault inject network-speed --help

Output: json.

Argument Description
--profile <PROFILE> Required. Values: gsm, gprs, edge, umts, hsdpa, lte.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Add cellular latency to the emulator link (emulator only)

Terminal window
olef fault inject network-latency --help

Output: json.

Argument Description
--profile <PROFILE> Required. Values: gprs, edge, umts.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Answer matching proxied requests with an HTTP error (needs net start)

Terminal window
olef fault inject http-errors --help

Output: json.

Argument Description
--host <HOST> Only requests whose host contains this text
--path <PATH> Only requests whose path contains this text
--percent <PERCENT> Share of matching requests hit, 1-100 Default: 100.
--seed <SEED> Seed for which requests are hit when –percent is below 100: the same seed hits the same requests in the same order Default: 0.
--status <STATUS> HTTP status to answer with Default: 503.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Delay matching proxied requests (needs net start)

Terminal window
olef fault inject http-latency --help

Output: json.

Argument Description
--host <HOST> Only requests whose host contains this text
--path <PATH> Only requests whose path contains this text
--percent <PERCENT> Share of matching requests hit, 1-100 Default: 100.
--seed <SEED> Seed for which requests are hit when –percent is below 100: the same seed hits the same requests in the same order Default: 0.
--delay-ms <DELAY_MS> Required. Delay in milliseconds
--jitter-ms <JITTER_MS> Extra random delay up to this many milliseconds (seeded by –seed) Default: 0.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Stream matching proxied responses at a limited rate (needs net start)

Terminal window
olef fault inject bandwidth --help

Output: json.

Argument Description
--host <HOST> Only requests whose host contains this text
--path <PATH> Only requests whose path contains this text
--percent <PERCENT> Share of matching requests hit, 1-100 Default: 100.
--seed <SEED> Seed for which requests are hit when –percent is below 100: the same seed hits the same requests in the same order Default: 0.
--bytes-per-sec <BYTES_PER_SEC> Required. Bytes per second delivered to the app
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Break matching proxied responses partway through (needs net start)

Terminal window
olef fault inject connection-reset --help

Output: json.

Argument Description
--host <HOST> Only requests whose host contains this text
--path <PATH> Only requests whose path contains this text
--percent <PERCENT> Share of matching requests hit, 1-100 Default: 100.
--seed <SEED> Seed for which requests are hit when –percent is below 100: the same seed hits the same requests in the same order Default: 0.
--after-bytes <AFTER_BYTES> Response body bytes delivered before the connection breaks Default: 0.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Deliver only the start of matching proxied response bodies as if complete (needs net start)

Terminal window
olef fault inject truncated-response --help

Output: json.

Argument Description
--host <HOST> Only requests whose host contains this text
--path <PATH> Only requests whose path contains this text
--percent <PERCENT> Share of matching requests hit, 1-100 Default: 100.
--seed <SEED> Seed for which requests are hit when –percent is below 100: the same seed hits the same requests in the same order Default: 0.
--keep-bytes <KEEP_BYTES> Response body bytes kept Default: 16.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Fail the TLS handshake for matching HTTPS hosts (needs net start)

Terminal window
olef fault inject tls-failure --help

Output: json.

Argument Description
--host <HOST> Required. Hosts containing this text fail their TLS handshake
--percent <PERCENT> Share of connections that fail, 1-100 Default: 100.
--seed <SEED> Seed for which connections fail when –percent is below 100 Default: 0.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Ring an incoming phone call (emulator only)

Terminal window
olef fault inject incoming-call --help

Output: json.

Argument Description
--number <NUMBER> Caller number Default: 5551234.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Deliver an incoming SMS (emulator only)

Terminal window
olef fault inject sms --help

Output: json.

Argument Description
--from <FROM> Sender number Default: 5551234.
--text <TEXT> Required. Message text
--json Accepted for compatibility; output is always JSON.

Turn the screen off

Terminal window
olef fault inject screen-off --help

Output: json.

Argument Description
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Pull the notification shade or quick settings down over the app

Terminal window
olef fault inject notification-shade --help

Output: json.

Argument Description
--panel <PANEL> Default: notifications. Values: notifications, quick-settings.
--duration-ms <DURATION_MS> Clear the fault automatically after this many milliseconds. Without it the fault stays until fault clear
--json Accepted for compatibility; output is always JSON.

Crash the emulator (emulator only)

Terminal window
olef fault inject emulator-crash --help

Output: json.

Argument Description
--relaunch Boot the emulator again afterwards
--cold-boot With –relaunch, cold boot instead of loading the quick-boot snapshot
--json Accepted for compatibility; output is always JSON.

List the faults active on the device, oldest first

Terminal window
olef fault list --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.

Undo faults and verify each restore. Newest first with –all

Terminal window
olef fault clear --help

Output: json.

Argument Description
<ids> Fault ids from fault inject or fault list
--all Clear every fault active on the device
--expired Set by the –duration-ms timer: an id that is already gone is not an error
--json Accepted for compatibility; output is always JSON.

Emulator snapshots: save a known state before a fault run, load it back after

Terminal window
olef fault snapshot --help

Output: json.

Save the emulator’s current state under a name

Terminal window
olef fault snapshot save --help

Output: json.

Argument Description
<name> Required.
--json Accepted for compatibility; output is always JSON.

Load a saved state (the app and Olef server restart with it)

Terminal window
olef fault snapshot load --help

Output: json.

Argument Description
<name> Required.
--json Accepted for compatibility; output is always JSON.

List saved snapshots

Terminal window
olef fault snapshot list --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.

Delete a saved snapshot

Terminal window
olef fault snapshot delete --help

Output: json.

Argument Description
<name> Required.
--json Accepted for compatibility; output is always JSON.

Run a JSON scenario: a sequence of Olef commands, faults, waits and checks. Every fault it injected is cleared at the end, pass or fail

Terminal window
olef fault run --help

Output: json.

Argument Description
<file> Required. Scenario JSON file (see commands --guide faults)
--seed <SEED> Seed for pick steps and proxy faults without their own –seed; the same seed replays the same choices. Overrides the file’s seed
--step-timeout-ms <MS> Stop a step that runs longer than this; the step fails and the scenario’s faults are still cleared Default: 600000.
--json Accepted for compatibility; output is always JSON.