linux安装p12,用命令行安装mobileprovision和p12证书

linux安装p12,用命令行安装mobileprovision和p12证书我这边使用python来编写的,基本达到了最大化程度的解耦,其他人或者其他地方都可以直接使用。先创建installMobileProfile.py#!/usr/bin/python#-*-coding:UTF-8-*-importsysimportcommandsimportosparamsCount=len(sys.argv)if(paramsCount!=5):prin…

大家好,又见面了,我是你们的朋友全栈君。

我这边使用python来编写的,基本达到了最大化程度的解耦,其他人或者其他地方都可以直接使用。先创建installMobileProfile.py

#!/usr/bin/python

# -*- coding: UTF-8 -*-

import sys

import commands

import os

paramsCount = len(sys.argv)

if (paramsCount != 5):

print “本文件只支持以下的四个参数同时配置,缺一不可”

print “第一个参数:描述文件的路径”

print “第二个参数:p12文件的路径”

print “第三个参数:操作系统用户的密码”

print “第四个参数:p12文件的密码”

exit()

mobileProfilePath=sys.argv[1]

p12filePath = sys.argv[2]

password = sys.argv[3]

cert_Pass = sys.argv[4]

print ‘params is:’ + mobileProfilePath + ‘ p12:’ + p12filePath + ‘ pass:’ + password + ‘ cert_Pass:’ + cert_Pass

shellCommod = “grep UUID -A1 -a ” + mobileProfilePath + “| grep -io ‘[-A-F0-9]\{36\}'”

UUID = commands.getoutput(str(shellCommod))

print “uuid is:” + UUID

homePath = commands.getoutput(“echo ~”)

output=str(homePath+”/Library/MobileDevice/Provisioning Profiles/”+UUID+”.mobileprovision”)

output1=str(homePath+”/Library/MobileDevice/Provisioning\ Profiles/”+UUID+”.mobileprovision”)

print output

if os.path.isfile(output):

print “file is founded”

print “install finished”

else:

print “file not found”

cp_commod = str(“cp ” + mobileProfilePath + ” ” + output1)

print cp_commod

print “copying file from “+mobileProfilePath+” to “+output1

os.system(cp_commod)

print “install finished”

os.system(“ls ~/Library/MobileDevice/Provisioning\ Profiles/”)

#install p12 file

keychain_Path = str(homePath+”/Library/Keychains/login.keychain”)

sh1 = str(“security default-keychain -s ” + keychain_Path)

print “shell1 is:” + sh1

os.system(sh1)

sh2 = str(“security unlock-keychain -p ” + password + ‘ ‘ + keychain_Path)

print “shell2 is:” + sh2

os.system(sh2)

sh3 = str(“security import ” + p12filePath + ” -k ” + keychain_Path + ‘ -P ‘ + cert_Pass)

print “shell3 is:” + sh3

result = commands.getoutput(sh3)

print result

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/151173.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • scrapy环境配置_python的安装环境

    scrapy环境配置_python的安装环境本文仅供学习交流使用,如侵立删!联系方式及demo下载见文末PythonScrapy安装及相关配置环境win10Python:3.6.7Scrapy:2.4.1Python安装Scrapy安装pipinstallscrapy解决Command“pythonsetup.pyegg_info”failedwitherrorcode1问题更新pippipinstall–upgradepip问题:权限不足解决:pip

    2022年9月18日
    0
  • 基于SpringBoot的JWT单点登录

    基于SpringBoot的JWT单点登录单点登录单点登录SSO,分布式架构中通过一次登录,就能访问多个相关的服务。快速入门首先引入Jwt依赖<!–JWT–><dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.4&

    2022年5月11日
    42
  • SpringBoot 单元测试指定运行环境「建议收藏」

    分享知识传递快乐1、通过修改配置文件指定运行环境在配置文件中直接指定运行环境spring:profiles:active:dev这种配置方式是全局的。2、通过启动类配置指定运行环境-Dspring.profiles.active=prod这种配置需要对每个测试方法都得去一一指定,可对同个测试类不同测试方法配置不同运行环境。配置方法:首先Run->EditConfigurations打开如下页面依次按照步骤操作并配置…

    2022年4月13日
    38
  • 计算机组成原理总结及知识网图「建议收藏」

    计算机组成原理总结及知识网图「建议收藏」计算机组成原理知识摘要,个人复习整理,仅供参考

    2022年6月1日
    39
  • MySQL 1045登录失败

    MySQL 1045登录失败当你登录MySQL数据库出现:Error1045错误时(如下图),就表明你输入的用户名或密码错误被拒绝访问了,最简单的解决方法就是将MySQL数据库卸载然后重装,但这样的缺点就是就以前的数据库中的信息将丢失,如果你不想重装,那么就需要找回密码或者重置密码。解决的方法应该有多种,这里我推荐大家使用一种原理通过,操作简单的方法,适用于windows以及linux平台。 MySQL1045错误如

    2022年6月9日
    31
  • UITableView是不会响应touchesBegan:方法的

    UITableView是不会响应touchesBegan:方法的2019独角兽企业重金招聘Python工程师标准>>>…

    2022年7月25日
    11

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号