コード例 #1
0
def installP12():
    p12Path = getAbspath("p12_path")
    Common.assertExit(os.path.isfile(p12Path), "p12证书文件不存在,请检查配置")

    p12Password = m_jsonObj["p12_password"]
    Common.assertExit(p12Password, "未配置参数p12_password")
    p12Cmd = "security import %s -k /Users/%s/Library/Keychains/login.keychain -P %s -T /usr/bin/codesign" % (
        p12Path, Common.getUserName(), p12Password)
    Common.runCmd(p12Cmd)
コード例 #2
0
def installNotifyProfile():
    tmpPlistPath = getTmpNotifyPlistPath()
    cmd = "security cms -D -i %s > %s" % (m_notifProfilePath, tmpPlistPath)
    Common.runCmd(cmd)

    # 将profile文件拷贝到系统目录
    uuid = findNotifyPlistInfoForKey("UUID")
    targetFile = "/Users/%s/Library/MobileDevice/Provisioning Profiles/%s.mobileprovision" % (
        Common.getUserName(), uuid)
    FileUtils.copyFile(m_notifProfilePath, targetFile)