環(huán)境準(zhǔn)備
IPA安裝包一個?
對應(yīng)的plist文件?
支持Https的服務(wù)環(huán)境
1.plist file模板
也可以百度(plist模板網(wǎng)上一堆)
圖片1的位置替換成你自己的ipa下載地址
圖片2的位置替換成你自己的bundle-id
圖片3的位置替換成你自己的ipa版本號
2.ipa下載地址,如果沒有前端或者后端的支持,也可以開啟mac自帶的Apache服務(wù)器 ? (參考文章http://www.reibang.com/p/c6ee75f2416b)
2.1、開啟 sudo apachectl start
2.2、關(guān)閉?sudo apachectl stop
2.3卦停、重啟?sudo apachectl restart
默認(rèn)的Apache的文件的根目錄在/Library/WebServer/Documents
打開終端撕蔼,開啟Apache:
//開啟apache:? sudo apachectl start//重啟apache:? sudo apachectl restart//關(guān)閉apache:? sudo apachectl stop//查看apache版本 sudo apachectl -v
回車會提示輸入密碼懂昂,也就是你電腦的密碼祟牲,http://127.0.0.1/(或者輸入http://localhost)測試一下,成功則如
下圖:
把ipa文件放到/Library/WebServer/Documents目錄下起意,接下來用瀏覽器訪問?http://127.0.0.1/xxx.ipa?,IP(127.0.0.1)也可以換成你電腦的IP地址,這樣在同一局域網(wǎng)的設(shè)備也可以訪問服務(wù)器的內(nèi)容病瞳。
3.plist文件放入https服務(wù)器(我這里放在GitHub)
如何使用github存放plist文件參考文章(http://www.reibang.com/p/8426ad236d97)
4.?制作分發(fā)安裝連接
<a href="itms-services://?action=download-manifest&url=https://xxx.com/manifest.plist">Install APP </a>
里面的httsp鏈接為存放plist文件的鏈接
(標(biāo)注
驗(yàn)證了只更改上傳的ipa揽咕,不更改plist 文件中的版本key值
(ipa的版本與plist 文件中的版本key值不一致),下載安裝也不會受影響仍源,與上傳的ipa版本一致
)
5.生成二維碼心褐,推薦使用草料二維碼生成器,直接把itms-services://?action=download-manifest&url=https://xxx.com/manifest.plist ?粘貼到地址位置就可以生成二維碼了(https://raw.githubusercontent.com/Honglizhaogit/plistTest/main/testPlist)
6. 或者把如下的html文件生成二維碼也可
??安卓和IOS掃描同一個二維碼下載APP(參考文章https://blog.csdn.net/u013022210/article/details/53639613)
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ? ? ? <title>二維碼下載</title>?
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? /*
? ? ? ? ? ? * 智能機(jī)瀏覽器版本信息:
? ? ? ? ? ? *
? ? ? ? ? ? */
? ? ? ? ? ? var browser = {
? ? ? ? ? ? ? ? versions: function() {
? ? ? ? ? ? ? ? ? ? var u = navigator.userAgent, app = navigator.appVersion;
? ? ? ? ? ? ? ? ? ? return {//移動終端瀏覽器版本信息
? ? ? ? ? ? ? ? ? ? ? ? trident: u.indexOf('Trident') > -1, //IE內(nèi)核
? ? ? ? ? ? ? ? ? ? ? ? presto: u.indexOf('Presto') > -1, //opera內(nèi)核
? ? ? ? ? ? ? ? ? ? ? ? webKit: u.indexOf('AppleWebKit') > -1, //蘋果笼踩、谷歌內(nèi)核
? ? ? ? ? ? ? ? ? ? ? ? gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐內(nèi)核
? ? ? ? ? ? ? ? ? ? ? ? mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否為移動終端
? ? ? ? ? ? ? ? ? ? ? ? ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios終端
? ? ? ? ? ? ? ? ? ? ? ? android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android終端或者uc瀏覽器
? ? ? ? ? ? ? ? ? ? ? ? iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否為iPhone或者QQHD瀏覽器
? ? ? ? ? ? ? ? ? ? ? ? iPad: u.indexOf('iPad') > -1, //是否iPad
? ? ? ? ? ? ? ? ? ? ? ? webApp: u.indexOf('Safari') == -1 //是否web應(yīng)該程序逗爹,沒有頭部與底部
? ? ? ? ? ? ? ? ? ? };
? ? ? ? ? ? ? ? }(),
? ? ? ? ? ? ? ? language: (navigator.browserLanguage || navigator.language).toLowerCase()
? ? ? ? ? ? }
? ? ? ? ? ? if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
? ? ? ? ? ? ? ? window.location="https://itunes.apple.com/cn/app/piao+shang-hu-ban/id1056558620?mt=8";? /*appstore iOS 下載地址*/
? ? ? ? ? ? }
? ? ? ? ? ? else if (browser.versions.android) {
? ? ? ? ? ? ? ? window.location="http://www.51piaojia.com/android-merchant.html";/*安卓 下載地址*/
? ? ? ? ? ? }
//? ? ? ? ? ? document.writeln("語言版本: " + browser.language);
//? ? ? ? ? ? document.writeln(" 是否為移動終端: " + browser.versions.mobile);
//? ? ? ? ? ? document.writeln(" ios終端: " + browser.versions.ios);
//? ? ? ? ? ? document.writeln(" android終端: " + browser.versions.android);
//? ? ? ? ? ? document.writeln(" 是否為iPhone: " + browser.versions.iPhone);
//? ? ? ? ? ? document.writeln(" 是否iPad: " + browser.versions.iPad);
//? ? ? ? ? ? document.writeln(navigator.userAgent);
? ? ? ? </script>
? ? </head>
? ? <body>
? ? </body>
</html>