简体   繁体   English

为iOS构建Cordova项目

[英]Build Cordova project for iOS

I am trying to build my Cordova project for an iOS. 我正在尝试为iOS构建我的Cordova项目。 I have borrowed a mac and an iphone in order to do this; 为了做到这一点,我借了一台Mac和一部iphone; meaning I am very new to everything apple-related. 这意味着我对苹果相关的一切都很新鲜。

From what I understand: in order to build anything for iOS, I need some sort of apple developer-account. 据我所知:为了为iOS构建任何东西,我需要某种苹果开发者帐户。 (I believe the mac I am using has one, not quite sure.) (我相信我使用的mac有一个,不太确定。)

When I try to run the command: cordova run ios I get the following error: 当我尝试运行命令: cordova run ios出现以下错误:

Check dependencies Code Signing Error: No profiles for 'io.cordova.hellocordova' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'io.cordova.hellocordova'. 检查依赖项代码签名错误:未找到“io.cordova.hellocordova”的配置文件:Xcode找不到与“io.cordova.hellocordova”匹配的任何iOS App Development配置文件。 Automatic signing is disabled and unable to generate a profile. 自动签名已禁用,无法生成配置文件。 To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. 要启用自动签名,请将-allowProvisioningUpdates传递给xcodebuild。 Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.2' 代码签名错误:SDK“iOS 11.2”中的产品类型“应用程序”需要代码签名

I don't know what any of the above means, or how to solve it. 我不知道上述任何一种方法,或者如何解决它。 I believe I have to use xcode to somehow automatically created a build.json file (not sure), but I don't know how to open my cordova project in xcode. 我相信我必须使用xcode以某种方式自动创建一个build.json文件(不确定),但我不知道如何在xcode中打开我的cordova项目。

I have been using Sublime to edit my cordova project files, and the terminal to use the cordova cli. 我一直在使用Sublime来编辑我的cordova项目文件,以及使用cordova cli的终端。 I am running xcode 9.2 我正在运行xcode 9.2

From what I understand: in order to build anything for iOS, I need some sort of apple developer-account. 据我所知:为了为iOS构建任何东西,我需要某种苹果开发者帐户。 (I believe the mac I am using has one, not quite sure.) (我相信我使用的mac有一个,不太确定。)

If that is true, then you can try the following: 如果是这样,那么您可以尝试以下方法:

cordova build ios
open platforms/ios/<my-app-name>.xcworkspace

This will open the app in Xcode. 这将在Xcode中打开应用程序。 Click on the icon (left hand side, above the directory structure view) "General" and check "Automatically manage signing". 单击图标(左侧,目录结构视图上方)“常规”,然后选中“自动管理签名”。 Try to run the app in Xcode. 尝试在Xcode中运行该应用程序。

Check this website for reference (and a picture of where to click in Xcode): http://cordova.apache.org/docs/en/7.x/guide/platforms/ios/index.html 查看本网站以获取参考(以及Xcode中点击的位置图片): http//cordova.apache.org/docs/en/7.x/guide/platforms/ios/index.html

As mentioned by @Dev_Tandel, you need to have a apple dev acct to run your app in a device. 正如@Dev_Tandel所提到的,您需要有一个苹果开发人员才能在设备中运行您的应用程序。 Refer link to get more info: https://developer.apple.com/support/certificates/ 请参阅链接以获取更多信息: https//developer.apple.com/support/certificates/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM