CapDetect is a recently added Windows Phone 7 Developer Tool; it is in the Developer Tools January 2011 Patch.
What does it do?
It edits your WMManifest.xml file according to your application's needs.
CapDetect is a rule-based command line utility that uses an XML file as a "rule file" and takes output of your project or XAP file as a "file path" parameter. If you provide an output folder then it automatically finds the XAP file.
Use of this utility is as:
CapabilityDetection <rules path> <file path>
The location of this tool is:
For
32 bit users ->
%ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Tools\CapDetectFor
64 bit users ->
%ProgramFiles (x86)%\Microsoft SDKs\Windows Phone\v7.0\Tools\CapDetectLet's use it:
Assuming you have already created a new project and then debugged (XNA or Silverlight doesn't matter).
The first thing you need to do is to run your command prompt and get to the location of CapDetect tool as I described above.
Then write this type of command line:
CapabilityDetection Rules.xml "C:\Users\iersoy\Desktop\WindowsPhoneGame2\WindowsPhoneGame2 \WindowsPhoneGame2\bin\WindowsPhone\Debug"
|
You will need to change the path according to your own application.
Remind one thing!You need to use quotation marks (") before and after writing [file path]Before using this tool I had a WMManifest file just like:
<?xml version="1.0" encoding="utf-8" ?> <Deployment xmlns="http://schemas.microsoft.com/ windowsphone/2009/deployment"AppPlatformVersion="7.0"> <App xmlns="" ProductID="{bfd638f3-4ca0-4043-9871-d34bc559eeb6}" Title="WindowsPhoneGame2" RuntimeType="XNA" Version="1.0.0.0" Genre="Apps.Normal" Author="" Description="" Publisher=""> <IconPath IsRelative="true" IsResource="false"></IconPath> <Capabilities> <Capability Name="ID_CAP_NETWORKING" /> <Capability Name="ID_CAP_LOCATION" /> <Capability Name="ID_CAP_SENSORS" /> <Capability Name="ID_CAP_PUSH_NOTIFICATION" /> <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" /> <Capability Name="ID_CAP_IDENTITY_USER" /> <Capability Name="ID_CAP_IDENTITY_DEVICE" /> </Capabilities> <Tasks> <DefaultTask Name="_default"/> </Tasks> <Tokens> <PrimaryToken TokenID="WindowsPhoneGame2Token" TaskName="_default"> <TemplateType5> <BackgroundImageURI IsRelative="true" IsResource="false"> </BackgroundImageURI> <Count>0</Count> <Title></Title> </TemplateType5> </PrimaryToken> </Tokens> </App> </Deployment>
|
In the following some capabilities are missing because I have deleted 4 Capabilities from my application:
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_PHONEDIALER" />
But the tool has re-added the Capabilities and made some changes in Manifest file inside XAP package.
<?xml version="1.0" encoding="utf-8"?> <Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.0"> <App xmlns="" ProductID="{bfd638f3-4ca0-4043-9871-d34bc559eeb6}" Title="WindowsPhoneGame2" RuntimeType="XNA" Version="1.0.0.0" Genre="Apps.Normal" Author="" Description="" Publisher=""> <IconPath IsRelative="true" IsResource="false"> GameThumbnail.png</IconPath> <Capabilities> <Capability Name="ID_CAP_NETWORKING" /> <Capability Name="ID_CAP_LOCATION" /> <Capability Name="ID_CAP_SENSORS" /> <Capability Name="ID_CAP_MICROPHONE" /> <Capability Name="ID_CAP_MEDIALIB" /> <Capability Name="ID_CAP_GAMERSERVICES" /> <Capability Name="ID_CAP_PHONEDIALER" /> <Capability Name="ID_CAP_PUSH_NOTIFICATION" /> <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" /> <Capability Name="ID_CAP_IDENTITY_USER" /> <Capability Name="ID_CAP_IDENTITY_DEVICE" /> </Capabilities> <Tasks> <DefaultTask Name="_default" /> </Tasks> <Tokens> <PrimaryToken TokenID="WindowsPhoneGame2Token" TaskName="_default"> <TemplateType5> <BackgroundImageURI IsRelative="true" IsResource="false"> Background.png</BackgroundImageURI> <Count>0</Count> <Title>WindowsPhoneGame2</Title> </TemplateType5> </PrimaryToken> </Tokens> </App> </Deployment>
|
This is a very useful command line utility for testing your application before sending it to the MarketPlace.
Hope you like it too!
Ibrahim ErsoyPosted Feb 9, 2011, 6:09 AM
@Mike:Dont Mention it! Thank you for reading. @Pete: GUI for this utility was a nice idea.Well done!
Mike GoldPosted Feb 8, 2011, 11:01 PM
I wasn't aware of this feature. Very useful.
Pete VickersPosted Feb 7, 2011, 7:40 AM
Hi, we at APPA Mundi have developed a FREE GUI interface for the cap detect tool - head over to http://appamundi.com/products/capabilitydetection/ for more details and to pick up a copy Thanks Pete