问题
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:
- Create an Apple ID which is free. Or use the exist one.
- Add the Apple ID in the Accounts of your Xcode, it shows as Personal Team for free account. (Xcode->Preferences->Accounts)
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.
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.
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.
Check the Build iTunes Package Archive(IPA) checkbox in iOS IPA Options, for Ad-Hoc and iPhone.
Make sure the bundle identifier is the same as the one used in Xcode.
Build your project. Then right click your project, click "Open folder in File Explorer". Find the IPA in bin\iPhone\Ad-Hoc folder.
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.
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.
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
- Select Relaese mode
- 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:
- Set your configuration as
Ad-Hoc
- Make sure you are having correct provisioning profiles setup in
iOS Bundle Signing
section in Project properties. - Make sure in
iOS IPA Options
, you have checkedBuild 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