Yes you can. You want to do a targetless compile to a .bin file.
Go to Options - Project Options and select your board in the Targetless tab.
Then change the Default Compile Mode on the Compiler tab to Compile defined target configuration to .bin file.
Hit F5 to compile using the Project Options configuration. A .bin file will be created in the same directory as your program.
You will not be able to debug without the device attached.