Skip to main content

Crate droidrun_core

Crate droidrun_core 

Source
Expand description

§droidrun-core

Android device automation core library.

Provides device drivers, Portal APK management, and UI state processing for controlling Android devices programmatically.

§Usage

use droidrun_core::driver::android::AndroidDriver;
use droidrun_core::driver::DeviceDriver;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut driver = AndroidDriver::new(None, true);
    driver.connect().await?;

    // Take screenshot
    let png = driver.screenshot(true).await?;
    std::fs::write("screen.png", &png)?;

    // Tap
    driver.tap(540, 1200).await?;

    // Type text
    driver.input_text("hello", false).await?;

    Ok(())
}

Re-exports§

pub use driver::android::AndroidDriver;
pub use driver::recording::RecordingDriver;
pub use driver::Action;
pub use driver::AppInfo;
pub use driver::DeviceDriver;
pub use driver::Point;
pub use error::DroidrunError;
pub use error::Result;
pub use portal::client::PortalClient;
pub use portal::manager::PortalManager;
pub use ui::filter::ConciseFilter;
pub use ui::filter::TreeFilter;
pub use ui::formatter::IndexedFormatter;
pub use ui::formatter::TreeFormatter;
pub use ui::provider::AndroidStateProvider;
pub use ui::state::Element;
pub use ui::state::PhoneState;
pub use ui::state::ScreenDimensions;
pub use ui::state::UIState;

Modules§

driver
Device driver trait and implementations.
error
helpers
portal
DroidRun Portal APK communication and lifecycle management.
ui
UI state processing — element resolution, filtering, formatting.