Skip to content

Add ADB Commander feature#503

Merged
rteyssandier merged 10 commits intoopenflocon:mainfrom
aldefy:feat/adb-commander
Apr 5, 2026
Merged

Add ADB Commander feature#503
rteyssandier merged 10 commits intoopenflocon:mainfrom
aldefy:feat/adb-commander

Conversation

@aldefy
Copy link
Copy Markdown
Contributor

@aldefy aldefy commented Feb 18, 2026

Summary

  • Adds a new ADB Commander screen to the desktop app (closes [Feature]: Support arbitrary ADB commands #491)
  • Three-tab UI: Runner (console output), Library (saved commands, automation flows, 47 built-in quick commands), History (timestamped command log)
  • Supports Automation Flows - multi-step ADB command sequences with configurable delays between steps
  • Works with or without a Flocon-paired device (falls back to targeting all connected ADB devices)
  • Full clean architecture: domain models, Room entities, use cases, repository, ViewModel, Compose UI

Details

  • 12 use cases covering command execution, save/delete/update for commands and flows, history management, and flow execution with cancellation support
  • 4 new Room entities (saved commands, history, flows, flow steps) - no FK to DeviceEntity so it works standalone
  • 47 built-in quick commands across 8 categories (Device Info, App Management, Input, Connectivity, Debug, Settings, Performance)
  • Flow editor dialog for creating/editing multi-step automation flows
  • DB version bumped to 80

Test plan

  • Connect an Android device/emulator
  • Navigate to ADB Commander in left sidebar
  • Runner tab: type shell echo hello → Run → verify output in console
  • Save command → verify it appears in Library tab
  • Library tab: Run a saved command → verify execution
  • Try built-in quick commands (e.g. Device Model, Battery Status)
  • Create an automation flow with 2+ steps and delays
  • Run flow → verify step-by-step progress in Runner tab
  • Cancel flow mid-execution → verify remaining steps marked as Skipped
  • History tab: verify all commands logged with timestamps
  • Test without a Flocon-paired device (should still work via ADB directly)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @aldefy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the desktop application by integrating a robust ADB Commander feature. This new functionality empowers users to directly execute ADB commands, create and manage complex automation flows, and maintain a comprehensive history of their interactions, thereby streamlining device debugging and development workflows.

Highlights

  • New ADB Commander Feature: Introduced a new 'ADB Commander' screen to the desktop application, providing a dedicated interface for ADB interactions.
  • Three-Tab User Interface: The ADB Commander features a 'Runner' tab for console output, a 'Library' tab for saved commands and automation flows, and a 'History' tab for logging executed commands.
  • Automation Flows: Added support for multi-step ADB command sequences, known as 'Automation Flows', which can include configurable delays between steps.
  • Device Agnostic Operation: The feature is designed to work seamlessly with or without a Flocon-paired device, falling back to targeting all connected ADB devices when no specific device is paired.
  • Clean Architecture Implementation: The new feature adheres to clean architecture principles, incorporating new Room entities, dedicated use cases, a repository, a ViewModel, and Compose UI components.
  • Database Schema Update: The application's Room database schema has been updated to version 80 to accommodate new entities for saved ADB commands, command history, automation flows, and flow steps.
Changelog
  • FloconDesktop/composeApp/schemas/io.github.openflocon.flocondesktop.common.db.AppDatabase/79.json
    • Removed the database schema for version 79.
  • FloconDesktop/composeApp/schemas/io.github.openflocon.flocondesktop.common.db.AppDatabase/80.json
    • Added the new database schema for version 80, incorporating new entities for ADB commands, history, flows, and flow steps.
  • FloconDesktop/composeApp/src/commonMain/composeResources/values/strings.xml
    • Added a new string resource for the 'ADB Commander' menu item.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io.github.openflocon/flocondesktop/features/adbcommander/view/LibraryContent.kt
    • Implemented the UI for displaying saved ADB commands, automation flows, and quick commands.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github.openflocon/flocondesktop/app/AppViewModel.kt
    • Imported AdbCommanderRoutes and added SubScreen.AdbCommander to the navigation mapping logic.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/app/AppScreen.kt
    • Imported and integrated the new adbCommanderRoutes into the application's navigation graph.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/app/ui/model/SubScreen.kt
    • Added AdbCommander as a new SubScreen data object to represent the new feature.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/app/ui/model/leftpanel/MenuUiState.kt
    • Included the 'ADB Commander' menu item within the 'Actions' section of the left panel menu.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/app/ui/view/SubScreenSelectorItem.kt
    • Imported the Terminal icon, added the string resource for 'ADB Commander', and mapped the AdbCommander SubScreen to its display name and icon.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/common/db/AppDatabase.kt
    • Imported new ADB Commander related entities and DAO, updated the database version to 80, and added AdbCommanderDao to the abstract AppDatabase class.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/common/db/RoomModule.kt
    • Added adbCommanderDao to the Koin module responsible for Room database dependencies.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/FeaturesModule.kt
    • Imported and included adbCommanderModule in the main features module for dependency injection.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/AdbCommanderViewModel.kt
    • Added a new ViewModel to manage the UI state, command execution, and flow management for the ADB Commander feature.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/DI.kt
    • Added a Koin module to provide the AdbCommanderViewModel.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/Navigation.kt
    • Defined the navigation routes for the new ADB Commander screen.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/mapper/Mapper.kt
    • Added mapper functions to convert domain models to UI models for ADB commands, history, flows, and flow execution states.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/model/AdbCommanderUiModels.kt
    • Defined various UI models for the ADB Commander feature, including tabs, UI state, console entries, saved commands, flows, history, and flow editor states.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/model/DefaultAdbCommands.kt
    • Added a predefined list of categorized quick ADB commands.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/view/AdbCommanderScreen.kt
    • Implemented the main Composable screen for the ADB Commander, integrating the ViewModel and managing the display of different tabs.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/view/FlowEditorDialog.kt
    • Implemented a dialog component for creating and editing ADB automation flows.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/view/HistoryContent.kt
    • Implemented the UI for displaying ADB command history, including options to rerun commands and clear the history.
  • FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/adbcommander/view/RunnerContent.kt
    • Implemented the UI for the ADB command runner, responsible for displaying console output and the progress of flow executions.
  • FloconDesktop/data/core/src/commonMain/kotlin/io/github/openflocon/data/core/DI.kt
    • Imported and included adbCommanderModule in the data core module for dependency injection.
  • FloconDesktop/data/core/src/commonMain/kotlin/io/github/openflocon/data/core/adbcommander/DI.kt
    • Added a Koin module to provide the AdbCommanderRepositoryImpl.
  • FloconDesktop/data/core/src/commonMain/kotlin/io/github/openflocon/data/core/adbcommander/datasource/AdbCommanderLocalDataSource.kt
    • Defined the interface for local data source operations specific to the ADB Commander feature.
  • FloconDesktop/data/core/src/commonMain/kotlin/io/github/openflocon/data/core/adbcommander/repository/AdbCommanderRepositoryImpl.kt
    • Implemented the AdbCommanderRepository using the local data source for data persistence.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github.openflocon/data/local/DI.kt
    • Imported and included adbCommanderModule in the data local module for dependency injection.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github.openflocon/data/local/adbcommander/models/AdbFlowEntity.kt
    • Defined the Room entity for storing ADB automation flows.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github.openflocon/data/local/adbcommander/models/AdbFlowStepEntity.kt
    • Defined the Room entity for storing individual steps within ADB automation flows.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/DI.kt
    • Added a Koin module to provide the LocalAdbCommanderDataSourceRoom.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/dao/AdbCommanderDao.kt
    • Defined the Room Data Access Object (DAO) for ADB Commander entities, including saved commands, history, flows, and flow steps.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/datasource/LocalAdbCommanderDataSourceRoom.kt
    • Implemented the AdbCommanderLocalDataSource using the Room DAO for local data management.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/mapper/Mapper.kt
    • Added mapper functions to convert domain models to Room entities and vice versa for ADB commands, history, flows, and flow steps.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/models/AdbCommandHistoryEntity.kt
    • Defined the Room entity for storing ADB command history.
  • FloconDesktop/data/local/src/commonMain/kotlin/io/github/openflocon/data/local/adbcommander/models/AdbSavedCommandEntity.kt
    • Defined the Room entity for storing saved ADB commands.
  • FloconDesktop/domain/src/commonMain/kotlin/io.github.openflocon/domain/adbcommander/usecase/ObserveSavedCommandsUseCase.kt
    • Defined the use case for observing saved ADB commands.
  • FloconDesktop/domain/src/commonMain/kotlin/io.github.openflocon/domain/adbcommander/usecase/SaveFlowUseCase.kt
    • Defined the use case for saving an ADB automation flow.
  • FloconDesktop/domain/src/commonMain/kotlin/io.github.openflocon/domain/adbcommander/usecase/UpdateFlowUseCase.kt
    • Defined the use case for updating an existing ADB automation flow.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github.openflocon/domain/adbcommander/usecase/SaveCommandUseCase.kt
    • Defined the use case for saving an ADB command.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github.openflocon/domain/adbcommander/usecase/UpdateSavedCommandUseCase.kt
    • Defined the use case for updating a saved ADB command.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/DI.kt
    • Imported and included adbCommanderModule in the domain module for dependency injection.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/DI.kt
    • Added a Koin module to provide various ADB Commander use cases.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/models/AdbCommandDomainModel.kt
    • Defined the domain model for an ADB command.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/models/AdbCommandHistoryDomainModel.kt
    • Defined the domain model for ADB command history entries.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/models/AdbFlowDomainModel.kt
    • Defined the domain models for ADB automation flows and their individual steps.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/models/AdbFlowExecutionState.kt
    • Defined the domain model to represent the state of an ADB flow execution.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/repository/AdbCommanderRepository.kt
    • Defined the interface for the ADB Commander repository.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/ClearCommandHistoryUseCase.kt
    • Defined the use case for clearing ADB command history.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/DeleteFlowUseCase.kt
    • Defined the use case for deleting an ADB automation flow.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/DeleteSavedCommandUseCase.kt
    • Defined the use case for deleting a saved ADB command.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/ExecuteAdbCommanderCommandUseCase.kt
    • Defined the use case for executing a single ADB command and logging its outcome.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/ExecuteFlowUseCase.kt
    • Defined the use case for executing an ADB automation flow, including step-by-step processing, delays, and cancellation logic.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/ObserveCommandHistoryUseCase.kt
    • Defined the use case for observing changes in the ADB command history.
  • FloconDesktop/domain/src/commonMain/kotlin/io/github/openflocon/domain/adbcommander/usecase/ObserveFlowsUseCase.kt
    • Defined the use case for observing available ADB automation flows.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Feb 18, 2026

@florent37 Would you mind reviewing this PR? It implements #491 (ADB Commander feature).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the comprehensive 'ADB Commander' feature, which is a significant and well-structured addition to the application. The implementation follows a clean architecture, separating concerns across domain, data, and UI layers. My review has identified a few key areas for improvement, primarily focusing on enhancing performance in data retrieval from the database, correcting a logic issue with timestamp updates, and improving state management within the ViewModel for better robustness. Addressing these points will further solidify the feature's foundation.

Copy link
Copy Markdown
Contributor

@rteyssandier rteyssandier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to not use hardcoded strings

Comment thread .github/screenshots/history.png Outdated
@rteyssandier rteyssandier added the enhancement New feature or request label Feb 18, 2026
@rteyssandier
Copy link
Copy Markdown
Contributor

@florent37 suggested to make a menu on the left, like for Database. Would be easier to switch between commands

@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Feb 18, 2026

Great suggestion, will tackle the sidebar layout (like Database) as a follow-up. The current PR uses tabs, but a left panel with collapsible sections (Saved Commands, Flows, Quick Commands, History) alongside an always-visible console would be a better UX. Will open a separate issue/PR for this or would you prefer to have it planned on this PR?

@aldefy aldefy requested a review from rteyssandier February 19, 2026 17:37
@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Feb 22, 2026

Just checking in if this PR needs any more changes , happy to fix/add changes

@florent37
Copy link
Copy Markdown
Contributor

I like the feature honnestly, and it's easy to use, I'm just a bit concerned about the UX
I mean :

  • you don't see easily the textfield on top, maybe you should try to do something like Database
Screenshot 2026-02-27 at 22 20 55 Screenshot 2026-02-27 at 22 22 04
  • having pre configured commands is a must have, I'm agree with you, just every "line" should looks like a button IMO, and just one click to execute (instead of going on right to click on arrow to execute)
Screenshot 2026-02-27 at 22 24 17

---> again the UX of database, with a left pannel is better in term of lookalike

and it goes with my 3rd and last point :

  • eveytime you perform a "library" command, it redirects you to the "runner"

I think to fix all of these UX concerns, having the database lookalike with :

                [ edittext/command ]
[ library] [ runner ]

is a good solution
happy to discuss this with you :)

