@@ -33,14 +33,20 @@ pub struct DeviceArgs {
3333pub async fn execute ( args : DeviceArgs ) -> anyhow:: Result < ( ) > {
3434 let device = if let Some ( udid) = args. udid {
3535 get_device_for_id ( & udid) . await ?
36- } else if cfg ! ( all( target_os = "macos" , target_arch = "aarch64" ) ) && args. mac {
37- Device {
38- name : "My Mac" . to_string ( ) ,
39- udid : String :: new ( ) ,
40- device_id : 0 ,
41- usbmuxd_device : None ,
42- }
4336 } else {
37+ #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
38+ if args. mac {
39+ Device {
40+ name : "My Mac" . to_string ( ) ,
41+ udid : String :: new ( ) ,
42+ device_id : 0 ,
43+ usbmuxd_device : None ,
44+ }
45+ } else {
46+ devices ( ) . await ?
47+ }
48+
49+ #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
4450 devices ( ) . await ?
4551 } ;
4652
@@ -52,25 +58,10 @@ pub async fn execute(args: DeviceArgs) -> anyhow::Result<()> {
5258 return Ok ( ( ) )
5359 }
5460
55- #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
56- {
57- log:: info!( "Installing app at {:?} to device {}" , app_path, device. name) ;
58- device. install_app ( & app_path, |progress| async move {
61+ log:: info!( "Installing app at {:?} to device {}" , app_path, device. name) ;
62+ device. install_app ( & app_path, |progress| async move {
5963 log:: info!( "{}" , progress) ;
60- } ) . await ?;
61- return Ok ( ( ) )
62- }
63-
64- #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
65- if !args. mac {
66- log:: info!( "Installing app at {:?} to device {}" , app_path, device. name) ;
67- device. install_app ( & app_path, |progress| async move {
68- log:: info!( "{}" , progress) ;
69- } ) . await ?;
70- return Ok ( ( ) )
71- }
72-
73- return Ok ( ( ) )
64+ } ) . await ?;
7465 }
7566
7667 if args. pairing {
0 commit comments