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)
上一篇 2022年6月22日 下午1:36
下一篇 2022年6月22日 下午1:36


相关推荐

  • 360自动拦截的防护怎么修改_微信屏蔽投诉按钮代码

    360自动拦截的防护怎么修改_微信屏蔽投诉按钮代码个人有各自不同的编写方法。不必拘泥一格。只要了解原理是访问首页,运行js文件,在JS文件里面调用一个文件,显示网站。JS的写法有很多,比如还有下面的写法:document.write(unescape(unescape(unescape(unescape(unescape(‘%252525253Cframeset%2525252520rows%252525253D%2525252522*%

    2025年6月9日
    5
  • 路飞学城的python课程怎么样_路飞学城系列:Python就业班课程入学须知整理

    路飞学城的python课程怎么样_路飞学城系列:Python就业班课程入学须知整理学习周期 2020 8 1 起 2020 8 2 日整理 1 专业视频有效期 2 年 2 导师服务有效期 6 个月 3 路飞学城相关消息 路飞学城 微信公众号 包括系统通知 作业批改通知等 30 天内未回复导致或班主任消息 视为主动放弃所有服务 视频课程除外 学习方式 在线学习 课堂笔记网址 在线电子书 book luffycity com python book index html 账号 l

    2026年3月19日
    2
  • N8n Merge 节点详解

    N8n Merge 节点详解

    2026年3月15日
    2
  • mac版idea2021.5激活码[在线序列号]

    mac版idea2021.5激活码[在线序列号],https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月18日
    48
  • es6箭头函数详解_es6的新特性

    es6箭头函数详解_es6的新特性ES6标准新增了一种新的函数:ArrowFunction(箭头函数)。基础语法通常函数的定义方法varfn1=function(a,b){returna+b}functionfn2(a,b){returna+b}使用ES6箭头函数语法定义函数,将原函数的“function”关键字和函数名都删掉,并使用“=>”连接参数…

    2022年4月19日
    38
  • PHP正则表达式总结

    PHP正则表达式总结一 正则表达式常用符号简介 1 字符匹配符符号描述实例 s 匹配任何空白字符 包括空格 制表符 换页符等等 S 匹配任何非空白字符 d 匹配一个数字字符 等价于 0 9 d 匹配一个数字字符 等价于 0 9 D 匹配一个非数字字符 等价于 0 9

    2026年3月19日
    2

发表回复

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

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