Script written in PHP. It gives you a list of developer identities to select from and automatically finds a *.mobileprovision file for your selection. Or you can enter your credentials in config and script will silently build your app.
Feel free to send me your propositions and improvements.
First copy xcodebuildprovisioning.php file into your projects directory (near your *.xcodeproj file). You can enter your identity and provisioning profile filepath, but it is not necessary because the script will prompt you otherwise.
Make it executable: chmod +x xcodebuildprovisioning.php
That's all, run ./xcodebuildprovisioning.php from your project directory.