Forum Visual Studio

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Generate Android Apk

cjacquelcjacquel FRMember ✭✭✭

Hello,
Is it possible to generate the Android Apk with Visual Studio for Mac ?
Thx,
Christophe

Posts

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @cjacquel

    It should be. Try using the "Archive for Publishing" menu. You can right click on the project and select Archive for Publishing or that option is also under the Build Menu.

  • What I do instead is to just run the app on a simulator in Release mode. This forces the IDE to generate the APK for installation. I then deploy that APK to wherever I want.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    Yes, deploying the app to sim or device in Release configuration will generate an APK as well.

  • SmartmanAppsSmartmanApps AUMember ✭✭✭

    @ShawnCastrianni.5092 said:
    What I do instead is to just run the app on a simulator in Release mode. This forces the IDE to generate the APK for installation. I then deploy that APK to wherever I want.

    Awesome! I wish this was more widely documented!

  • HumbleArchitectHumbleArchitect USMember ✭✭

    Is it possible to have the APK automatically generated when the project builds? The reason is to help with automating CI and not have to write additional code for the Xamarin UITests IApp configuration.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai
    edited June 2020

    It should be. There ios a build property you can set to true. See:
    https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-process#packaging-properties

    Scroll down a bit and you will see the property AndroidBuildApplicationPackage. Set this to true and a signed package should be created. Add the following to your build command:

    /p:AndroidBuildApplicationPackage=true
    

    Or you can add it to the .csproj property group for the desired configuration:

    <AndroidBuildApplicationPackage>true</AndroidBuildApplicationPackage>
    
Sign In or Register to comment.