Generating the IPA file of my Xamarin App without an iOS device

允我心安 提交于 2020-01-11 19:41:29

问题


I have created a Xamarin Forms App for both Android and iOS devices from Visual Studio 2017 and Windows. To test and build the iOS app, I have used a Mac with Xamarin Mac Agent.

Now I have to build an IPA file for internal testing, however I'm unable to do it because when I build my project for the iOS simulator, it's not generated the IPA file. I have also tried to use both Ad-hoc and AppStore build options.

I know that with XCode 7+ you can create an IPA file for internal testing without an Apple Developer Account, but do I need to have a physical iOS device in order to get the IPA file?

I hope you can help me.


回答1:


I know that with XCode 7+ you can create an IPA file for internal testing without an Apple Developer Account, but do I need to have a physical iOS device in order to get the IPA file?

According to your description, you want to create an IPA for device without enrolling an Apple Developer Program.

Unfortunately, you need to have a physical iOS device to achieve that if you want to create an IPA without an Apple Developer Account. And the generated IPA only can be installed in the iOS devices you connected to the Xcode.

You can follow these steps to generate an IPA without an Apple Developer Account with Xcode and Visual Studio:

  1. Create an Apple ID which is free. Or use the exist one.
  2. Add the Apple ID in the Accounts of your Xcode, it shows as Personal Team for free account. (Xcode->Preferences->Accounts)

  1. Go to Xcode->Target->General. Set Bundle Identifier to be the same as the one you set in your Visual Studio Xamarin project. This is very important, because Xcode will generate a provisioning profile according to the Bundle Identifier and your iOS device's UDID.

  2. Go to Signing section. Check the Automatically manage signing checkbox. Select your personal team in the Team dropdownlist. Now, Xcode will generate a provisioning profile for you automatically.

  3. Now, go to Visual Studio, choose one configuration to set the settings, here I use the Ad-Hoc and iPhone. Go to iOS Bundle Signing tab, select the Signing Identifier which contains your Apple ID. And Select your Provisioning Profile which contains the Bundle Identifier you set before.

  4. Check the Build iTunes Package Archive(IPA) checkbox in iOS IPA Options, for Ad-Hoc and iPhone.

  5. Make sure the bundle identifier is the same as the one used in Xcode.

  6. Build your project. Then right click your project, click "Open folder in File Explorer". Find the IPA in bin\iPhone\Ad-Hoc folder.

  7. This IPA generates with a free provisioning. So, It can't be installed via iTunes. But it can be installed via Xcode->Window->Device. Click the "+" and select your IPA to install it.

  8. When the IPA is installed, you can't use it immediately. You need to trust it first. Go to Settings->General->Profiles&Device Management on your iPhone. Find the profile which is named by your Apple ID email. Click and Trust it.

  9. Now you can run your app.

BTW, the best solution is to enroll the Apple Developer Program, then you can deploy to up to 100 devices for test and can deploy via OTA or other tools without Xcode.




回答2:


Answer

Yes, You don't need to connect any physical device to generate an IPA.

Steps

  1. Select Relaese mode
  2. Select Generic device from build only device



    For more information about configuration, Please have a look below images






回答3:


To output an ipa file and distribute it for testing:

  1. Set your configuration as Ad-Hoc
  2. Make sure you are having correct provisioning profiles setup in iOS Bundle Signing section in Project properties.
  3. Make sure in iOS IPA Options, you have checked Build Itunes Package Archive



回答4:


No you do not need to connect a physical device to generate an IPA.

I normally set Solution Configurations to Ad-Hoc and Solution Platforms to Any CPU.

I also ensure I have a provisioning profile correctly set up containing the device UDID's I want to test on and usually use a wildcard project ID. Make sure this is selected in the project options.

Here is a good article on how to set up a device, signing certificate and provisioning profile



来源:https://stackoverflow.com/questions/46308357/generating-the-ipa-file-of-my-xamarin-app-without-an-ios-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!