Run app on Windows Phone 10

Hello,

I purchased a Lumia 640 LTE and upgraded it to Windows 10 Mobile to test my app on. I’ve enabled Developer Mode and Device Discovery on the device, and I thought it would be smooth sailing from then on. Android has the easy “Build and Run” option and even has Unity Remote, but I can’t seem to find how to test my Windows Store app on my Windows Phone. I’ve searched the internet for articles about Unity and Visual Studio and they are either about Windows Phone 8.x or debugging on a computer, not a Windows Phone (I don’t really care if it’s debugging or a built app).

Does anybody have any solutions?

Thanks in advance ;).

Connect phone to your computer via USB cable, build for ARM architecture in Visual Studio and you should be able to run your app on device.
You can also use Build and Run, just select phone in Build Settings window.

I actually found a process of creating the app packages inside of Visual Studio and using the command line (WinAppDeployCmd.exe) to install the .appx(bundle) file on the device. This might be what you are talking about.

I see now that “Unity C# Projects” was disabling the Build and Run option. I can now attempt to build, but I get this error

Exception: Failed to build Visual Studio project using arguments 'C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe "C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off.sln" /nologo /maxcpucount /p:Configuration=Release /p:Platform=x86 /p:SolutionDir="C:\\Users\\_user_\\Desktop\\Knock-Off Windows Builds\\Build 0.0.8 alpha\\" /t:Build /clp:Verbosity=minimal'.
Output:  UnityInstallationDir "C:\Program Files\Unity\Editor".
  UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".
  UnityProjectDir "D:\Knock-Off\Knock-Off game".
  Copying unprocessed assemblies...
  Running AssemblyConverter...
  AssemblyConverter done.
  Knock-Off -> C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\bin\x86\Release\Knock-Off.exe
