Raghav
Raghav

Reputation: 655

Build cordova project using xcodebuild command

I m working on custom plugin for Jenkins to build iOS project using command line. The native project able to build using xcodebuild command where as the hybrid (cordova) project when I build getting build failure.

Shell script:

xcodebuild -project app.xcodeproj -alltargets

The error I m getting is

app/Classes/AppDelegate.h:30:9: fatal error: 
      'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>

Same for other class files as well.

The folder structure is as below.

App
- CordovaLib  
   -CordovaLib.xcodeproj
- Cordova
   -build 
   -run
- App.xcodeproj

Help appreciated

Upvotes: 2

Views: 1575

Answers (2)

Peter
Peter

Reputation: 26

Use -scheme instead of -target or -alltargets:

xcodebuild \
    -scheme ${projectname} \
    -project ${projectname}.xcodeproj \
    -configuration Release \
    -sdk iphoneos \
    build \
    CODE_SIGN_IDENTITY="${CODE_SIGN_IDENTITY}" \
    PROVISIONING_PROFILE="${PROVISIONING_PROFILE}" \
    OBJROOT=${AngejiaBuildPath} \
    SYMROOT=${AngejiaBuildPath}

Upvotes: 1

s5v
s5v

Reputation: 505

xcodebuild -scheme myProject -configuration "config" -project app.xcodeproj -alltargets could do the trick... i find that not providing the schema or configuration causes problems with xcodebuild...

Upvotes: 2

Related Questions