简体   繁体   中英

Xcodebuild stops with cordova ios project

I'm trying to build and archive (in Release and Debug mode) an ios project generated with apache cordova 4.0.0, via command line tool xcodebuild

These commands work ok:

cordova platform add ios

cordova prepare ios

cordova build ios

The ios project generated by cordova has a scheme called iHogar. After that, when I try to launch this command on the console:

xcodebuild -scheme iHogar -sdk iphoneos -configuration Debug CODE_SIGN_IDENTITY="iPhone Distribution: SNA LCA, S- CO-P-Ñ-A DE SE-UO- Y R--AEU-OS (xxxxxxx)"

It stops at the beginning of the execution, and does not continue. The value of param CODE_SIGN_IDENTITY is modified due to privacy reasons.

Here is the output of the command, through console:

Build settings from command line: CODE_SIGN_IDENTITY = iPhone Distribution: SNA LCA, S- CO-P-Ñ-A DE SE-UO- Y R--AEU-OS (xxxxxxx) SDKROOT = iphoneos8.1

And stops there without finishing the command (it hangs) , only stops with crtl+C

The certificate is ok, and also the provisioning profile. If I open the project with Xcode (version 6.1) everything goes ok, I can build and archive it without problems, with the same certificate and provisioning profile.

Has anyone experienced this behavior?

Thanks in advance

I have resolved this issue. The problem was that the cordova generated ios project hasn't got schemas. Those are created the first time you open the project with XCode. When the app has been created by cordova, is only created with targets.

In this scenario, that the generated app cannot be opened with XCode with human interaction, is better to build the app with the target option, like this:

xcodebuild -xcconfig "cordova/build.xcconfig" -project "iHogar.xcodeproj" ARCHS="armv7 armv7" -target "iHogar" -configuration Debug -sdk iphoneos build VALID_ARCHS="armv7 armv7s" CONFIGURATION_BUILD_DIR="build/device"

It's important to have the certificate to sign the app installed in the keychain, and the related provisioning profile downloaded.

I know you got around your issue, but as this is quite recent, have you considered upgrading to Cordova 5.1.1. This will build and code sign the app without the need to go into XCode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM