Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap IOS Signing with build.json

I originally was using Phonegap build service to create my "debug" apps which requires a .p12 file and a provisioning file but now that they are almost ready for production I'm using a script combined with hooks to build my "release" apps locally using Phonegap cli 6.4

phonegap build --release --buildConfig build.json

I'm encountering this error in the command line

Error: Error code 65 for command: xcodebuild with args: 
-xcconfig,/Users/cuesta/workspace/mobile/platforms/ios/cordova/build-release.xcconfig,-workspace,myappname.xcworkspace,-scheme,myappname,-configuration,Release,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/cuesta/workspace/mobile/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/cuesta/workspace/mobile/platforms/ios/build/sharedpch

After this command failed

CompileAssetCatalog build/emulator/myappname.app myappanem/Images.xcassets

My guess is that I have my build.json config wrong for IOS build. So my questions are:

-- Where do I find the "codeSignIdentity" or please explain the following.

Code signing identity to use for signing. It can be created with Xcode and added to your keychain. https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

-- Is development team where I put the "teamId"?

-- Is it possible that my "teamId" was generated exactly the same as my app id prefix?

I do have a prod certificate(exported to .p12) and prod provisining file ready. (Template Below)

"ios": {
    "debug": {
        "codeSignIdentity": "iPhone Development",
        "provisioningProfile": "confirmedcorrect",
        "developmentTeam": "10or12",
        "packageType": "development"
    },
    "release": {
        "codeSignIdentity": "iPhone Distribution",
        "provisioningProfile": "confirmedcoorect",
        "developmentTeam": "10or12",
        "packageType": "app-store"
    }
}
like image 984
Daniel Cuesta Avatar asked Dec 20 '16 18:12

Daniel Cuesta


1 Answers

So many questions that I'm not sure about what to answer, so let's try answering one by one...

Where do I find the "codeSignIdentity"?.

Do you mean something like?

security find-identity -v -p codesigning

It will return all codesigning identities.

Is development team where I put the "teamId"?

Yes. If you're unsure about the ID, check https://developer.apple.com/account/#/membership

Is it possible that my "teamId" was generated exactly the same as my app id prefix?

Yes.

Note that in the latest (dev) revision of the documentation the information build.json information has changed. The new format looks like:

{
    "ios": {
        "debug": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "FG35JLLMXX4A",
            "packageType": "development",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ]
        },
        "release": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "FG35JLLMXX4A",
            "packageType": "app-store",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ]
        }
    }
}

I'm not sure if this answers all your questions, but at least it should clear a few.

like image 191
CWBudde Avatar answered Sep 19 '22 12:09

CWBudde