ios 无线 iphone 应用程序分发 - itms-services 协议的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4695180/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
wireless iphone app distribution - problem with itms-services protocol
提问by sol
I've followed all the directions from Appleand some other blog posts. I've archived the app, made .plist and .ipa files, put them on a server and linked to them. I can install the provisioning profile just fine. But when I click on the link to install the app (in safari on the iphone), nothing happens. No error message. Nothing. This is what the link looks like:
我遵循了Apple和其他一些博客文章的所有指示。我已经归档了应用程序,制作了 .plist 和 .ipa 文件,将它们放在服务器上并链接到它们。我可以很好地安装配置文件。但是当我点击链接安装应用程序(在 iphone 上的 safari 中)时,没有任何反应。没有错误信息。没有。这是链接的样子:
<a href="itms-services://?action=download-manifest&url=http://mydomain.com/test/myApp.plist">Install the app</a>
Any idea why this isn't working? It seems the itms-services protocol is just dead. MIME types are fine (I can point to the plist file in the address bar and it displays as text).
知道为什么这不起作用吗?看来 itms-services 协议已经死了。MIME 类型很好(我可以指向地址栏中的 plist 文件,它显示为文本)。
回答by ptrico
I had similar symptoms when I had a space in the filenames of the manifest file and the application archive file. I removed all spaces from them and the wireless install worked for me. It looks like your manifest doesn't have a space, so maybe your app file does?
当清单文件和应用程序存档文件的文件名中有空格时,我也有类似的症状。我删除了它们的所有空格,无线安装对我有用。看起来你的清单没有空格,所以也许你的应用程序文件有?
回答by tc.
The answer is actually very simple: The URL needs to be "double-escaped", i.e.
答案其实很简单:URL需要“双重转义”,即
itms-services://?action=download-manifest&url=https://example.com/My%2520App.plist
This is because the value gets unescapedto https://example.com/My%20App.plist
before being treated as another URL. This gets unescaped by the server at example.com
to a space.
这是因为该值被转义,以https://example.com/My%20App.plist
被视为另一个URL之前。这被服务器转义example.com
到一个空间。
The parser does nottreat + specially: ...&url=https://.../test/a+b
results in "GET /test/a+b HTTP/1.1"
appearing in the Apache logs. (It is unwise to assume that all query strings are application/x-www-form-urlencoded
; this is only standardized in HTML.)
解析器不会特别对待 +:...&url=https://.../test/a+b
导致"GET /test/a+b HTTP/1.1"
出现在 Apache 日志中。(假设所有查询字符串都是 是不明智的application/x-www-form-urlencoded
;这仅在 HTML 中标准化。)
Incidentally, it looks like itms-services uses +[NSURL URLWithString:]
to validateURLs: url=.../My%20App.plist
results in no request because [NSURL URLWithString:@"https://.../My App.plist"]
returns nil
. However, there's a long-standing bug in NSURL: It will escape a single invalid (BMP) character at the end instead of returning nil. My test cases
顺便说一句,它看起来像 itms-services+[NSURL URLWithString:]
用来验证URLs: url=.../My%20App.plist
results in no request 因为[NSURL URLWithString:@"https://.../My App.plist"]
returns nil
。然而,NSURL 中存在一个长期存在的错误:它会在末尾转义单个无效(BMP)字符而不是返回 nil。我的测试用例
url=.../test/%3c
results in the log"GET /test/< HTTP/1.1"
(this is definitely invalid HTTP!)url=.../test/%0a
results in an error on device but no log message (because Apache treats it as a malformed request)url=.../test/%0d
results in the log"GET /test/\r HTTP/1.1"
url=.../test/%3c
结果在日志中"GET /test/< HTTP/1.1"
(这绝对是无效的 HTTP!)url=.../test/%0a
导致设备出错但没有日志消息(因为 Apache 将其视为格式错误的请求)url=.../test/%0d
结果在日志中"GET /test/\r HTTP/1.1"
回答by CKT
itms-services is an identifier by which apple/iphone will identify that it should validate the certificate and it should install.
itms-services 是一个标识符,apple/iphone 将通过它来识别它应该验证证书并安装它。
To validate the provisioning profile before installing the ipa file it will connect to "ax.init.itunes.apple.com" and "ocsp.apple.com".
为了在安装 ipa 文件之前验证配置文件,它将连接到“ax.init.itunes.apple.com”和“ocsp.apple.com”。
If you are using any intranet connection please check whether these links are accessible or not? if not, you cannot install the application via over the air.
如果您正在使用任何内联网连接,请检查这些链接是否可以访问?如果没有,您将无法通过无线方式安装该应用程序。
& minimum OS on the device should be 4.0
& 设备上的最低操作系统应为 4.0
回答by user690513
I was using IIS 6.0 and the index.html page was loading but when the user clicked on the .plist link from the apple device (i.e) iphone 4, I kept getting "cannot connect www.mywebsite.com". The solution besides adding the MIME Type, was to share the Web Sharing where the .plist file was and the most important: change the security access of the manifest .plist file. gave full control to default windows user
我正在使用 IIS 6.0 并且正在加载 index.html 页面,但是当用户单击来自苹果设备(即)iphone 4 的 .plist 链接时,我一直收到“无法连接 www.mywebsite.com”的消息。除了添加 MIME 类型之外,解决方案是共享 .plist 文件所在的 Web 共享,最重要的是:更改清单 .plist 文件的安全访问权限。完全控制默认 Windows 用户
回答by Sveinung Kval Bakken
Seems like you have several pointers here to what might be the problem, for next time: check the device console from Xcode Organizer, it usually contains useful information regarding failed OTA distribution.
似乎您在这里有几个指示可能是什么问题,下次:从 Xcode Organizer 检查设备控制台,它通常包含有关失败的 OTA 分发的有用信息。
回答by erk ekin
make MIME settings of your server correct.
让您的服务器的MIME设置正确。
google for it you'll find the right way
谷歌一下,你会找到正确的方法
回答by bgarick
Be sure that all the URLs are fully qualified. Including those for the png files.
确保所有 URL 都是完全限定的。包括那些用于 png 文件的文件。
回答by Dave Tsay
I had the same problem as above. After trying all of the above and failing, I figured out that when I was archiving my app, I didn't put in the application URL in the settings, thus this URL was never in my plist file. Make sure when you look at your plist file that the application URL is in there.
我遇到了与上述相同的问题。在尝试了上述所有方法并失败后,我发现在归档应用程序时,我没有在设置中输入应用程序 URL,因此该 URL 从未出现在我的 plist 文件中。确保在查看 plist 文件时应用程序 URL 位于其中。
回答by James
For anyone who is interested in dynamically generating their plist, this example is PHP:
对于任何对动态生成 plist 感兴趣的人,这个例子是 PHP:
$appUrl='itms-services://?action=download-manifest&url=http://server/iOSpList.php?'.
'url%3D'.$app['url'].
'%26bundle%3D'.$app['bundle'].
'%26version%3D'.$app['version'].
'%26name%3D'.$app['name'];
Also, make sure the mime type is returned as application/xml
.
此外,请确保 mime 类型返回为application/xml
.
回答by Paul Hunter
As many others before, I also encountered this daemon of a problem. In my case the problem was that the plist file was not correctly formated. Be sure that the file follows the exact pattern outlined in the documentation: http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html
和之前的许多其他人一样,我也遇到了这个守护进程的问题。就我而言,问题是 plist 文件的格式不正确。确保文件遵循文档中概述的确切模式:http: //developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html