btw thanks a lot for this merge request <3

Screenshot 2026-02-27 at 22 26 49

@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Mar 9, 2026

I like the feature honnestly, and it's easy to use, I'm just a bit concerned about the UX I mean :

  • you don't see easily the textfield on top, maybe you should try to do something like Database

Screenshot 2026-02-27 at 22 20 55 Screenshot 2026-02-27 at 22 22 04

  • having pre configured commands is a must have, I'm agree with you, just every "line" should looks like a button IMO, and just one click to execute (instead of going on right to click on arrow to execute)
Screenshot 2026-02-27 at 22 24 17 ---> again the UX of database, with a left pannel is better in term of lookalike

and it goes with my 3rd and last point :

  • eveytime you perform a "library" command, it redirects you to the "runner"

I think to fix all of these UX concerns, having the database lookalike with :

                [ edittext/command ]
[ library] [ runner ]

is a good solution happy to discuss this with you :)

btw thanks a lot for this merge request <3

Screenshot 2026-02-27 at 22 26 49

Thanks , will push a fix for the changes today, was on a vaction missed the email updates

@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Mar 9, 2026

New commit now adds it adb commander as a dashboard
image

@florent37
Copy link
Copy Markdown
Contributor

thanks :) I'm testing and reviewing when I have time

@florent37
Copy link
Copy Markdown
Contributor

