47

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?

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
Wassim
  • 501
  • 1
  • 4
  • 5
  • Does this answer your question? http://stackoverflow.com/questions/19195004/is-xamarin-studio-supposed-to-generate-an-apk-when-compiling-for-debug-target – kenny_k Aug 09 '16 at 16:13

5 Answers5

53

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:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/#Compile

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:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_2_-_signing_the_android_application_package/

Note: if you do not use a signed APK, you will probably get a parse error if try to install on an Android device.

Maikel Willemse
  • 683
  • 2
  • 8
  • 10
27

Try The Following Steps:

  1. You need to change Your Project Mode from debug to release.

  2. Rebuild your project.

  3. 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

Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
Mohamad Mahmoud Darwish
  • 3,865
  • 9
  • 51
  • 76
12

Firstly your project should be in Release Mode Then simply Right Click on your android Project and select "Export Android Package (.apk)"

enter image description here

Your .apk file will be created in your project directory

Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
Ganesh Parikh
  • 244
  • 2
  • 14
4

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

jfmg
  • 2,626
  • 1
  • 24
  • 32
1

Steps to Create APK in Visual Studio 2022:

  1. Build app in RELEASE mode.
  2. Right Click on Android Project > Properties > Android Options > Uncheck “Use Fast Deployment”, if checked.
  3. Right Click on Android Project > Archive.
  4. Distribute > AdHoc > Add signing Identity by clicking on "+" icon and fill the details as shown in image below.
  5. Save the app and you’re done.
Saksham Chaudhary
  • 519
  • 1
  • 4
  • 14