Package.appxmanifest(18,51): error APPX0703: Manifest references file 'Assets\Square150x150Logo.scale-200.png' which is not part of the payload. [C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(19,49): error APPX0703: Manifest references file 'Assets\Wide310x150Logo.scale-200.png' which is not part of the payload. [C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(18,110): error APPX0703: Manifest references file 'Assets\Square44x44Logo.scale-200.png' which is not part of the payload. [C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(8,6): error APPX0703: Manifest references file 'Assets\StoreLogo.scale-100.png' which is not part of the payload. [C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(24,27): error APPX0703: Manifest references file 'Assets\SplashScreen.scale-200.png' which is not part of the payload. [C:\Users\_user_\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\Knock-Off.csproj]

when trying to build the game.

I got the same error in Visual Studio, but I fixed it by removing “.scale-###” from each reference file in the .appxmanifest. I don’t know how to fix this in Unity because (to my knowledge) Unity creates the .appxmanifest by itself.

After enabling C# projects you have to build to an empty directory, otherwise you’ll get a corrupted VS solution.
I appears you have a Unity version that is not latest, we have fixed a bug with those images.

The Assets directory in Unity?

Also, are you referring to Unity 5.4 beta? Because I believe I have the latest stable version.

Thanks.:wink:

No, in Build Settings window click Build and select an empty folder. Then open VS solution and build from there.

The build succeeds when I build it from Visual Studio, but in both empty and previously used folders, “Build and Run” from Unity fails every time with the same error I got before.

Can you provide the full output of that failure with all details?

The image shows my player settings.

This is the error I get in the console

Exception: Failed to build Visual Studio project using arguments 'C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe "C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off.sln" /nologo /maxcpucount /p:Configuration=Release /p:Platform=x86 /p:SolutionDir="C:\\Users\\user\\Desktop\\Bomb Dodge Windows Builds\\Build Folder\\" /t:Build /clp:Verbosity=minimal'.
Output:  UnityInstallationDir "C:\Program Files\Unity\Editor".
  UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".
  UnityProjectDir "D:\Knock-Off\Knock-Off game".
  Copying unprocessed assemblies...
  Running AssemblyConverter...
  AssemblyConverter done.
  Knock-Off -> C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\bin\x86\Release\Knock-Off.exe
Package.appxmanifest(18,51): error APPX0703: Manifest references file 'Assets\Square150x150Logo.scale-200.png' which is not part of the payload. [C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(19,49): error APPX0703: Manifest references file 'Assets\Wide310x150Logo.scale-200.png' which is not part of the payload. [C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(18,110): error APPX0703: Manifest references file 'Assets\Square44x44Logo.scale-200.png' which is not part of the payload. [C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(8,6): error APPX0703: Manifest references file 'Assets\StoreLogo.scale-100.png' which is not part of the payload. [C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\Knock-Off.csproj]
Package.appxmanifest(24,27): error APPX0703: Manifest references file 'Assets\SplashScreen.scale-200.png' which is not part of the payload. [C:\Users\user\Desktop\Bomb Dodge Windows Builds\Build Folder\Knock-Off\Knock-Off.csproj]

The build gets to “Building solution with Visual Studio version 14.0.”, “Done.” and then I get the error.

Tell me if you need any more details about the error.

Thanks.

Yeah, you need to change the manifest and remove that “scale” part, this looks to be a regression we introduced in latest patch releases. Apologies.

Is there a way I can do that to a manifest template before Unity compiles it, or do I simply have to make the build in VS every time? That’s alright.

Thanks for your help!

If you modify manifest, Unity will not overwrite it, when you build on top of existing solution. So Build&Run should work for any further runs.

The error about the manifest went away as expected, but now I’m getting deployment errors.

Exception: Failed to build Visual Studio project using arguments 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com "C:\\Users\\__user__\\Desktop\\Knock-Off Windows Builds\\Build 0.0.8 alpha\Knock-Off.sln" /deploy "Release|x86"'.
Output:
Microsoft Visual Studio 2015 Version 14.0.25123.0.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: Knock-Off, Configuration: Release x86 ------
1>  UnityInstallationDir "C:\Program Files\Unity\Editor".
1>  UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".
1>  UnityProjectDir "D:\Knock-Off\Knock-Off game".
1>  Copying unprocessed assemblies...
1>  Running AssemblyConverter...
1>  AssemblyConverter done.
1>  Knock-Off -> C:\Users\__user__\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\bin\x86\Release\Knock-Off.exe
2>------ Deploy started: Project: Knock-Off, Configuration: Release x86 ------
2>DEP4010 : Deployment canceled by user.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========


ApplicationLauncherImpl.RunVS2015 (System.String args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:325)
ApplicationLauncherImpl.RegisterLayoutOnLocalMachineUsingVS2015 () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:239)
ApplicationLauncherImpl.Run () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:195)
ApplicationLauncher.BuildAndRun (BuildLaunchPlayerArgs args, WSASDK wsaSDK) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:59)
ApplicationLauncher.BuildAndRun (BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:46)
UnityEditor.Metro.BuildPostprocessor.LaunchPlayer (BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:95)
UnityEditor.PostprocessBuildPlayer.Launch (BuildTarget target, System.String path, System.String productName, BuildOptions options) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:282)
UnityEditor.HostView:OnGUI()

I’m not cancelling the build though. I think it could have something to do with the configuration as release x86, but it fails on both “Windows Phone” and Local Machine and Windows Phone" for the “Build and Run on” setting, and I have “Development Build” activated.

I also get the error twice, but the second seems to be the same as the first.

Exception: Failed to build Visual Studio project using arguments 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com "C:\\Users\\__user__\\Desktop\\Knock-Off Windows Builds\\Build 0.0.8 alpha\Knock-Off.sln" /deploy "Release|x86"'.
Output:
Microsoft Visual Studio 2015 Version 14.0.25123.0.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: Knock-Off, Configuration: Release x86 ------
1>  UnityInstallationDir "C:\Program Files\Unity\Editor".
1>  UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".
1>  UnityProjectDir "D:\Knock-Off\Knock-Off game".
1>  Copying unprocessed assemblies...
1>  Running AssemblyConverter...
1>  AssemblyConverter done.
1>  Knock-Off -> C:\Users\__user__\Desktop\Knock-Off Windows Builds\Build 0.0.8 alpha\Knock-Off\bin\x86\Release\Knock-Off.exe
2>------ Deploy started: Project: Knock-Off, Configuration: Release x86 ------
2>DEP4010 : Deployment canceled by user.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Thanks.:wink:

x86 when running on phone? That certainly is not correct.
TBH, I find the most reliable way of running an app is doing it from Visual Studio. I keep it open, just build from Unity on top of existing solution, then go to VS and continue from there.

Edit: remember to unlock your phones screen.

Yeah, and I don’t know why it is occurring. I’ll probably find a solution later, but building on VS is probably the easiest and most reliable, even if it’s not the fastest. This might be a stupid question, but is the solution I open when opening a script in Unity, the same as the one built? I always find the VS solution produced by the build in File Explorer and build and deploy from that. But building from the solution that is already open is much faster.

And yes, I make sure the phone doesn’t lock itself back down by keeping my finger on the screen:p.

Thanks again.

No, it is not.
However, you can check “Unity C# projects” in Build Settings and the generated solution will have projects with your scripts (You’ll have to build to an empty directory for those projects to appear).
Such way you’ll be able to do modifications to your scripts and just build from VS. There is one limitation though: if you make a script change that alters serialization layout (like adding public/serializable variable to script), you’ll have to do build from Unity, because Unity data has to be rebuilt.

Oh, okay. So “Unity C# projects” seems like it’s only for minor tweaking, and not core scripting.

Thanks for your help! If I (can) change the default build target in the VS solution to ARM (like in Options > Tools for Unity or something), will Unity override it if I build in the same solution?

No, I believe these settings are stored in a separate file Unity doesn’t generate, so architecture, configuration, open files etc. are usually preserved when overwriting.

1 Like

Thanks. I’ll try to find that specific setting, because if I can change it, I might could change that setting to an architecture that I’m going to continually use for a while. That might fix my glitch.