better now :) you can rebase & merge when you want, I approved !

aldefy added 10 commits April 4, 2026 19:56
Adds a new ADB Commander screen to the desktop app with three tabs:
- Runner: execute arbitrary ADB commands with console output
- Library: saved commands, automation flows, and 47 built-in quick commands
- History: timestamped log of all executed commands

Supports automation flows (multi-step ADB command sequences with delays),
works with or without a Flocon-paired device.
Use Room's @relation annotation to eagerly fetch flow steps
instead of issuing a separate getFlowSteps query per flow.
Fetch existing entity before update to retain the original
createdAt value for both saved commands and flows.
Replace mutable side-effect property with a dedicated StateFlow
for more robust and predictable reactive state management.
Use 'in setOf()' for status checks and hoist SimpleDateFormat
to a top-level val to avoid repeated instantiation.
Replace individual callback parameters with a single
onAction: (AdbCommanderAction) -> Unit across all composables.
ViewModel dispatches actions via onAction(action) method.
Move all user-facing strings in ADB Commander views to
strings.xml for localization support.
Replace tab-based layout (Runner/Library/History) with a two-panel
layout matching the Database feature: left panel (340dp) shows command
library as expandable tree, right side shows prominent multi-line
command input with toolbar and always-visible runner output.

- Add CommandLibraryPanel with tree structure for saved commands, flows,
  and quick command categories
- Add CommandInputView with toolbar (save/copy/history/clear) and
  multi-line input field with Cmd+Enter shortcut
- Remove tab system entirely, history moves to toolbar dropdown
- One-click command execution from library panel
@aldefy aldefy force-pushed the feat/adb-commander branch from 892ca59 to 67c5fea Compare April 4, 2026 14:27
@aldefy
Copy link
Copy Markdown
Contributor Author

aldefy commented Apr 4, 2026

Rebased , but guessing need that second review approval to merge

@rteyssandier rteyssandier merged commit fbeccd9 into openflocon:main Apr 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support arbitrary ADB commands

3 participants