This is the complete answer. The following must be taken into account:
- I don't have Visual Studio installed on the macbook. I also have less than 3 gigs of free space, so installing it is not an option at the moment.
- From Visual Studio (on the PC) I can't upload the app to App Store Connect, it always gives me an error.
Prerequisites on the mac:
- Have a default project in Xcode with the same Blundle ID as Xamarin.Forms project (Visual Studio PC).
- Correctly select the Team in Signing & Capabilities.
- Have an iPhone connected.
These are the steps to follow on the PC:
- Pair Visual Studio to the macbook.
- Select the connected iPhone on the macbook. In Visual Studio it will appear as Connected via network.
- Archive the app. In Visual Studio you have to right-click on the iOS project and select Archive....
- When it has been archived, in the Archive Manager, press the Open Folder button.
You have to copy the folder xxxxxxxxxxx.xcarchice, for example to a pendrive.
Steps to follow on mac:
- Open the Archives folder in Finder: Library > Developer > Xcode > Archives.
- If it does not exist, create the folder with today's date in the format "YYYY-MM-DD", for example: 2021-11-05.
- Paste the .xcarchive folder previously copied into the folder that has just been created.
- Double click on the .xcarchive.
The archive should appear in the Archives window (Xcode > Window > Organizer).