Building UWP app from command line

2

I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?

There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.

UPDATE

I've managed to build it and create app packages with command line, here is command I used:

msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true

It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error

Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)

I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?

And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.

UPDATE

I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.

build
uwp
asked on Stack Overflow Feb 8, 2016 by Mateusz Cisek • edited Feb 11, 2016 by Mateusz Cisek

1 Answer

1

Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653

Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.

Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.

Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild

See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx

answered on Stack Overflow Feb 11, 2016 by Shafiq Abbas • edited Feb 12, 2016 by Shafiq Abbas

User contributions licensed under CC BY-SA 3.0