1

Using the CLI is there any method to deploy/install an app to an android (or ios) device without the app auto launching? I need to test a scenario where a user deploys an app to the phone (say, via app store) but doesn't launch/open the app from the store (they just close store and go back to device....and first-run app another time)

Something like: cordova run android --target=x1233455 --no-run

I have tried:

cordova build android --device=x1233455
cordova build android --target=x1233455

I found a method via Xcode for iOS but haven't been able to find something for native cordova (or Ionic). It worked perfect for my testing. If a method is not available for cordova cli (for android), then is there a method to do this in Android Studio?

rolinger
  • 2,787
  • 1
  • 31
  • 53
  • 1
    Look at the `adb` command, [How to install an apk in one of the connected devices through adb?](https://stackoverflow.com/a/29339275/295004) – Morrison Chang Sep 23 '20 at 06:05
  • heh, that simple. `adb install app.apk` - installs without running - well, so I have read. I never really used `adb` for other than managing connected devices - always used `ionic/corodva run/build` commands. Going to be testing here shortly. Thanks. – rolinger Sep 23 '20 at 12:34

1 Answers1

1

For anyone else that might need the solution to this (credit to: @MorrisonChang ):

adb -s <DEVICE ID> install <PATH TO APK>

rolinger
  • 2,787
  • 1
  • 31
  • 53