Possible Duplicate:
How do I keep my Android 4.0.3 phone awake when USB connected?
Is it possible to configure my S2 so that when it is plugged in, the phone doesn't go into standby?
Possible Duplicate:
How do I keep my Android 4.0.3 phone awake when USB connected?
Is it possible to configure my S2 so that when it is plugged in, the phone doesn't go into standby?
What version of Android are you running? In CyanogenMod and other versions look in SETTINGS > DEVELOPER OPTIONS > STAY AWAKE / KEEP SCREEN ON WHILE CHARGING
You might also want to take a look at this app, if the options aren't available to you.
Seems like this question has been answered earlier - How do I keep my Android 4.0.3 phone awake when USB connected?