简体   繁体   中英

Code Signing with Xcode & Cocoa pods

I have a added pods to my project. Currently i have added 2 pods. So there are three targets in Pods.xcodeproj.

And my podfile looks like this

platform :ios, "8.0"
use_frameworks!

target 'ARSConsumerMaster-Sample1' do

pod 'ObjectMapper', '~> 0.19'
pod 'JSONModel', '~> 1.2.0'

end

target 'ARSConsumerMasterTests' do
end

target 'ARSConsumer-Sample2' do
end

I have found this snippet. But not sure where to write these

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
            config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
            config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        end
    end
end

Even if i use this and say not to codesign in build settings, i get an error that codesigning is mandated in the latest versions.

Should i create separate provisioning profile/ Bundle identifier for my pods project? How should i code sign?

This solved the issue

Create ExportPlist.plist with TeamId and export archive with the same

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"   "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>teamID</key>
        <string>xxxxxxxxx</string>
        <key>method</key>
        <string>app-store</string>
        <key>uploadSymbols</key>
        <true/>
    </dict>
</plist>

xcodebuild -exportArchive \
           -archivePath ${WORKING_DIRECTORY}/Archive/${APP_NAME}.xcarchive 
           -exportOptionsPlist exportPlist.plist

I have added this snippet to the PodFile. I am able to build successfully with the App Store provisioning profile and cert. However deployment fails with error

"Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'XXXXXXXXXX.com.company.appcenter' for key 'application-identifier' in 'Payload/app/Frameworks/Alamofire.framework/Alamofire' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier.”

XXXXXXXXXX being the prefix for registered appid

If you are using distribution certificate to create your build, set the code signing of pods also to iOS distribution -> Automatic.

If you are using development certificate to create your build, set the code signing of pods also to iOS development -> Automatic.

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