def buildTarget(): archivePath = getArchivePath() profileUUID = Common.getCmdResult( "/usr/libexec/PlistBuddy -c 'Print UUID' " + getTmpPlistPath()) p12Path = getAbspath("p12_path") p12Password = m_jsonObj["p12_password"] f = open(p12Path, 'rb') p12 = load_pkcs12(f.read(), p12Password) sign_key = p12.get_friendlyname() team_id = p12.get_certificate().get_subject().OU f.close() buildParams = ' '.join([ '-project', '%s.xcodeproj' % m_newProjName, '-scheme', m_newSchemeName, '-configuration', 'Release', '-archivePath', archivePath, 'archive', 'build', 'CODE_SIGN_IDENTITY="%s"' % sign_key, 'PROVISIONING_PROFILE="%s"' % profileUUID, 'PRODUCT_BUNDLE_IDENTIFIER="%s"' % m_newBundleId, 'CODE_SIGN_STYLE="Manual"', 'DEVELOPMENT_TEAM="%s"' % team_id ]) cmd = 'cd %s/..;xcodebuild %s' % (m_projectDir, buildParams) Common.runCmd(cmd)
def findPlistInfoForKey(key): tmpPlistPath = getTmpPlistPath() cmd = "/usr/libexec/PlistBuddy -c 'Print %s' %s" % (key, tmpPlistPath) result = Common.getCmdResult(cmd) Common.assertExit( result.find(key) == -1, "查找字段不存在:key=" + key + "(苹果对证书信息做了修改,请查看桌面/Package/tmp.plist数据格式)") return result
def buildTarget(): archivePath = getArchivePath() profileUUID = Common.getCmdResult( "/usr/libexec/PlistBuddy -c 'Print UUID' " + getTmpPlistPath()) notifyProfileUUID = Common.getCmdResult( "/usr/libexec/PlistBuddy -c 'Print UUID' " + getTmpNotifyPlistPath()) print 'notifyProfile uuid==%s m_newNotifyBundleId==%s' % ( notifyProfileUUID, m_newNotifyBundleId) p12Path = getAbspath("p12_path") p12Password = m_jsonObj["p12_password"] f = open(p12Path, 'rb') p12 = load_pkcs12(f.read(), p12Password) sign_key = p12.get_friendlyname() team_id = p12.get_certificate().get_subject().OU f.close() buildParams = ' '.join([ '-project', '%s.xcodeproj' % m_newProjName, '-scheme', m_newSchemeName, '-configuration', 'Release', '-archivePath', archivePath, 'archive', 'build', 'CODE_SIGN_IDENTITY="%s"' % sign_key, 'APP_PROVISIONING_PROFILE="%s"' % profileUUID, 'APP_BUNDLE_IDENTIFIER="%s"' % m_newBundleId, 'EXTENSION_PROFILE="%s"' % notifyProfileUUID, 'EXTENSION_BUNDLE_IDENTIFIER="%s"' % m_newNotifyBundleId, 'CODE_SIGN_STYLE="Manual"', 'DEVELOPMENT_TEAM="%s"' % team_id ]) # 添加顶象加固 if m_isNoDingXiang != "1": buildParams += " DX_FLAGS=-steec-extra-opts=-xse=100,-fla=50,-spli=50" buildParams += " -toolchain dx-vm.lite" else: buildParams += ' DX_FLAGS=""' cmd = 'cd %s;xcodebuild %s' % (m_projectDir, buildParams) Common.runCmd(cmd)