通过网页在线安装可以达成自动化部署,终端测试用户只需要通过页面下载安装即可。也可以免去发包给发行商的步骤,分享一个链接地址,他们点击链接即可完成安装。
Android版本很好处理,只需要部署好一台静态文件服务器,Android设备都可以自己下载安装。这里主要说明iOS的在线安装方式。
iOS在线安装的步骤简单来说就是部署一台https文件服务器(Nginx),生成好openssl证书,将app用AdHoc或者企业版本证书签名。这样用户只需要通过Safari访问页面就可以安装了。 这里要说明一下,使用企业版本证书签名的app是不能够上传到app store上面的,但是任何设备都可以下载安装该app。 通过AdHoc签名的app需要终端用户设备的udid加入到该签名的.mobileprovision中才能安装。没有加入udid的用户是不能够安装的。
具体步骤如下:
1、部署一台https服务器。这里我们使用的是Nginx(也可以使用Apache的httpd)。注意必须要是https的服务器,否则无法启动iOS的安装功能。
安装Nginx在linux上可以参考这里,需要安装一些依赖库(如pcre)。
openssl需要0.9.8的版本,不要1.0的版本。Nginx的编译配置如下:
./configure --with-http_ssl_module --with-openssl=../openssl-0.9.8zh
make
make install
2、Nginx的配置如下(关键看https的部分)
user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name 127.0.0.1;
#charset koi8-r;
#access_log logs/host.access.log main;
location /ios_test {
root /mnt/langresser/download/;
index index.html index.htm;
}
location /ipa_test {
alias /mnt/langresser/download/;
add_header Content-Dispositoin "attachment";
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
server {
listen 443 ssl;
server_name 127.0.0.1;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;
#autoindex on;
#autoindex_exact_size off;
location /ios {
root /mnt/langresser/download/;
index index.html index.htm;
}
location /ipa {
alias /mnt/langresser/download/;
add_header Content-Dispositoin "attachment";
}
}
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
# }
}
3.一个测试页面如下(index.html,配置在nginx中)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>游戏Demo</title>
</head>
<body>
<h1>1. iOS安装 <a href="https://127.0.0.1/ipa/server.crt">证书</a><br/>(如果之前尚未安装过此证书,请先安装证书)</h1>
<br/>
<h1>2. iOS安装 <a href="itms-services://?action=download-manifest&url=https://127.0.0.1/ipa/manifest.plist">游戏包</a></h1>
<br/>
<h1>3. Android安装 <a href="https://127.0.0.1/ipa/thirtysix.apk">游戏包</a></h1>
</body>
</html>