title: aps-environment in mobile provision but not in entitlements
body: <p>I'm building an iOS application from the commandline and then using xcrun to sign/embed the mobile provision.</p>
  
  <p>When I run from the GUI I see what is expected, and I am able to gather the device token for push notifications:
  The embedded profile in Payload/appname.app/embedded.mobileprovision shows the following information:</p>
  
  <pre><code>&lt;key&gt;aps-environment&lt;/key&gt;
  &lt;string&gt;production&lt;/string&gt;
  </code></pre>
  
  <p>When i run a codesign -d --entitlements on the app payload, I see the following:</p>
  
  <pre><code>&lt;key&gt;aps-environment&lt;/key&gt;
  &lt;string&gt;production&lt;/string&gt;
  </code></pre>
  
  <p>When I run from the command line, I see the same thing in the embedded provision, but the output of the codesign --entitlement no longer shows the aps-environment. The commands I'm using for the command line builds are as follows:</p>
  
  <pre><code>/usr/bin/xcodebuild -configuration Distribution clean build
  /usr/bin/xcrun -sdk iphoneos PackageApplication "path-to-the.app" -o "file.ipa" --sign "iPhone Distribution: My Name" --embed "path-to-the.mobileprovision"
  </code></pre>
  
  <p>The error I see from the device is:</p>
  
  <pre><code>No valid 'aps-environment' entitlement string found for application 'appname': (null). Notifications will not be delivered.
  </code></pre>
  
  <p>What am I doing incorrectly from the commandline compared to the GUI?</p>