惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 宝玉

如何训练你自己的大型语言模型 设计系统(Design System),设计和开发之间的“DevOps” 如何写好绩效考核中的年终总结? 从技术高手转型做技术管理,不敢放手把事情给别人做怎么办? 从两周发布上线到一周发布上线,如何做到高效稳定? 项目一再跳票?试试这一招:用Deadline倒逼生产力 如何对Code Review的评论进行分级 Code Review最佳实践 - 宝玉 你的大学会有模拟面试吗?一些常见面试问题背后的逻辑是什么? 从软件工程的角度解读任正非的新年公开信 记在美国的一次校园招聘 为什么软件工程教科书上的内容和现实的软件项目之间存在着一定差异? - 宝玉 - 博客园 有关技术分享 程序员也可以懂一点期望值管理 Make it run, make it right, make it fast 南通大学《构建之法》课程助教总结 如何高效的学习掌握新技术 Nodejs开源项目推荐 AzureDirectory Library for Lucene.Net(续)
iOS客户端的在线安装和更新——针对ADHoc证书
宝玉 · 2013-07-11 · via 博客园 - 宝玉

这篇文章纯给自己留个备份,所以对AdHoc证书内部分发和对iOS客户端开发不了解的请直接无视。

一般在iOS游戏或应用开发过程中,正式发布到App Store之前,都需要内部的测试,客户端的安装是个不大不小的问题。苹果提供了AdHoc的证书(普通版可以装100台设备,企业版无限),登记设备号的即可通过iTunes或者无线网络安装使用AdHoc证书的App。具体不多赘述。

参考资料:
http://www.alexcurylo.com/blog/2010/08/27/wireless-ad-hoc-distribution/
http://www.hanchorllc.com/2010/08/24/introducing-ios-beta-builder/

之前有用过一款产品叫HockeyApp(http://hockeyapp.net/),帮助实现内部的分发和安装,支持在线安装、检测更新,非常方便,简单分析了一下其原理:

1. 服务端提供API供客户端获取最近版本信息,参考如下: 

[

    {

        "timestamp": 1349965666,

        "shortversion": "4.2.1",

        "mandatory": false,

        "appsize": 115812817,

        "title": "Metal Nation",

        "version": "4.2.1.12101102",

        "notes": "修复BUG"

    },

    {

        "timestamp": 1349788437,

        "shortversion": "4.2.0",

        "mandatory": false,

        "appsize": 115866480,

        "title": "Metal Nation",

        "version": "4.2.0.12100902",

        "notes": "修复BUG"

    },

    {

        "timestamp": 1349704154,

        "shortversion": "4.2.0",

        "mandatory": false,

        "appsize": 115866530,

        "title": "Metal Nation",

        "version": "4.2.0.12100801",

        "notes": "<p>解决无法访问的问题。</p>"

    },

    {

        "timestamp": 1348125250,

        "shortversion": "4.1.0",

        "mandatory": true,

        "appsize": 133946599,

        "title": "Metal Nation",

        "version": "4.1.0.12092001",

        "notes": "<p>新版本更新主要内容:建造建筑变更为分阶层进行</p>"

    },

    {

        "timestamp": 1345717028,

        "shortversion": "3.9.4",

        "mandatory": false,

        "appsize": 90793414,

        "title": "Metal Nation",

        "version": "3.9.4.12082301",

        "notes": "<p>3.9.4更新内容细节</p>"

    },

    {

        "timestamp": 1345115309,

        "shortversion": "3.9.3",

        "mandatory": false,

        "appsize": 69261482,

        "title": "Metal Nation",

        "version": "3.9.3.12081601",

        "notes": "<p>本次更新主要内容</p>"

    },

    {

        "timestamp": 1344597742,

        "shortversion": "3.9.2",

        "mandatory": false,

        "appsize": 67664284,

        "title": "Metal Nation",

        "version": "3.9.2.12081002",

        "notes": "<p>PA3.9.2更新说明</p>"

    },

    {

        "timestamp": 1344332672,

        "shortversion": "3.9.1",

        "mandatory": false,

        "appsize": 66645470,

        "title": "Metal Nation",

        "version": "3.9.1.12080701",

        "notes": "<p>主要改进的数值</p>"

    },

    {

        "timestamp": 1343992275,

        "shortversion": "3.9.1",

        "mandatory": false,

        "appsize": 66622883,

        "title": "Metal Nation",

        "version": "3.9.1.12080302",

        "notes": "<p>本次更新主要内容</p>"

    },

    {

        "timestamp": 1343992251,

        "shortversion": "3.9.1",

        "mandatory": false,

        "appsize": 66622828,

        "title": "Metal Nation",

        "version": "3.9.1.12080301",

        "notes": ""

    },

    {

        "timestamp": 1343813073,

        "shortversion": "3.9.1",

        "mandatory": false,

        "appsize": 66602801,

        "title": "Metal Nation",

        "version": "3.9.1.12080101",

        "notes": ""

    },

    {

        "timestamp": 1343727905,

        "shortversion": "3.9.1",

        "mandatory": false,

        "appsize": 66560890,

        "title": "Metal Nation",

        "version": "3.9.1.12073101",

        "notes": ""

    }

]

2. 客户端根据版本列表判断是不是最新版本,和是不是要强制更新,如果需要更新,可以类似与HockeyAPP内嵌一个网页显示版本信息,点击更新按钮后,访问服务端的下载更新包的API。

网页更新链接代码如下:

<a href="itms-services://?action=download-manifest&url=https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=plist&udid=d2134514a9c016fbd016a0815f1b3f41d9f38c82">Tap Here to Update</a>

3. 服务端提供下载更新包的API,传入用户设备号和请求的版本号参数,返回一个manifest.plist文件,本质是一个XML,包含更新包描述信息,参考如下:

https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=plist&udid=d2134514a9c016fbd016a0815f1b3f41d9f38c82

<?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>items</key> 

<array> 

<dict> 

<key>assets</key> 

<array> 

<dict> 

<key>kind</key> 

<string>software-package</string> 

<key>url</key> 

<string>https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=ipa&amp;udid=d2134514a9c016fbd016a0815f1b3f41d9f38c82</string> 

</dict> 

<dict> 

<key>kind</key> 

<string>display-image</string> 

<key>needs-shine</key> 

<false /> 

<key>url</key> 

<string>https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=png&amp;udid=d2134514a9c016fbd016a0815f1b3f41d9f38c82</string> 

</dict> 

</array> 

<key>metadata</key> 

<dict> 

<key>bundle-identifier</key> 

<string>com.idfsoft.idfCity</string> 

<key>bundle-version</key> 

<string>4.2.1.12101102</string> 

<key>subtitle</key> 

<string>4.2.1 (4.2.1.12101102)</string> 

<key>title</key> 

<string>Metal Nation</string> 

<key>kind</key> 

<string>software</string> 

</dict> 

</dict> 

</array> 

</dict> 

</plist>

其中software-package对应的Url为ipa文件下载地址,其中display-image对应的Url为App的图标图片URL

5. 后台管理中,需要增加页面让用户可以上传最新的ipa文件和输入版本更新信息,其中ipa文件的解析逻辑如下:

  • 将ipa文件作为zip文件解压缩
  • 解压后,读取根目录下的Info.plist文件,是一个XML格式文件
  • 读取CFBundleShortVersionString节点,或得版本号简写
  • 读取CFBundleVersion获取版本号
  • 读取CFBundleIdentifier获取唯一编号
  • 读取CFBundleDisplayName获取名称
  • 保存这些信息到数据库中,在生成manifest.plist的API中用以显示相应数据。

 基本上就这样。