Look for provision profile id in the profilename.mobileprovision file. Open the file and search for UUID to find this, it will be in XXX-XXX-XXXX format. Pass this as the value of PROVISIONING_PROFILE in xcodebuild command
sudo xcodebuild -configuration Debug PROVISIONING_PROFILE=<Provisioning Profile Id>