如何设置服务器从url安装iphone应用程序(用于开发)

时间:2015-03-20 07:14:04

标签: ios cordova phonegap-build

我将.ipa文件放在http://www.diawi.com/上,可以提供并安装好。

但是,我正在尝试在我的服务器上设置它并且它不想工作。

根据diawi网址,我的网址以.ipa结尾。

我使用以下标题提供服务:

Cache-Control:public
Content-Disposition:attachment; filename="Speaking Email.ipa"
Content-Length:644878
Content-Type:application/octet-stream
Date:Fri, 20 Mar 2015 06:54:00 GMT
Expires:Mon, 01 Jan 0001 00:00:00 GMT
Last-Modified:Fri, 20 Mar 2015 06:43:39 GMT
Server:Microsoft-IIS/7.5
X-AspNet-Version:4.0.30319
X-UA-Compatible:IE=Edge,chrome=1

diawi.com上的标题是:

Accept-Ranges:bytes
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Disposition:attachment; filename="Speaking Email.ipa"
Content-Length:644878
Content-Type:application/octet-stream
Date:Fri, 20 Mar 2015 07:09:22 GMT
ETag:"550bc49e-9d70e"
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified:Fri, 20 Mar 2015 06:56:30 GMT
Server:nginx
Set-Cookie:__utmmobile=0x4bf390e7f5e82765; expires=Sun, 19-Mar-2017 07:09:22 GMT; Max-Age=63072000; path=/
Set-Cookie:insc=2; expires=Fri, 20-Mar-2015 07:10:22 GMT; Max-Age=60

当我下载两个IPA并将它们重命名为ZIP和Beyond Compare时,它们是相同的。因此,据我所知,他们没有对IPA或标题做任何特别的事情......

他们是怎么做到的? (PhoneGap构建也做同样的事情)

1 个答案:

答案 0 :(得分:1)

您不必链接.ipa,您必须链接.plist

<a href="itms-services://?action=download-manifest&url=http://www.yourserver.com/yourApp/manifest.plist">Install the App</a>

manifest.plist应该是这样的:

<!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>http://www.yourserver.com/yourApp/YourAppName.ipa</string>
                        </dict>
                    </array>
                    <key>metadata</key>
                    <dict>
                        <key>bundle-identifier</key>
                        <string>com.yourcompany.YourAppName</string>
                        <key>kind</key>
                        <string>software</string>
                        <key>title</key>
                        <string>iOS Test App</string>
                    </dict>
                </dict>
            </array>
        </dict>
    </plist>