use droidrun_adb::AdbServer;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let server = AdbServer::default();
let device = server.device().await?;
println!("Device: {}", device.serial);
println!("\nPressing Home...");
device.keyevent(3).await?;
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
println!("Tapping at (540, 1200)...");
device.tap(540, 1200).await?;
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
println!("Swiping up...");
device.swipe(540, 1600, 540, 400, 300).await?;
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
println!("Swiping down...");
device.swipe(540, 400, 540, 1600, 300).await?;
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
println!("Typing text via shell...");
device.shell("input text 'hello'").await?;
println!("Going home...");
device.keyevent(3).await?;
println!("\nDone!");
Ok(())
}