-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use clap::Parser; | ||
use anyhow::{Result, bail, anyhow}; | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct Launch {} | ||
|
||
pub fn handle(_args: Launch) -> Result<()> { | ||
// Fetch and deserialize .android | ||
let dot_android = android_cli::get_dot_android() | ||
.ok_or_else(|| anyhow!(".android not found, can't launch activity"))?; | ||
|
||
// Try to launch MainActivity using ADB | ||
let launch_status = | ||
android_cli::launch_activity(dot_android.package_id, dot_android.main_activity_name)?; | ||
|
||
if !launch_status.success() { | ||
bail!("failed to launch activity"); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ pub mod build; | |
pub mod create; | ||
pub mod install; | ||
pub mod run; | ||
pub mod launch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters