How to create a binary from a monogame project - xamarin

I'm making a simple Pong game on a Mac using Xamarin and Monogame, however I can`t find a way to export into a binary such as a .exe or a .app. Can it be done?

The answer is yes.
The procedure is pretty similar on both Android and iOS.
Android
Switch your project over to Release mode
If you are using any Google Play Services (maps and such), make sure to use your own keychain, which can be defined in the Project Options under Android Package Signing
Build the project
Right click and select Archive for Publishing
A new window will appear where you can sign and distribute your app
Upload to Google Play Store or any other relevant store
For iOS the steps are similar
Make sure you have created an App Name and provisioning profiles in the Apple developer center
Make sure Identifier of your app matches the registered one in the Info.plist of the app
Switch to AppStore or Ad-Hoc depending on the way you want to distribute your app
Build your project
Right click and select Show IPA on Build Server (Visual Studio) / in Xamarin.Studio on Mac you can select Archive for Publishing and get the IPA.
Upload the IPA to iTunesConnect or HockeyApp or whatever distribution method you are using
For more in depth documentation, please refer to Xamarin's official documentation for Android and for iOS.

Sorry for not quite understanding your question at the first time.
If you build the game on a Mac, I am not sure there is a way to export .app. However, I recommend you load your Xamarin project into Xamarin Studio or Visual Studio on Windows. Then you can get the iOS version and windows binary at the same time. However, for windows version you could only get .appx output, which is the winRT counterpart to the traditional desktop .exe.
Take Visual studio as an example,
If you want to export windows output, please follow steps below:
right click on your project's xamarin.Windows(UWP or Windows8.1) folder and select "store"
Select "No" for the prompt dialog about whether to upload to store
Follow the instructions till the end. Then get the .appx file under your project's AppPackages folder
And what's more, even if you just need to share with several people, HockeyApp is still a good option for you regarding the distribution trouble and version control trouble it can save for you. You can take a trial here.
Please let me know if this can help.

Related

Publish my project from Android Studio to App Store - Section Build

I use Android Studio on my MacOS M1.
My project is finished and everything works, either with Android simulators or iOS simulators via Xcode.
I would now like to publish my project on App Store.
I already have my subscription on App Store Connect, and I have already prepared my program submission with screenshots, title and description.
What I don't understand is how to upload my build to the App Store? How do I create my Build?
Do I have to import my project to XCode? If yes, how ?
I saw that in the Build section, there are 3 tools, the first one is called “Upload your app binary with Xcode”, how to go about it?
I'm lost, please help me.
CB

Visual Studio for Mac creates 2 .apk archives, one with -signed.apk

When I create a release archive of a Xamarin Android app in the latest release of Visual Studio for Mac (8.1.3 build 19), I end up with two .apk's, with filenames like:
com.whatevs.android.apk
com.whatevs.android-signed.apk
Why does it do this? What can I change in my project setup to prevent it? If it can't be prevented, then which one is the appropriate file to upload to Google Play?
This actually used to be a problem a year ago or so, but went away, and now it's back...
The major differences are the debug flag and the signing keys, I guess. You can read more about signing here and manually signing here.
This happen when you build the app and create an archive for publishing with a physical device selected in Visual Studio for Mac as target device.
Select an emulator, Build all and Archive for publishing.

Deploy Xamarin iOS App via Visual Studio for Windows

I want to deploy my first iOS App created with Xamarin Forms to the AppStore or at least to a single device. I have an Apple Developer Account and performed this task several times before using xCode and native iOS Apps.
But as a Windows guy I hoped to get this done for Xamarin using my VST for Windows. 
But all guides and tutorials I found are only explaining how I can deploy iOS Apps to the store and to devices using VST for Mac ... Is this the only way? How do I get the code to the Mac? Can I use the TFS Source Control? Do I have to commit every little change to TFS, check it out at the Mac, rebuild the whole app there and deploy it from the Mac?
Or are there ways and workflows that work with Windows only having the Mac 'in the background' via network?
Take a look at https://mobile.azure.com (the best solution for continuous app development: analytics, crash reports, iOS/Android/UWP builds + deploy)
I'll address the second part of your question - the ability to deploy to a single device. I'm assuming that the single device is your own device and you want to deploy via compilation. This can certainly be done from your Windows machine but due to apple licensing requirements, you will need your Mac available to compile and deploy to your phone. Your iPhone/iPad will need to be plugged into your Mac's USB.
The guides listed on the Xamarin website outline how to set up the mac build host. https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/ In short, you need some prerequisites (Remote Sharing turned on, XCode installed, etc).
Once you've connected Visual Studio to your Mac, set the iOS project as the startup project, change the config from Debug to iPhone, and press F5 to compile and deploy to your device.
When in doubt, select iPhoneSimulator instead of iPhone. The simulator isn't subjected to provisioning and signing profiles which can be daunting to setup. If you can get the simulator working, you've solved the software and connectivity prerequisites.
There's a lot to configure, but it does work. This is my primary setup for Xamarin.Forms development.

Xamarin Windows Phone Store Package

I' am in a bit of truble at the moment.
I try to build my Xamarin Windows Store App for publishing, but the Create App Packages Wizard, wont open I tried many solutions from the web, like unloading and reloading the project, or making a new project. But the wizard does not open with my solution i treid a normal Windows Phone app(no Silverlight), that worked but i could not Port my xamarin project to a standard Windows Phone App.
Has someone encountered a similar issue with Xamarin and Windows Phone,
or can anyone help to get my app into the Appstore?
Thanks.
I would have asked in the Xamarin Forum, but I cant reach them siche this morning.
And sorry for the engrish.
To submit package to the windows phone store you'll need to build your project (for ARM in Release mode to avoid warnings). Then on developer site when there is button to upload package you have to attach *.xap file from your project's bin\release folder (or bin folder you have specified). Then you can go through the next windows phone store app submitting steps.

Xamarin Forms project set Startup Project

I'm building a Xamarin Forms application for Android and iOS.
How can i set iOS as startup project? I've read that your suppose to rightclick and set it as startup project. But i can't find the option?
Please help me.
You need to change your configuration options to something you have connected. This happens if you were originally debugging directly on an iPhone connected to your Mac, and now the iPhone is gone. Xamarin Studio doesn't switch automatically to the iPhone Simulator when a device is not detected, instead removes the option to use that project as a startup project.
To fix, do this:
Right click on the iOS project and go to Options
Under Build->Output, select the "All Configurations" under the drop down
Under the Platform drop down, select "iPhone Simulator"
Click Ok to save
Now on the top left corner of Xamarin Studio where you can set Debug or Releas, make sure you set it to Debug | iPhoneSimulator and NOT to Debug | iPhone
... and only then, you'll be able to select "Set As Startup Project".
So much depends on your operating system and which environment you are using. If you are on Xamarin Studio on a Mac, right clicking should work fine. Can you possibly give us a bit more information?
Do you have XCode and iOS SDKs from Apple installed? Do you have an iOS development account? You need both of these things, then click on the project's options and pick a development account to use for the project.
You may not have the iOS license and may not be able to run the iOS project at all, although in such cases on my machine the project is grayed out and clearly labeled.
Are you on Windows? If so you won't be able to run iOS projects. The shortcut labels indicate Mac, so does the context menu shape.
Have you been able to run any iOS projects? Try creating a new blank solution with just an iOS project in it to see if it runs.
There is a chance this is a bug with Xamarin's localization in your language (Swedish?)
Try switching your locale to US/English and file a bug with Xamarin or at least send them an email

Resources