What powers an aircraft prior to the APU being switched on?
Other than the APU, there are multiple ways to provide electrical power to an aircraft:


Battery: The battery is typically the first thing you would turn on and it usually provides DC power to emergency systems only (at least on an airliner, smaller aircraft are fully powered by the battery). Running only on battery power will however deplete the battery quickly. The battery can also be used to start the APU.
Ground Power: Most (maybe all) airliners can accept a connection to a Ground Power Unit (GPU), which will supply AC electrical power to run all aircraft systems on the ground. These can be either mobile units (typically powered by Diesel):


(source)

or direct cable connections to the airport power grid:


(taken from this question)
Engine: This would be the method of last resort, but you can run an engine to provide electrical power via its generator. Note however that starting a jet engine would typically require bleed air from the APU or an Air Start Unit (ASU). Some turboprops can run an engine with a stopped propeller to provide power (Hotel mode). The engines also provide all electrical power during the flight, which is also used to re-charge the battery.


Running an APU on the apron is typically discouraged or restricted1 by the airport because of the noise and pollution. It does however provide one advantage over ground power: the APU also supplies bleed air to the air conditioning systems. Without it, air conditioning is only possible via a Pre-Conditioned Air (PCA) hose. See What is this tube connected to a 757 for? for details.

The APU is usually switched off after starting the main engines. It can however be used in the air on some aircraft. See In what conditions is the APU used in midair? for details.



1 Some airports have restrictions on when an aircraft is allowed to run the APU, e.g. Amsterdam:


  The use of aircraft APU is forbidden in these stands in the period between 2 minutes after blocks for the arrivals and 5 minutes before off blocks for departure.


The APU will still be used to start the main engines during push-back.