How to add device when i use xcodebuild to archive

HI,guys.

Now i'm using command "xcodebuild" to archive my app

I found when i add a new device in developer center.Xcode can archive to new device(I used automatically manage siging). But new device download from website using OTA .The app will be gray and cannot click to open.

Q1:How could i sovle thie issue?

Q2:Is there a way to let xcodebuild use xcode newest Provisioning Profiles?

Q3:I tried "-allowProvisioningUpdates" .It output an error .