Validate an app package in automated builds by using Team Foundation Server

 

Applies to Windows and Windows Phone

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

  1. Unload the project file to make it editable.

  2. 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="&quot;$(TargetPlatformSdkPath)App Certification Kit\appcert.exe&quot; reset" />
        <Exec Command="&quot;$(TargetPlatformSdkPath)App Certification Kit\appcert.exe&quot; test -apptype windowsstoreapp -packagefullname &quot;$(AppxPackagingOutputForWinACK)&quot; -reportoutputpath &quot;$(ProjectDir)$(outdir)ValidationResult.xml&quot;" />
        <Exec Command="copy &quot;$(userprofile)appdata\Local\Microsoft\appcertkit\ValidationResult.htm&quot; &quot;$(ProjectDir)$(outdir)ValidationResult.htm&quot;" />
      </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.

  3. Automate your builds by using the guidance in the following topic: Build and test a Windows Store app using Team Foundation Build.

  4. 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.

    Important

    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.

See Also

How to test your app with the Windows App Certification Kit
Build and test a Windows Store app using Team Foundation Build