core/core.g 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

analyzeLaunchFailure(String output, {int maxContextLines = 15}) → LaunchFailureAnalysis
buildAppDiedException({int? pid}) → Future<AppDiedException>
Builds an AppDiedException by reading the log tail and, when possible, performing a best-effort OS-level reason lookup.
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?
readLastLogLines() → List<String>
Reads the last _logTailLines lines from .fdb/logs.txt.
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), ProcessSignaller sendSignal = Process.killPid}) → 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.

Typedefs

LaunchFailureAnalysis = ({String category, List<String> contextLines, String? remediationHint, String rootCause})
ProcessSignaller = bool Function(int pid, ProcessSignal signal)
Sends signal to the process pid. Matches Process.killPid.

Exceptions / Errors

AppDiedException
Thrown when the target Flutter app process has died while fdb is trying to communicate with it via the VM service.