views:

64

answers:

2

I have a unit testing framework for WP7 and it runs on the phone. The results are fairly hard to read so I am writing them to an XDocument.

My question is, how can I then get this XML file off of the phone and onto my desktop where I can actually analyze the results?

What I have done so far is to put a Debugger.Break() line right after where the summary xml is created. I can then copy/paste the xml out of VS or inspect it right in the debugger. The problem is though, that if you don't already have a debugger attached (which is good when lots of ExpectedException tests) Debugger.Attach() seems to not work, also manually attaching VS to the emulator processes seems to do nothing.

I tried running the emulator with some extra command line parameters so I could try to see if I could get it to use my actual hard drive as it's own disk but I couldn't seem to get it to work...

PS it's probably not reasonable to pop open a new process such as a webserver to listen for this data. I know how to do that, I would just rather not.

So how the heck do you get stuff off of these phones??

+2  A: 

Have a look at this article about emulator automation from Justin Angel.
It includes details on how to remotely read and write files from/to emulator/device isolated storage.

As you pointed out the other alternative would be to have the applciation send the results to a [local] web server.

Matt Lacey
That looks a lot more complicated than I was hoping but I think it will work. The private reflection is a little worrying... I guess I'll have to create a test running app too.
justin.m.chase
A: 

The article by Justin Angel is really great, but unfortunately his file-based solution does not work on the final RTM versions of the CoreCon API. Microsoft has simply removed that functionality from the native conman layer.

I've been in the same situation as you and have contemplated various ways to get data out of the device, but in the end only one thing seems to work: as you suggest yourself, pass data to an external webservice.

That solution is less than ideal not only because it takes some effort, but also because of a few caveats:

  • your app must be granted ID_CAP_NETWORKING capability
  • network-traffic seems disallowed in the Application_Closing event, and maybe elsewhere too

On the bright side I found that webrequests from the phone, both hardware and emulator, were really fast so the approach works very well (our app is EQATEC Profiler for WP7).

Richard Flamsholt
thanks for that info, probably saved me some time investigating.
justin.m.chase