Reputation: 551
I have a Xamarin.Forms project that I'd like to distribute as an apk
; however I cannot find how to generate a .apk
file in Visual Studio - how would I do this?
Upvotes: 52
Views: 109176
Reputation: 637
Steps to Create APK in Visual Studio 2022:
Upvotes: 4
Reputation: 4175
Try The Following Steps:
You need to change Your Project Mode from debug to release.
Rebuild your project.
Go to Solution Explorer -> Android project (right click) --> Archive --> Distribute -- AdHoc --> Sign & Add Details --> Save As
The APK is Ready To Publish in Play Store
Upvotes: 29
Reputation: 244
Firstly your project should be in Release Mode Then simply Right Click on your android Project and select "Export Android Package (.apk)"
Your .apk file will be created in your project directory
Upvotes: 12
Reputation: 2666
You can find your APK or IPA file in your bin folder from your project. So in Android it is located here: Project.Droid/bin/MyAppName.apk
This might not be the case when you build with the App Store configuration or maybe there are other problems with the Xamarin IDE. In that case you can do a right click on your project and choose Archive for Publishing which will save your artefact here ~/Library/Developer/Xamarin/Archives/
. Alternatively right click on your project and choose View Archives
Upvotes: 5
Reputation: 713
When using Visual Studio 2015 Update 3 with the latest Xamarin tools (which is v4.2.2.6 when writing this answer), right click your Android project and select "Archive..." as described here:
This will open the Archive Manager and begins the process of archiving the App bundle. When the archiving is finished, you can click on the button "Distribute..." at the right bottom corner of the Archive Manager to create a signed APK. This is described here:
Note: if you do not use a signed APK, you will probably get a parse error if try to install on an Android device.
Upvotes: 56