skip to Main Content

In switching from Cordova to Capacitor we seem to have lost the ability to deploy our app to physical devices using the command line. This is helpful so that our automated build process can push it out to a set of devices we have connected to the server. All the docs for deploying with Capacitor say to open Xcode and select a device for deployment. I’m trying with instruments to get the device ID and then xcodebuild to install it

instruments -s devices | grep -v Simulator | grep -e iPhone -e iPad 
xcodebuild install -workspace ios/App/App.xcworkspace -scheme App -destination 'platform=iOS,id=76a....781'

And even though this ends with ** install succeeded ** the app has not been installed on the device

2

Answers


  1. Chosen as BEST ANSWER

    If waiting for Capacitor 3 is not an option these three lines work

    xcodebuild -workspace ios/App/App.xcworkspace/ -scheme App -archivePath ./ios/App.xcarchive archive

    xcodebuild -exportArchive -archivePath ./ios/App.xcarchive -exportOptionsPlist ./ios/App/export-development.plist -exportPath ./iOS

    ios-deploy --debug --bundle ios/App.ipa


  2. You can consider bumping your Capacitor version to v3.0.0 rc3.. The team is building upon a new command to run the app on device without opening the native ide.

    npx cap run ios

    Source Discussion Capacitor v3

    Alternative – Use Ionic Appflow for deployments.

    For Appflow builds on the cloud.. You can do two things there..

    • Live Deploy – if you have just made any changes to the code, the js, HTML, css side, then use LiveDeploy, this will be much faster for deploying to all the app users.
    • Native Builds – incase you have added any new plugin or made native configuration changes, then make a native build that can deploy it to test flight and then your tester’s can download the updated version from there..

    You can also set auto triggers for these workflows as well when you commit your code to the repository.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search