How to deploy APPX to run Windows Phone emulator?

I am trying to deploy an appx package from C # to a Windows Phone Emulator as shown here:

How to deploy .appx on Windows Phone 8.1

The point is that the method GetDevices()

returns a list of such devices:

  • {devices}
  • {Emulator 8.1 WVGA 4-inch 512MB (ES)}
  • {Emulator 8.1 WVGA 4 inches (ES)}
  • {Emulator 8.1 720P 4.7 inch (ES)}

I don't know why it adds (ES) to the end. After executing the code, the Emulator starts up, but it gets stuck. This does not work.

Can I instead use an already running emulator and select it?

+1


source to share


2 answers


Try it. but first...

PRELIMINARY REQUIREMENTS

  • Windows 8.1+ as an operating system
  • Windows Phone SDK 8.1 installed

I created a batch script (.bat) file to do all the necessary steps. Now I have problems deploying my application. But that could be a starting point.

script:



@echo off
REM SOURCES
REM ------------------------------------------------------------------------------
REM Create a Windows Store AppX package and sign it
REM http://blogs.msdn.com/b/wsdevsol/archive/2014/02/12/create-a-windows-store-appx-package-and-sign-it.aspx
REM How to create an app package signing certificate
REM https://msdn.microsoft.com/pt-br/library/windows/desktop/jj835832(v=vs.85).aspx
REM How to sign an app package using SignTool
REM https://msdn.microsoft.com/pt-br/library/windows/desktop/jj835835(v=vs.85).aspx
REM ------------------------------------------------------------------------------
SET "WINDOWS_KIT_8_1_86X=%PROGRAMFILES(x86)%\Windows Kits\8.1\bin\x86\"
SET makeappxexe = "%PROGRAMFILES(x86)%\Windows Kits\8.1\bin\x86\makeappx.exe"
SET msbuildexe = "%PROGRAMFILES(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
SET "APP_DIRECTORY=%userprofile%\source\repos\MyAwesomeApp\App1"
SET "APP_PACKAGE_DIRECTORY=%userprofile%\source\repos\MyAwesomeApp\App1\AppPackages\"

@echo "building App1 project..."
%msbuildexe% "%APP_DIRECTORY%App1.csproj" /verbosity:quiet

REM App packager(MakeAppx.exe)
REM https://msdn.microsoft.com/en-us/library/windows/desktop/hh446767(v=vs.85).aspx
@echo "Creating APPX from App1 project..."
%makeappxexe% pack /o /v /l /d "%APP_DIRECTORY%" /p "%APP_PACKAGE_DIRECTORY%App1.appx"

REM MakeCert
REM https://msdn.microsoft.com/pt-br/library/windows/desktop/ff548309(v=vs.85).aspx
@echo "Making certificate..."
"%WINDOWS_KIT_8_1_86X%makecert.exe" /n "[PACKAGE.IDENTITY.PUBLISHER] LOCATED AT APPXMANIFEX.XML OR PACKAGE.APPXMANIFEST" /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e "12/30/2016" /sv "%APP_PACKAGE_DIRECTORY%Appp1Key.pvk" "%APP_PACKAGE_DIRECTORY%Appp1Key.cer"

REM Pvk2Pfx
REM https://msdn.microsoft.com/pt-br/library/windows/desktop/ff550672(v=vs.85).aspx
@echo "Making PFX file..."
"%WINDOWS_KIT_8_1_86X%Pvk2Pfx.exe" /f /pvk "%APP_PACKAGE_DIRECTORY%Appp1Key.pvk" /spc "%APP_PACKAGE_DIRECTORY%Appp1Key.cer" /pfx "%APP_PACKAGE_DIRECTORY%Appp1Key.pfx"

REM SignTool
REM https://msdn.microsoft.com/pt-br/library/windows/desktop/ff551778(v=vs.85).aspx
@echo "Signing APPX..."
"%WINDOWS_KIT_8_1_86X%SignTool.exe" sign /fd SHA256 /a /f "%APP_PACKAGE_DIRECTORY%Appp1Key.pfx" "%APP_PACKAGE_DIRECTORY%App1.appx"

REM Deploy Windows Phone 8.1 apps with the Application Deployment tool
REM https://msdn.microsoft.com/en-us/library/dn632395.aspx
@echo "Deploying App1 to emulator..."
"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeployCmd.exe" /installlaunch "%APP_PACKAGE_DIRECTORY%App1.appx" /targetdevice:6
@echo "Deploying App1 to device..."
"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeployCmd.exe" /installlaunch "%APP_PACKAGE_DIRECTORY%App1.appx" /targetdevice:de

      

You can also create your project (it will generate Appx automatically) and use Autogenerated Appx to deploy to an emulator or device like this:

SET "APP_DIRECTORY=%userprofile%\source\repos\MyAwesomeApp\App1"
SET "APPX_PATH=%userprofile%\source\repos\MyAwesomeApp\App1\AppPackages\App1_1.0.0.0_x86_Test\App1_1.0.0.0_x86.appx"

@echo "building App1 project..."
"%PROGRAMFILES(x86)%\MSBuild\14.0\Bin\MSBuild.exe" "%APP_DIRECTORY%\App1.csproj" -t:Rebuild -p:Configuration=Release;BuildPlatform=x86 /verbosity:minimal /nologo

REM Deploy Windows Phone 8.1 apps with the Application Deployment tool
REM https://msdn.microsoft.com/en-us/library/dn632395.aspx
@echo "Deploying App1 to emulator..."
"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeployCmd.exe" /installlaunch "%APPX_PATH%" /targetdevice:6
@echo "Deploying App1 to device..."
"C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeployCmd.exe" /installlaunch "%APPX_PATH%" /targetdevice:de

      

Hope this helps you, but if you've already found a solution please let me know.

+2


source


you can try using the Application Deployment Tools (XapDeploy.exe), for more information you can follow this link: https://msdn.microsoft.com/en-us/library/windows/apps/ff402565(v=vs. 105) .aspx

Step by step:



  • You can also use the Windows Phone Application Deployment Tool (XapDeploy.exe) to deploy your application. This tool is a standalone application that is installed when you install the Windows Phone SDK.
  • You can use the version of the Application Deployment Tool installed in the C: \ Program Files (x86) \ Microsoft SDK \ Windows Phone \ v8.0 \ Tools \ XAP Deployment folder to deploy applications targeting Windows Phone OS 8.0 or Windows Phone OS 7.1. You can only use the version of the Application Deployment Tool installed in the C: \ Program Files (x86) \ Microsoft SDKs \ Windows Phone \ v7.1 \ Tools \ XAP Deployment folder to deploy applications targeting Windows Phone OS 7.1.
  • To deploy an application using the Application Deployment Tool
  • Create your application.
  • If you are deploying your app to a connected device, make sure you meet the prerequisites listed earlier in this section. From the Windows Start screen, launch the Application Deployment tool. You can find the Application Deployment tool by opening the All Applications View and find it under the Windows Phone SDK 8.0 group, or by typing Application Deployment on the Start screen to find it.
  • You can also run the tool from the following location: C: \ Program Files (x86) \ Microsoft SDK \ Windows Phone \ v8.0 \ Tools \ XAP Deployment \ XapDeploy.exe
  • From the Target drop-down list, select one of the emulator options.
  • Click Browse and locate the XAP file you want to deploy.
  • Click Expand.
  • If the deployment is successful, the Status field displays the XAP filling.
+1


source







All Articles