2012-09-30 6 views
9

Ich mache Release-Builds durch den Aufruf:PhoneGap, wie ein Release-Build von der Kommandozeile machen

xcodebuild -project HelloWorld -sdk iphoneos5.1 -configuration Release install 

Aber für PhoneGap Apps bekomme ich diesen Fehler:

** BUILD FAILED **

The following build commands failed: CompileC build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.o Phonefinch/Classes/AppDelegate.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Wenn ich versuche:

xcodebuild -project HelloWorld -sdk iphoneos5.1 -configuration Release clean build 

ich:

2012-10-04 22:51:52.776 xcodebuild[20016:4107] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-1559/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:87 Details: Failed to load dependencies output contents from ``/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “AppDelegate.d” couldn’t be opened because there is no such file." UserInfo=0x400eabf40 {NSFilePath=/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.d, NSUnderlyingError=0x40079c140 "The operation couldn’t be completed. No such file or directory"}. User info: { NSFilePath = "/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.d"; NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\""; }. Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *, void (^)(NSString *)) Thread: {name = (null), num = 7} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. ** BUILD FAILED **

The following build commands failed: CompileC build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv7/AppDelegate.o Phonefinch/Classes/AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.o Phonefinch/Classes/AppDelegate.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler (2 failures) 2012-10-04 22:52:04.887 xcodebuild[20016:4f0f] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-1559/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:87 Details: Failed to load dependencies output contents from ``/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/MainViewController.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “MainViewController.d” couldn’t be opened because there is no such file." UserInfo=0x400ef6e40 {NSFilePath=/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/MainViewController.d, NSUnderlyingError=0x400ef24a0 "The operation couldn’t be completed. No such file or directory"}. User info: { NSFilePath = "/Users/camobap-mac/Projects/Phonefinch/build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/MainViewController.d"; NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\""; }. Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *, void (^)(NSString *)) Thread: {name = (null), num = 10} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. ** BUILD FAILED **

The following build commands failed: CompileC build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/AppDelegate.o Phonefinch/Classes/AppDelegate.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC build/Phonefinch.build/Release-iphoneos/Phonefinch.build/Objects-normal/armv6/MainViewController.o Phonefinch/Classes/MainViewController.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler (2 failures)

Wenn ich rufe cordova/debug ->** BUILD SUCCESS **, aber meine .app ist im Debug-Modus kompiliert. Wie kann ich ein Release in der Befehlszeile erstellen?

+0

Können Sie näher auf Ihre Frage ein wenig? Sprechen Sie über die Generierung eines iPA? –

+0

Nein, nur '.app'. Aber ich es möglich, '.ipa' damit zu erzeugen, werde ich auch Interesse haben. – CAMOBAP

+0

Ok. Wenn Ihre App für die Verwendung von Cordova konfiguriert ist, sollte der obige Befehl funktionieren. Was ist das eigentliche Problem, vor dem Sie stehen? –

Antwort

1

Ich habe Lösung gefunden - cordova Dienstprogramm ist ein Schlüssel. Aber wir müssen einige Schritte tun, um es vorzubereiten:

  1. add Skript hooks/after_build/010_sign_ios.js

    #!/usr/bin/env node 
    
    var app_name = "HelloWorld"; 
    var sign_crt_name = "iPhone Distribution: My company Group BV"; 
    var provision_path = "$PWD/Ad_Hock_Distribution_Helloworld.mobileprovision"; 
    
    var output_ipa_path = "$PWD/platforms/ios/build/device/" + app_name + ".ipa"; 
    var sys = require('sys'); 
    var exec = require('child_process').exec; 
    
    var cliCommand = process.env.CORDOVA_CMDLINE; 
    var isRelease = (cliCommand.indexOf('--release') > -1); 
    var isDevice = (cliCommand.indexOf('--device') > -1); 
    var platform = process.env.CORDOVA_PLATFORMS; 
    
    if (platform === 'ios' && isDevice && isRelease) { 
        function puts(error, stdout, stderr) { 
         sys.puts(stdout) 
        } 
    
        exec("xcrun -sdk iphoneos PackageApplication " + 
         "-v \"$PWD/platforms/ios/build/device/" + app_name + ".app\" " + 
         "-o \"" + output_ipa_path + "\" " + 
         "--sign \"" + sign_crt_name + "\" " + 
         "--embed \"" + provision_path + "\"", puts); 
    } 
    

    aber fix app_name, sign_crt_name und provision_path Variablen entsprechend Sie braucht

  2. Run cordova build ios --release --device

  3. Verwenden Sie zu de Livree oder installieren über cmd von great ideviceinstaller tool

-1

Ich konnte von der Befehlszeile aus mithilfe des Parameters CONFIGURATION_BUILD_DIR im Befehl xcodebuild erstellen und ein leeres Buildverzeichnis angeben. Scheint, dass Dateien, die durch XCode-Konflikte mit dem Befehl xcodebuild erstellt wurden

+0

Wenn Sie wirklich Phonegap App erstellen können, bitte Skript zur Verfügung stellen, und ich werde Ihre Antwort akzeptieren – CAMOBAP

3

Ich hatte genau das gleiche Problem. Ich weiß nicht, ob meine Lösung auf Ihr Problem zutrifft. Aber hier ist, wie ich es gelöst habe: Ich nehme an, dass Sie das cordova-Subprojekt aus Ihrem Xcode-Projekt heraus verwenden. Überprüfen Sie, ob Sie den gleichen Konfigurationsnamen für das Cordova-Projekt haben.

Beispiel: Wenn Ihre Release-Konfiguration für Ihr Hauptprojekt "ReleaseAdHoc" heißt, stellen Sie sicher, dass Ihr cordova-Unterprojekt auch eine Konfiguration mit diesem Namen besitzt. Stellen Sie außerdem sicher, dass Sie diese Konfigurationen für den Prozess "Archivieren" sowohl für Ihr Hauptprojekt als auch für das Teilprojekt auswählen.

Hoffe, das hilft.

+0

Danke! Ich fügte meinem Hauptprojekt die "Adhoc" -Konfiguration hinzu und fragte mich, warum es sich über die fehlende 'AppDelegate.d'-Datei beschwert. – szimek

+0

Ich habe keine Konfigurationssätze angegeben und es wird immer noch der gleiche Fehler angezeigt. Irgendwelche Ideen ? – matthisb