1. Start the emulator using the Device Emulator Manager API

To programmatically start your emulator you'll need to utilize the Device Emulator Manager (DEM) COM API. To do so from .NET, you'll want to use the Microsoft.DeviceEmulatorManager.Interop.9.0.dll Primary Interop Assembly, which should be found here (assuming your OS is 64 bit): C:\Program Files (x86)\Microsoft Device Emulator\1.0

2. Execute the target app remotely using RAPI or RAPI2

Once you've guaranteed that your emulator is both running and "docked", you can proceed to interact with it via the Remote API (RAPI), allowing you to upload your compiled executable to the device and execute it remotely. Here are a few examples of RAPI use:

While this is a well-researched answer that contains good information, it doesn't actually answer the original question of "how do I rebuild and deploy from the command line". Just calling devenv is a whole lot less steps and does what the questioner was after.
–
ctackeJan 4 '11 at 2:15

@ctacke: Yes, it does appear that I've misinterpreted the OP's question; I figured he was looking for what I was after, which was a means of automatically deploying a compiled application without any dependency on the source files or msbuild/devenv/etc. Perhaps I should post a question of my own and move this answer over to it?
–
CharlesJan 4 '11 at 16:53

yes, if you had the question and it's not on here, ask it and answer yourself.
–
ctackeJan 4 '11 at 20:41