@@ -1621,13 +1621,13 @@ ${Object.keys(size)
16211621 * Platform-specific action definitions for Android
16221622 * Single source of truth for both runtime behavior and type definitions
16231623 */
1624- const runAdbShellParamSchema = z
1625- . string ( )
1626- . describe ( 'ADB shell command to execute' ) ;
1624+ const runAdbShellParamSchema = z . object ( {
1625+ command : z . string ( ) . describe ( 'ADB shell command to execute' ) ,
1626+ } ) ;
16271627
1628- const launchParamSchema = z
1629- . string ( )
1630- . describe ( 'App package name or URL or app name to launch,' ) ;
1628+ const launchParamSchema = z . object ( {
1629+ uri : z . string ( ) . describe ( 'App package name or URL or app name to launch' ) ,
1630+ } ) ;
16311631
16321632type RunAdbShellParam = z . infer < typeof runAdbShellParamSchema > ;
16331633type LaunchParam = z . infer < typeof launchParamSchema > ;
@@ -1651,8 +1651,11 @@ const createPlatformActions = (
16511651 interfaceAlias : 'runAdbShell' ,
16521652 paramSchema : runAdbShellParamSchema ,
16531653 call : async ( param ) => {
1654+ if ( ! param . command || param . command . trim ( ) === '' ) {
1655+ throw new Error ( 'RunAdbShell requires a non-empty command parameter' ) ;
1656+ }
16541657 const adb = await device . getAdb ( ) ;
1655- return await adb . shell ( param ) ;
1658+ return await adb . shell ( param . command ) ;
16561659 } ,
16571660 } ) ,
16581661 Launch : defineAction ( {
@@ -1661,7 +1664,10 @@ const createPlatformActions = (
16611664 interfaceAlias : 'launch' ,
16621665 paramSchema : launchParamSchema ,
16631666 call : async ( param ) => {
1664- await device . launch ( param ) ;
1667+ if ( ! param . uri || param . uri . trim ( ) === '' ) {
1668+ throw new Error ( 'Launch requires a non-empty uri parameter' ) ;
1669+ }
1670+ await device . launch ( param . uri ) ;
16651671 } ,
16661672 } ) ,
16671673 AndroidBackButton : defineAction ( {
0 commit comments