如何使用 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
How to generate an iOS IPA file with Ionic Framework?
提问by nicolasaiz173
I've successfully built the iOS app with the ionic build ios
command. 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。按照这些步骤
- Navigate to app folder
- 导航到应用程序文件夹
- Run cordova build command
- 运行cordova构建命令
- Open the Xcode Project
- 打开 Xcode 项目
- Clean the project
- 清理项目
- Select iOS mobile device to build for, don't use iOS emulator as device otherwise the archive is disabled.
- 选择要为其构建的 iOS 移动设备,不要使用 iOS 模拟器作为设备,否则存档将被禁用。
- Archive the project
- 归档项目
- Distribute the project
- 分发项目
- Choose a method for distribution
- 选择分发方式
- Choose a Profile
- 选择个人资料
- Select a location to save the .ipa file
- 选择一个位置来保存 .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)。