How can I compile Ionic with CLI and build with XCode?

Hello! How can I compile typescript code with Ionic-Cli and then build/run app with XCode? Now I do ionic cordova build ios where ionic compile code and build app and then app built again with Xcode when I run it on device.

I don’t want to run app on device with ionic cordova run ios because I have some problems with this process.

platforms/ios/<name>.xcworkspace

what is it? I know how to build/run with XCode. I don’t know how to skip build step with ionic cli. I want just compile typescript code and prepare project with ionic-cli to build then with XCode.

Ohh, sorry. I don’t think you can skip that with the ionic cordova build ios command, what’s the problem with it though? The Xcode part of the build is the fast part :wink:

If anything, you can look through ionic cordova build --help and see if there’s anything about it.

You can add a shell script as a “before_compile”-hook, which simply returns false and so breaks the ionic build process before compiling the iOS app. Just create a file containing

#!/bin/bash
false

and add

<hook src="path/to/hookfile" type="before_compile" />

to the section <platform name="ios"> in your config.xml.
If you call ionic cordova build ios now, the build process will stop before the native iOS app is compiled and you can start compiling/running the app manually from XCode.

2 Likes

Hm, there should probably be a more elegant solution than that by using the CLI… Could someone of you please create an issue? What you want is that the build process runs and also the result is copied over to the platforms directory, but the cordova build is not run.

Yes. Now I am waiting ionic compile step, cordova build step (long time) then Xcode build/run step. Not so useful.

I can’t using ionic corodva run ios --device because sometimes app freeze on startup and I need to detach iPad and attach again to Mac.

Added issue: https://github.com/ionic-team/ionic-cli/issues/2558 If something wrong or need more info tell me I will try to correct this.

1 Like