如何使用 Ionic Framework 生成 iOS IPA 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25919449/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 02:34:53  来源:igfitidea点击:

How to generate an iOS IPA file with Ionic Framework?

ioscordovabuildionic-frameworkipa

提问by nicolasaiz173

I've successfully built the iOS app with the ionic build ioscommand. But now I want to use TestFlightand it asks me for an IPA file. It seems that file is not generated with that build command. So, how can I generate it?

我已经使用ionic build ios命令成功构建了 iOS 应用程序。但是现在我想使用TestFlight,它要求我提供 IPA 文件。似乎该文件不是使用该构建命令生成的。那么,我该如何生成它呢?

Thanks

谢谢

回答by Roshan Bharti

You can easily build IPA from ionic framework. by following these steps

您可以轻松地从离子框架构建 IPA。按照这些步骤

  1. Navigate to app folder
  1. 导航到应用程序文件夹

OS X terminal with list command

带有 list 命令的 OS X 终端

  1. Run cordova build command
  1. 运行cordova构建命令

OS X terminal running ionic build command

运行 ionic build 命令的 OS X 终端

  1. Open the Xcode Project
  1. 打开 Xcode 项目

OS X Finder with project location

带有项目位置的 OS X Finder

  1. Clean the project
  1. 清理项目

XCode Product ->Clean menu

XCode 产品 ->清理菜单

  1. Select iOS mobile device to build for, don't use iOS emulator as device otherwise the archive is disabled.
  1. 选择要为其构建的 iOS 移动设备,不要使用 iOS 模拟器作为设备,否则存档将被禁用。

Xcode Target device selected

选择了 Xcode 目标设备

  1. Archive the project
  1. 归档项目

Xcode Project ->Archive menu

Xcode 项目 ->存档菜单

  1. Distribute the project
  1. 分发项目

XCode Organizer

XCode 组织者

  1. Choose a method for distribution
  1. 选择分发方式

Selecting method for distribution

选择分配方法

  1. Choose a Profile
  1. 选择个人资料

Choosing a profile

选择个人资料

  1. Select a location to save the .ipa file
  1. 选择一个位置来保存 .ipa 文件

Saving IPA file to Desktop folder

将 IPA 文件保存到桌面文件夹

I have generate my .ipa file by using these steps hope it will works for your's.

我已经使用这些步骤生成了我的 .ipa 文件,希望它适用于您的。

回答by Bhumit Mehta

this articleis kind of old but should help you.

这篇文章有点旧,但应该对你有帮助。

In Command line change into the folder that contains your *.xcodeproj, and run the following:

在命令行更改到包含 *.xcodeproj 的文件夹,并运行以下命令:

xcodebuild -target "My Target" -scheme "My Scheme"
-configuration Release clean archive

Now you've got your xcarchive , Following line will generate ipa which you can upload to TestFlight.

现在您已经获得了 xcarchive ,以下行将生成您可以上传到 TestFlight 的 ipa。

cd platforms/ios/build/device/usr/bin/xcrun -sdk iphoneos PackageApplication "$(pwd)/$PROJECT_NAME.app" -o "$(pwd)/$PROJECT_NAME.ipa"

Hope this helps

希望这可以帮助

回答by VictorEspina

What I do is to run this command:

我要做的是运行这个命令:

ionic cordova run ios

It will build and make the project, generate the IPA and then launch the simulator. At that moment I just quit the simulator and voila! I have my IPA with just one command (Ionic 4).

它将构建和制作项目,生成 IPA,然后启动模拟器。在那一刻,我只是退出了模拟器,瞧!我的 IPA 只有一个命令(Ionic 4)。