尝试为iOS构建应用程序时出现Cordova错误65 [英] Cordova Error 65 when trying to build app for iOS
问题描述
我正在尝试在连接的iPhone上运行Cordova应用程序,但是每次尝试执行cordova run
时,我都会收到以下错误消息
I am trying to run my Cordova app on the connected iPhone, but everytime I try to do cordova run
I am getting the following error
检查依赖项
Check dependencies
未找到"com.myapp.chat"的配置文件:Xcode找不到 与"com.myapp.chat"匹配的配置文件.代码签名为 SDK'iOS 10.3'中产品类型'Application'必需的
No profiles for 'com.myapp.chat' were found: Xcode couldn't find a provisioning profile matching 'com.myapp.chat'. Code signing is required for product type 'Application' in SDK 'iOS 10.3'
我已经在项目的根目录中创建了一个build.json
文件,其内容如下:
I have created a build.json
file in the root directory of the project with the following contents
{
"ios": {
"debug": {
"developmentTeam": "some_id_here"
},
"release": {
"developmentTeam": "some_id_here",
"codeSignIdentity": "My App",
"packageType": "ad-hoc"
}
}
}
配置文件的ID正确,我已从开发人员支持页面下载了该文件,com.myapp.chat
软件包名称也已在该配置文件中注册.
The ID of the profile is correct, I have downloaded it from the developer support page, the com.myapp.chat
package name is also registered on that provisioning profile.
我已安装 XCode 8.3.2 ,并且已经在首选项">帐户"中使用其帐户登录,然后单击了下载所有配置文件".
I have XCode 8.3.2 installed, and I have logged in with my account in it in Preferences > Accounts, then I have clicked Download All Profiles.
我正在使用Cordova CLI来构建应用程序.
I am using Cordova CLI to build the app.
请问我在做什么错?
推荐答案
要将您的Cordova应用构建到iPhone,请按照以下步骤操作:
To build your Cordova app to an iPhone follow these steps:
- 运行命令
cordova add platform ios
,它将在您的Cordova项目目录中的平台> ios"下创建XCode项目文件.xcworkspace
- 从Xcode转到文件>打开",然后在平台> ios"下找到
.xcworkspace
文件 - 打开项目后,单击蓝色的项目图标更改项目设置.
- 在签名"下选择您的团队...
- Run the command
cordova add platform ios
, which will create the XCode project file.xcworkspace
in your Cordova project directory under "platforms > ios" - From Xcode go to "File > Open" and find the
.xcworkspace
file under "platforms > ios" - Once the project is open, click on the blue project icon to change the project settings.
- Under "Signing" choose your Team...
长答案
- 购买Mac图书( https://www.apple.com/mac/)
- 安装Xcode( https://developer.apple.com/xcode/)
- 这将创建KeyChain Access所需的证书颁发机构"Apple Worldwide Developer Relations Certification Authority".
- Buy a Mac Book (https://www.apple.com/mac/)
- Install Xcode (https://developer.apple.com/xcode/)
- This will create a certificate authority "Apple Worldwide Developer Relations Certification Authority" which is needed by KeyChain Access.
来自Apple Developers( developer.apple.com )
- 通过Apple购买价格为$ 99的开发者帐户
- 登录,然后转到: https://developer.apple.com/account/ios/certificate/
- 创建"iOS开发"证书
- 证书>全部",然后单击"+"图标,然后选择"iOS App Development".
- Purchase a developer account for $99 through Apple
- Sign-in, and go to: https://developer.apple.com/account/ios/certificate/
- Create an "iOS development" certificate
- "Certificates > All" and then click on the "+" icon, and choose "iOS App Development".
通过KeyChain访问
- 打开KeyChain Access应用程序
Applications > Utilities > KeyChain Access
- 通过转到证书助手>从证书颁发机构请求证书"来创建
CertificateSigningRequest.certSigningRequest
文件,并将其上传到Apple Developers.
- Open the KeyChain Access app
Applications > Utilities > KeyChain Access
- Create a
CertificateSigningRequest.certSigningRequest
file, by going to "Certificate Assistant > Request a Certificate From a Certificate Authority", and upload that to Apple Developers.
来自Apple Developers
- 注册您的iPhone-在设备> iPhone"下,单击"+"图标.
- 会要求设备名称"和"uuid"
- 要获取设备的uuid,您需要从"iTunes"应用中获取它.
- Register your iPhone - under "Devices > iPhone", click on the "+" icon.
- Will ask for a device "name" and the "uuid"
- To get the device uuid, you'll need to get it from the "iTunes" app.
从iTunes
- 使用USB电源线将iPhone插入Mac Book
- 打开"iTunes",然后单击iPhone图标.
- 单击标签序列号:",这将显示UUID.
- 将该UUID复制到Apple Developers网站上的"uuid"字段中.
在您的命令终端上
- 安装节点( https://nodejs.org/en/download/)- macOS安装程序
- 打开终端应用程序
Applications > Utilities > Terminal
- 安装Cordova:
sudo npm install -g cordova
(使用sudo
) - 创建遵循以下格式的Cordova应用程序:
-
cordova <app_directory> <bundle_id> <app_name>
- 例如:
cordova gmail_app com.google.gmail Gmail
.
-
- Install Node (https://nodejs.org/en/download/) - macOS Installer
- Open the Terminal app
Applications > Utilities > Terminal
- Install Cordova:
sudo npm install -g cordova
(usesudo
) - Create a Cordova app, that follows the format:
cordova <app_directory> <bundle_id> <app_name>
- For example:
cordova gmail_app com.google.gmail Gmail
.
来自Apple Developers
-
在标识符"下,创建一个新的应用程序ID"(单击"+"图标),然后将名称"字段设置为与您的Cordova应用程序
<app_name>
相同的名称,以及捆绑软件ID与Cordova<bundle_id>
相同.
Under "Identifiers" create a new "App Id" (click on the "+" icon), and set the "name" field with the same name as your Cordova app
<app_name>
, and the bundle ID with the same as the Cordova<bundle_id>
.
在"Provisioning Profiles"下,使用应用程序<app_name>
的名称创建一个新的"iOS Development"配置文件,然后选择捆绑包ID <bundle_id>
.
Under "Provisioning Profiles" create a new "iOS Development" provisioning profile, with the name of your app <app_name>
and select the bundle id <bundle_id>
.
来自XCode
-
将您的Apple ID添加到Xcode:
Add your Apple ID to Xcode:
- 打开XCode并转到"Xcode>首选项...>帐户",然后单击"+"图标以添加Apple ID ...",然后输入您的Apple开发人员帐户的用户名和密码./li>
- Open XCode and go to "Xcode > Preferences... > Accounts" and click on the "+" icon to "Add Apple ID..." and then enter your user name and password for your apple developers account.
打开Cordova Xcode项目文件:
Open the Cordova Xcode project file:
- 从XCode转到文件>打开",然后在Cordova项目的平台> ios"下找到
.xcworkspace
文件.
打开项目后,单击蓝色的项目图标更改项目设置.
Once the project is open, click on the blue project icon to change the project settings.
在签名"下选择您的团队...
Under "Signing" choose your Team...
在您的命令终端上
- 在您的Cordova项目的根目录中创建一个
build.json
文件:-
cd <app_directory>; touch build.json;
- 将以下内容粘贴到您的
build.json
文件中. - 要获取团队ID",您需要转到Apple Developers会员页面: https://developer.apple.com/account/#/membership/
-
- Create a
build.json
file in the root directory of your Cordova project:cd <app_directory>; touch build.json;
- Paste the following into your
build.json
file. - To get the "Team ID" you'll need to go to Apple Developers membership page: https://developer.apple.com/account/#/membership/
{
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<Team ID>",
"packageType": "development"
},
"release": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<Team ID>",
"packageType": "app-store"
}
}
}
{
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<Team ID>",
"packageType": "development"
},
"release": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "<Team ID>",
"packageType": "app-store"
}
}
}
- 下一步运行
cordova build ios
,它应该正确构建
- Next run
cordova build ios
, and it should build correctly
来自XCode
- 最后,在iPhone USB电缆插入Mac Book的情况下,确保已选择(1)设备,然后(2)单击运行"按钮.这会将您使用Cordova构建的应用程序部署到iPhone.
这篇关于尝试为iOS构建应用程序时出现Cordova错误65的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!