Yes, most definitely.
I currently have 2 GSD's in my apartment. One is a pretty laid back guy but my female is extremely high energy, very high drive and needs a lot of physical and mental stimulation.
We train 2-4 times per week (schH and agility) and hike at least 1 time per week with daily walks and play sessions.
I do allow my dogs to play a bit in the house due to not having a yard, but they are not allowed to run around or anything.. just a bit of tug or mouth sparring or chasing a ball around with us interacting with them.
My potty time is a walk around our block (20mins) a few times per day.
Today they stayed inside with me all day long with a few potty breaks (no walk, just potty and right back inside) due to me hurting my back. They slept and sat outside on our balcony and watched the people and squirrels go by....
As long as YOU make the commitment to do your part, they will be fine.
One good thing about living in an apartment, is having lots of people, kids, elderly, dogs and elevators, smells, noises, etc.. to socialize your dog with all at your doorstep!