Check device connection before running xcodebuild (#28996)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28996
### Summary
It'd be frustrated to realize the device is not connected after waiting for the build finishes. This PR checks the device connection status before xcodebuild.
### Test Plan
- Don't break `bootstrap.sh`
Test Plan: Imported from OSS
Differential Revision: D18258348
Pulled By: xta0
fbshipit-source-id: dda90e7194114e99b2774a3b64ed41f78221f827