Preheat oven to 350 degrees. Spray a 9x13-inch pan with cooking spray.
In a large bowl, whisk together sugar, eggs, oil, and vanilla extract until completely combined.
In a separate bowl, whisk together flour, cinnamon, nutmeg, baking soda and salt.
Add dry ingredients to wet and stir to combine.
Fold in apples and pecans. Pour batter into prepared pan.
Bake 50 to 55 minutes or until a toothpick inserted in the center comes out clean.Let cool.
Make frosting. Place cream cheese and butter in a large bowl. Beat with electric mixer until smooth.
Add vanilla extract, half-and-half, and confectioners' sugar and beat until smooth.
Spread on top of cake. Store leftovers in refrigerator.