Ionic 无法在我的 iPhone 上 运行 我的应用程序

Ionic can't run my app on my iPhone

我对 Ionic 有疑问,更准确地说是 Xcode(我认为)。当我使用命令 sudo ionic run -device 时,它给了我这个:

=== BUILD TARGET felicitation OF PROJECT felicitation WITH CONFIGURATION Debug ===




Check dependencies


No profiles for 'com.arguiot.felicitation123456' were found:  Xcode couldn't find a provisioning profile matching 'com.arguiot.felicitation123456'.

Code signing is required for product type 'Application' in SDK 'iOS 10.2'



** ARCHIVE FAILED **



The following build commands failed:

    Check dependencies

(1 failure)

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Arthur-Guiot/GitHub/Appli-Samuel-Julien/platforms/ios/cordova/build-debug.xcconfig,-workspace,felicitation.xcworkspace,-scheme,felicitation,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,felicitation.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/Arthur-Guiot/GitHub/Appli-Samuel-Julien/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/Arthur-Guiot/GitHub/Appli-Samuel-Julien/platforms/ios/build/sharedpch

我试图手动构建它,但我做不到,因为我的 iPhone SE 上有 iOS 10.3 beta。我有 Xcode 8.2,对于命令行:Xcode 8.2 (8C38)。我最近更新了命令行工具,我认为这是问题所在。无论如何,应用程序的代码是 here。是否有任何解决方案可以重新安装每个依赖项或解决问题?如果你们认为它来自代码,请随时对 GitHub 存储库进行拉取请求。

执行以下步骤

  • 添加ios平台sudo ionic platform add ios
  • 使用 Apple 的开发者门户创建开发者配置文件(您需要一个配置文件才能 运行 您的应用程序在设备上。您必须使用 Apple 开发者帐户创建一个。)。要创建配置文件,link 会对您有所帮助。按照 创建配置文件 部分中的步骤操作。您可以按照此处的其余步骤在 ios 设备上 运行 您的应用程序。但作为总结,下面提到了以下步骤。
  • 转到您的项目并导航到平台文件夹内部,您可以找到 ios 文件夹。进入该文件夹并使用 Xcode 打开 .xcodeproj。 注意: 如果有.xcworkspace,打开它而不是.xcodeproj。
  • 然后在 Xcode 中的方案 pop-up 菜单中,选择您的设备并单击 运行 按钮以 运行 您在设备中的应用程序。

尝试使用以下命令删除 iOS 平台:

ionic platform remove ios

然后使用以下命令添加ios平台版本4.2.0:

ionic platform add ios@4.2.0

高于 4.3.0 的版本在离子构建方面存在问题。这可以解决您的问题。

此外,如果您 运行 在真实设备上安装它,您可能需要创建开发配置文件。没有配置文件,您无法在真实设备上 运行 它。