... | @@ -39,28 +39,6 @@ code-push register |
... | @@ -39,28 +39,6 @@ code-push register |
|
cordova create CodePush-iOS com.easternphoenix.CodePush CodePush-iOS
|
|
cordova create CodePush-iOS com.easternphoenix.CodePush CodePush-iOS
|
|
```
|
|
```
|
|
|
|
|
|
进入项目根目录,创建`build.json`
|
|
|
|
```shell
|
|
|
|
cd CodePush-iOS
|
|
|
|
touch ./build.json
|
|
|
|
open -a xcode ./build.json
|
|
|
|
```
|
|
|
|
|
|
|
|
向文件添加下面内容:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ios": {
|
|
|
|
"debug": {
|
|
|
|
"codeSignIdentity": "iPhone Developer",
|
|
|
|
"automaticProvisioning": true,
|
|
|
|
"developmentTeam": "2WT78RG4ZP",
|
|
|
|
"packageType": "development"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
通过配置`build.json`文件可以控制cordova如何生成iOS项目。
|
|
|
|
|
|
|
|
添加iOS平台
|
|
添加iOS平台
|
|
```shell
|
|
```shell
|
|
cordova platform add ios
|
|
cordova platform add ios
|
... | @@ -111,17 +89,6 @@ open -a xcode ./config.xml |
... | @@ -111,17 +89,6 @@ open -a xcode ./config.xml |
|
open -a xcode ./www/index.html
|
|
open -a xcode ./www/index.html
|
|
```
|
|
```
|
|
|
|
|
|
把文件中的含有「`http-equiv="Content-Security-Policy"`」配置的`<meta>`元素替代成下面这样
|
|
|
|
```html
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Security-Policy" content="default-src https://codepush.appcenter.ms 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *;">
|
|
|
|
...
|
|
|
|
</head>
|
|
|
|
...
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
---
|
|
在`index.js`添加热更新代码
|
|
在`index.js`添加热更新代码
|
|
```shell
|
|
```shell
|
... | | ... | |