If posts are being secured to cement footers, like the example below, they are always installed first and before the walls go up. That way you can make sure they are plumb (vertically level).
Notice the two 2″ X 4″ posts against the house to provide support for the walls. These posts did not have to be full 4″ X 4″ because they can be screwed directly into the house.
I used metal brackets at the base of the three 4″ X 4″ posts, which were inserted into the concrete, when it was still wet. Once the concrete was completely set (2-3 days) then the posts were fastened to the brackets with galvanized screws. I used temporary lumber to hold the posts in position until the walls went up.
Note: if the homeowner decides to stand the posts on the ground instead of attaching them to poured concrete footers, the posts are generally attached to the walls while laying on the ground. And then the entire assembly is lifted up in place and attached to the house.