CI/CD build workflow

All of the documentation and samples I’ve seen so far describe a development workflow that ends with either ‘npx cap open ios’ or ‘npx cap open android’ which opens the respective platform IDEs to perform a native build manually.

For our continuous integration/deployment workflows we need to build on the command line and currently, with ionic/cordova in a Jenkins pipeline, we run something like:

ionic cordova build android --prod --release

to do this. Cordova hides all the platform specific build commands under the covers.

Are there any plans to support commands like:

'npx cap build ios'
'npx cap build andoid'

in the future, or do we need to learn how to execute Xcode and Android Studio on the command line?

Thanks.
Glenn.

2 Likes

ALthough this doesn’t directly answer your question, I would highly encourage you to checkout Fastlane. Once capacitor finishes updating the iOS/ Android projects, Fastlane can easily take over packaging/ deployments.

Fastlane does look interesting. Reading the docs now. Thanks.

The lack of reply here gives me the answer. I notice a Twitter thread from @maxlynch discussing it and basically saying that we need to learn the underlying IDEs. I get it. But it turns me off Capacitor at this stage.

Ionic/Cordova has been my platform of choice for a number of years now and has served very well. One of the greatest benefits has been that I have not had to learn the underlying native platforms or IDEs. I’ve had to find (not write) the odd hook script to get things going and wait for Cordova to release updates, but I’ve never had to open the IDEs.

Sure, I could learn them and would probably benefit from learning them, but I’ve been able to spend my time elsewhere when using Cordova.

Of course, I’m just pushing against learning something new. I’ll get over it and eventually find the time to do it. But right now I have to build apps quickly and the new learning curve will be a pain.

The Capacitor team could help with this (and this relates to @maxlynch’s Twitter comment on what could be better documented):

  • Provide introductory instructions on how to build with Xcode and Android Studio command line tools. This would smooth the transition for our automated build servers and for package.json scripts.
  • Extend the documentation on what to do in each IDE to get a build compiled and running (including debugging). Just the basics to get started.

Both of these would give us less of a hurdle to transition existing projects and processes into Capacitor and introduce us to the tools that we are not familiar with.

Glenn.