Validate an app package in automated builds by using Team Foundation Server
To make certification as smooth as possible, validate your app against devices that you plan to target before you submit it for certification and listing in the Store. If you're using Team Foundation Build, you can automatically run validation tests in the Windows App Certification Kit (ACK) by modifying project files and settings on the build machine. In addition, you don’t need to change any build definitions.
To integrate Windows ACK validation with Team Foundation Build
Unload the project file to make it editable.
Copy the following PostPackageEvent target, and then paste it near the end of the file, next to the pre-build and post-build targets.
<Target Name="PostPackageEvent" AfterTargets="_GenerateAppxPackage"> <ReadLinesFromFile Condition="Exists($(AppxPackagingInfoFile))" File="$(AppxPackagingInfoFile)"> <Output TaskParameter="Lines" PropertyName="AppxPackagingOutputForWinACK" /> </ReadLinesFromFile> <Exec Command=""$(TargetPlatformSdkPath)App Certification Kit\appcert.exe" reset" /> <Exec Command=""$(TargetPlatformSdkPath)App Certification Kit\appcert.exe" test -apptype windowsstoreapp -packagefullname "$(AppxPackagingOutputForWinACK)" -reportoutputpath "$(ProjectDir)$(outdir)ValidationResult.xml"" /> <Exec Command="copy "$(userprofile)appdata\Local\Microsoft\appcertkit\ValidationResult.htm" "$(ProjectDir)$(outdir)ValidationResult.htm"" /> </Target>
The output file, ValidationResult.xml, will be written to the path in –reportoutputpath. If you specify a static location rather than $(outdir), ensure that the directory exists before you queue the build, and delete the output file before you queue the build again.
Automate your builds by using the guidance in the following topic: Build and test a Windows Store app using Team Foundation Build.
When the build finishes, review the test results in the ValidationResult.htm file. The test results appear in the last entry of the PostPackageEvent target that you previously pasted into the ValidationResult.htm file.
The build doesn’t pass or fail based on the result of the validation. You must view the test results to know whether the app has validation errors.