core/process_utils library

Constants

tolerantUtf8 → const Utf8Codec
UTF-8 codec that replaces malformed bytes with U+FFFD instead of throwing.

Properties

adbExecutable ↔ String
getter/setter pair

Functions

canKillAppPidOnHost() → bool
cleanupTempFiles() → void
extractDevicesJson(String output) → String?
Extracts the JSON array from flutter devices --machine output.
hasMeaningfulSessionFiles() → bool
isAndroidAppPidAlive(int pid) → bool
isAndroidTarget() → bool
isAppPidAlive(int pid) → bool
isProcessAlive(int pid) → bool
Returns true if a process with pid is currently running.
isToolOnPath(String tool) → bool
Returns true if tool can be found on PATH.
projectPathFromSessionDir() → String
readAppId() → String?
Reads the persisted app bundle id / package name from .fdb/app_id.txt.
readAppPid() → int?
Reads the app VM PID from appPidFile written by fdb launch after the VM service is confirmed reachable.
readControllerPid() → int?
readControllerPort() → int?
readControllerToken() → String?
readDevice() → String?
readLinesTolerant(String path) → List<String>
Line-split variant of readTextTolerant, with readAsLinesSync semantics.
readLogCollectorPid() → int?
Read the log collector PID from its PID file.
readPid() → int?
readPlatformInfo() → ({bool emulator, String platform})?
Returns (platform, emulator) from the platform file, or null if absent.
readProjectPath() → String
Returns the session's Flutter project path: the path stored at launch, or the session directory's parent for sessions created by older fdb versions.
readTextTolerant(String path) → String
Reads a text file that may contain invalid UTF-8 (e.g. logs.txt, which carries raw app and tool output). Malformed sequences become U+FFFD instead of throwing. Returns an empty string when the file does not exist.
readVmUri() → String?
runProcessTolerant(String executable, List<String> arguments) → Future<ProcessResult>
Process.run that decodes stdout/stderr with tolerantUtf8.
terminateProcess(int pid, {Duration timeout = const Duration(seconds: 10)}) → Future<bool>
Sends SIGTERM to pid, waits up to timeout for it to exit, then sends SIGKILL and waits again. Returns true when the process is gone.
writeAppId(String appId) → void
Persists appId to .fdb/app_id.txt so later commands (e.g. crash-report) can use it without requiring --app-id.
writePlatformInfo(String targetPlatform, bool emulator) → void
Stores the Flutter target platform string and emulator flag for the active session. Written by fdb launch, read by fdb screenshot.
writeProjectPath(String projectPath) → void
Persists the absolute Flutter project path to .fdb/project_path.txt so later commands can read the project's resolved dependencies.