1
votes

I find an error when run 'ionic cordova build ios --prod' in Ionic 3, I try to look for many examples but fail all, this is my error :

[17:07:17] lint finished in 9.50 s ✖ Running command - failed! [ERROR] An error occurred while running cordova build ios (exit code 1):

CordovaError: Promise rejected with non-error: 'xcode-select: error: tool \'xcodebuild\' requires Xcode, but active developer directory \'/Library/Developer/CommandLineTools\' is a command line tools instance\n' at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15) at at process._tickCallback (internal/process/next_tick.js:188:7)

This is my ionic info :

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 8.1.2 ([email protected]) 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.3.0 browser 5.0.3 ios 5.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.9.1
    npm  : 5.5.1 
    OS   : macOS High Sierra

Please, anyone, help me to solve this problem. . .

Thanks

1
Did you install Xcode command-line tools? xcode-select --installSimon L. Brazell

1 Answers

0
votes

You should check this stackoverflow answer to fix problem with XCode

For PROD / AppStore build you can also use this full example to build your app with proper provisioning profile and dev team:

ionic cordova build ios --device --prod --release -- --developmentTeam="XXXXXXXXXX"
--codeSignIdentity="iPhone Distribution"
--provisioningProfile="XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
--packageType="app-store"
--buildFlag="-UseModernBuildSystem=0"
--verbose