Package applications via CLI


#1

Hi,

I’m currenlty trying to package an application and realize that there is no easy way to package an application via the Ionic CLI, or maybe there is one that I don’t know.

Ionic CLI allows us to generate the Xcode project via the ionic build command but we cannot package with it.
I know that Ionic CLI executes behind the scene the cordova CLI.

Is there any reason, limitation that could explain why Ionic CLI doesn’t have a “package” option (running xcrun in case of iOS for example)?

Doing it via a gulp task can be done but then it then won’t be part of the Ionic build workflow I guess.

Thanks!


#2

What do you mean by “package” an app? ionic build creates a package as far as I know.


#3

If you mean create an .ipa have a look at http://stackoverflow.com/questions/24061063/how-can-i-deploy-create-ipa-iphone-app-using-cordova-build-ios-release

For Android, the build command generates an APK that is a package. For iOS, it generates an app folder. I guess Cordova doesn’t create an IPA archive because it’s not needed to run the app for development, and for distribution you need a provisioning profile.


#4

My concern is to know why the Ionic CLI doesn’t have a command to execute, in the case of iOS, the xcrun command?

This command could take as a parameter the path to the provisioning profile (or having it by default at the root).

Isn’t this doable?


#5

AFAIK the Ionic CLI just delegates to the Cordova CLI for everything build-related, so it’s probably more of a question for the Cordova project.

Consider that iOS is just one of the supported platforms, so any commands supported by the CLI would need to make sense for all platforms.


#6

Yes you’re right, they are using the cordova CLI. My question was is there any reason why Ionic (or Cordova) doesn’t have a simple command for this?

Maybe the reason why is that as you said, this command couldn’t be for all platform.

I know that there is some kind of tutorial for building a release apk, maybe the same for iOS culd be helpful.


#7

Hey guys. So yeah having a build command that goes out and gives you a signed ipa file is on our list of things to do. There are some bugs in the command line tools that make this a bit of a pain.

http://cutting.io/posts/packaging-ios-apps-from-the-command-line/

But this should get you in the right direction if you’re looking to setup automated builds/signings


#8

Hi @mhartington,

Your link helped me a lot! I was able to generate my ipa file :smile:

After updating the PackageApplication source (your link above), I run the commande ionic build ios --device and then the xcrun command.
Without the --device argument I was giving the error code object is not signed at all.

Hope it will help others