The iPhone has an internal battery with a variable lifespan. The drain on a battery is in direct relation to how often a user is accessing services, listening to music, talking, texting or accessing the Internet. The more frequent the use of an iPhone, the faster the battery will drain. However, to recharge an iPhone, you do not need to plug it into an outlet. It is possible to charge an iPhone's battery directly from a Mac, and the process is very simple.
Turn on the Mac. Take the Mac out of standby or sleep mode—if applicable—to connect the phone to be charged. The Mac does not need to be actively in use, but for the iPhone to receive a charging signal from the computer, it must be on and ready for use.
Plug the iPhone into the computer--not the keyboard--using the USB connection cable. The phone will not charge if the connector is plugged into the keyboard, which also has a USB connector. Make certain that the connectors are secure for both the phone itself and the USB port connected to the Mac.
Verify that the phone is charging by observing the battery icon on the upper-right corner of the screen. If the iPhone battery is drained to the point where the phone is powered off, a larger battery icon with a red display may appear on the screen, but will still show the phone is charging. After approximately 10 minutes, the battery will retain enough of a charge to turn the phone back on, but will still need to remain plugged in to complete the charging cycle.
Remove the phone from the charging cable after about an hour and the battery should be completely charged and ready for use.
Things You'll Need
USB connection cable
Mac computer with USB port
iPhones will charge faster if no other USB devices are plugged in and in use. iPhones have a battery monitor setting to advise users of how much drain is occurring on a battery at any point, and can help manage the lifespan of a battery.
iPhone batteries were not meant to last forever, and may require replacement. If a battery will not hold a charge, it might be time to get a new one.