Why can't I archive a Xamarin.Forms iOS application? - ios

We are building a Xamarin.Forms app on windows machines using Visual Studio 2019. We have created the developer provisioning certificates, distribution certificates, developer provisioning profiles, and distribution profiles.
We pair Visual Studio to a Mac and can deploy our applications onto iOS devices. When in xCode on the Mac, we can see the provisioning profiles are installed.
When we look in Visual Studio, at Options->Xamarin->Apple Accounts, we can see everything looks like it should:
But we can't right-click->Archive our iOS project. It always appears grayed out.
Our project is set to Release and iPhone for the Active solution platform. What else needs to be done to get the archive functionality working for iOS projects inside visual studio?

I had the same issue, after deleting all bin and obj folders and moving just the proj and sln (don't copy .git, .vs etc) to mac I was able to publish using vs for mac.
note: I had to update vs for mac, otherwise it wanted to use application loader, which is no longer supported for xcode 11.

You need to have Visual Studio 2019 version 16.3 or higher to be able to archive iOS projects.
Alternatively, you can manually upload the IPA file from a mac using this from the command line:
xcrun altool --upload-app --type ios --file "/Users/*****/*****/******.iOS.ipa" --username "Your Apple ID" --password "app-specific password"

Related

Xamarin.iOS not found provision profiles in Visual Studio 2019, 2022

Visual Studio 2019 or 2022 doesn't recognize active provision profiles for Xamarin.iOS.
My activities to resolve the issue:
Removed bin and obj folder at Visual Studio Project.
Removed old profiles on Windows from here: %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles
Removed profiles on Mac OS:
~/Library/MobileDevice/Provisioning\ Profiles
Removed certificates from Keychain Access on Mac OS.
Created new certificates and provision profiles at Apple Developer site.
Download and install certificates and profiles for XCode
Created new project at MacOS with the same identifier like in Visual Studio project.
Open in Visual Studio my project and connecting to MacOS.
And I observe, that Visual studio not found Developer Profile and for Release mode set old removed profile.
The option with automatic preparing is not fit, because VS just create yet a new profile.
Are there any idia to resolve it?
I resolved the issue of updating provisioning profiles as follows:
For for Release profiles:
Clear all provisioning profiles under path ~/Library/MobileDevice/Provisioning Profiles
Add developer account in XCode:
XCode -> Preferences -> Accounts -> "+" -> AppleID
then click "Download Manual Profiles"
XCode -> File -> New -> Project -> App ->
Choose Team and check Bundle Identifier.
Bundle ID must be the same like in Visual Studio project in Info.plist.
<key>CFBundleIdentifier</key>
<string>com.your_identifier</string>
Set required profiles in XCode project:
Updated VS 2019 on Windows
Updated on Mac:
Xamarin.iOS: https://aka.ms/xvs/pkg/macios/15.0.0.18
Xamarin.Mono: https://aka.ms/xvs/pkg/mono/6.12.0.107
Restart Mac OS and Re-connected to Mac from Visual Studio.
Now Release profiles were updated in VS.
For Debug provision profile:
Developer profile was not recognized, and I choose "Automatic Provisioning" in Visual studio.
The project was successfully launched for debugging.
A very important problem remained - push notifications did not work in debug and release mode.
The problem was resolved when I removed Xamarin folder from cache on Mac OS:
~/Library/Caches/Xamarin
When I rebuilt the application, push messages began work in debug and release.
Here are all the steps you can try:
1.Modify the "Scheme" to "Automatic Provisioning" and check if it works.
2.Clear all provisioning profiles under path ~/Library/MobileDevice/Provisioning Profiles.
3.Check if the bundle ID in the Mac is consistent with the bundle ID of your project.
4.Follow the document Manual provisioning for Xamarin.iOS to create new profiles.
6.Update the VS to the latest.
5.If all the steps doesn't work, try to report a problem on Developer Community.

Xamarin App running in Ios simulator using visual studio

I am facing the issue to run the xamarin app in IOS simulator. Whenever i am trying to run this app it was asking me to add or pair the Mac. Since I dont own the Mac I tried to install Xamarin.Ios in windows. In this process i need to install the XCode in my windows 10 Os. First of all i am unable to download the Xcode tool from Apple portal with valid credentials. I followed the below 2 links but no luck to download and install the Xcode. Could you guys please help me the easiest solution to download install the Xcode to do the next level of run the App in windows.
https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/?pivots=windows
https://apps.apple.com/us/app/xcode/id497799835?mt=12
Bottom line is that iOS apps must be build using a licensed Mac OS, period. Visual Studio for Windows does not actually build the iOS app, what it does do is connect to a Mac (which must have XCode installed) and facilitate a remote iOS build via XCode. However, if you have a Mac, you can build both iOS and Android code directly on your Mac using Visual Studio for Mac. Yes, it is frustrating that you must have access to a Mac OS to build iOS apps, but this is a requirement and there is no way around it.

visual studio for mac unable to create ipa file

I am using visual studio for mac Community Edition on MAC Virtual Machine. I have created a webView iOS application with iPhone Simulator. In project options, I have checked the box for creating ipa file but actually I am not able to find ipa file for the project in directory
bin->iPhoneSimulator->Release
Please help me.
Screenshots are attached.
Select a Release Configuration
Select a Device
Perform a Build / Archive for Publishing

Xamarin Error No installed provisioning profiles match the installed iOS signing identities in Visual Studio for Mac

I need a help about Xamarin in Visual Studio for Mac.
I installed Visual Studio for Mac since Preview version. First time I had installed it, I tried to deploy simple app to my device. I have no problem about deploying Xamarin App to my iPhone dan iPad. I forget the last time I deployed my iOS app, but I never have problem about provisioning profiles.
Today, I made an app and had successfully built. But when I want to deploy to my iPhone, I got "No installed provisioning profiles match the installed iOS signing identities" error.
This is what I have in Preference
I tried to make an iOS app using Xcode and deployed to my iPhone. No problem about provisioning. I also tried open my old Xcode project, deployed it to my iPhone and still no problem.
If there is no error about provisioning in Xcode, but why there is a problem in Visual Studio for Mac?
My Visual Studio for Mac is 7.0.1 (Build 24), the latest version in Stable channel

How to build an iOS application using Visual Studio Tools for Apache Cordova and Xcode 8

This if question for those, who know what I am doing wrong and help for those experiencing the same issue.
I use Visual Studio 2015 on Win10 and Visual Studio Tools for Apache Cordova. I have Xcode 8 on my Mac. When setting up my projects, I follow this guide - https://taco.visualstudio.com/en-us/docs/ios-guide/. I also use a the hook available here - https://dpogue.ca/articles/cordova-xcode8.html. At this moment I am building ad-hoc application (I do believe store distribution type of application will be another issue).
Although I do all the steps mentioned in the lineked documents my builds fails with message "No suitable provisioning file found ..."(yes, I downloaded all necessary provisionig file under Acount dialog using my Xcode installation).
I found this solution - after the first build I open the project on Mac using Xcode (the project file is located under Macintosh HD/Users/MYNAME/.taco_home/remotebuilds/taco-remote/builds/BUILDNUMBER/cordovaApp/platforms/ios). I don't change anything, I only choose Build option from the Xcode menu. The project is build successfuly and since that, I am able to build the project from Visual Studio any time I need. Am I doing anything wrong? I think the compilation directly in Xcode shouldn't be necessary.
P.S. I just found, that new provisioning profile apears on my Mac, once it builds it - it's named "iOS Team Provisioning Profile: APP_ID". Probably, it's somehow related to the issue.
Finally I found the solution when building the app for app-store. It's necessary to specify provisionig file ID in your build.json. file. It's necessary to add this section INCLUDING the provisioningProfile key.
"release": {
"developmentTeam": "XXXXXXXXXXX",
"codeSignIdentity": "iPhone Distribution",
"provisioningProfile": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
"packageType": "app-store"
}
The ID is name of the provisioning file, which is stored on Mac in ~/Library/MobileDevice/Provisioning Profiles/
More info can be found How to build and upload a correctly signed iOS app to App Store and https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

Resources