Force-stops Dala app processes on connected devices and optionally wipes their app data — a clean-slate reset without reinstalling.
Exists because a plain Activity restart is not a full restart on Android:
BeamForegroundService outlives the Activity, so the BEAM keeps running
with old NIFs and BEAMs loaded (see docs/reference/issues.md #11). A reset
force-stops both packages — the project bundle and the dala wrapper
package (com.dala.<app>) that hosts the foreground service — then clears
the logcat buffer so the next launch's output is easy to read.
Summary
Functions
adb argument lists that wipe each package's data (pm clear).
Returns the Android packages to stop: the project bundle id plus the dala
wrapper package (com.dala.<app>). Deduplicated — when the bundle id is
already the wrapper form there is exactly one entry.
adb argument lists that stop the app and clear the logcat buffer. Pure — no adb calls. Exposed for testing.
simctl argument lists for an iOS simulator: terminate the app (ignored when not running) plus uninstall when wiping data. Pure — no simctl calls.
Resets one device. Returns {:ok, summary} or {:error, reason}.
Resets matching devices (all connected by default).
Resets an explicit device list. Public test seam used by reset_all/1.
Types
Functions
adb argument lists that wipe each package's data (pm clear).
Returns the Android packages to stop: the project bundle id plus the dala
wrapper package (com.dala.<app>). Deduplicated — when the bundle id is
already the wrapper form there is exactly one entry.
adb argument lists that stop the app and clear the logcat buffer. Pure — no adb calls. Exposed for testing.
simctl argument lists for an iOS simulator: terminate the app (ignored when not running) plus uninstall when wiping data. Pure — no simctl calls.
@spec reset(DalaDev.Device.t(), opts()) :: result()
Resets one device. Returns {:ok, summary} or {:error, reason}.
Options:
:clear_data- also wipe app data (pm clear/simctl uninstall):bundle_id- override the resolved bundle id
Resets matching devices (all connected by default).
Options: :device, :clear_data, :bundle_id, plus the test seams
:devices (explicit device list) and :exec (command executor override —
receives tagged {:adb, args} / {:xcrun, args}, returns
{:ok, out} / {:error, out_or_reason}).
Returns a list of {label, result} tuples in discovery order.
@spec reset_devices([DalaDev.Device.t()], opts()) :: [{String.t(), result()}]
Resets an explicit device list. Public test seam used by reset_all/1.