I'm building an iOS application from the commandline and then using xcrun to sign/embed the mobile provision.
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:
<key>aps-environment</key>
<string>production</string>
When i run a codesign -d --entitlements on the app payload, I see the following:
<key>aps-environment</key>
<string>production</string>
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:
/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"
The error I see from the device is:
No valid 'aps-environment' entitlement string found for application 'appname': (null). Notifications will not be delivered.
What am I doing incorrectly from the commandline compared to the GUI?