简体   繁体   中英

Prevent Xcode from preparing Apple Watch when running for iOS

I have an iOS app that I want to test on my personal iOS device. I also wear an Apple Watch that's connected normally to this iPhone.

I have not knowingly created any kind of Apple Watch target or code in my Xcode project. I do not want to run or test the app on my Apple Watch. I have not set up the Apple Watch as some kind of development target in Xcode... it's just connected to my iPhone.

Despite this, Xcode continually tries to ready my Apple Watch for development alongside the iPhone. It delays running the iOS app on the iPhone so that it can "prepare" and "fetch" various things from the Watch. These spinners never end and as a result I am unable to deploy the iOS app to the iPhone.

iPhone 很忙:准备通过 iPhone 进行开发的 Apple Watch

iPhone is busy: Preparing Apple Watch for development via iPhone
Xcode will continue when iPhone is finished.

iPhone is busy: Fetching debug symbols for Apple Watch paired to iPhone

Fetching debug symbols for the watch
Installing Symbols for watchOS 7.4

Apple Watch via iPhone: Failed to prepare device for development.
This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility.

How can I fully hide this Apple Watch from being seen by Xcode? Disable any kind of development on the Watch? Deploy the iOS app to the iPhone without involving the connected Apple Watch at all?

I'm not interested in "fixing" the errors and warnings... I want the Apple Watch to not be used at all by Xcode.

Found this workaround, worked for me.

  • Unplug iPhone
  • Switch flight mode on the Watch
  • Switch off Bluetooth on the Watch
  • Plug the iPhone back in and build Good luck!

https://developer.apple.com/forums/thread/691452?answerId=704424022#704424022

Additionally, make sure you've updated Xcode to a version that supports your iOS/watchOS version (proper SDKs) - I've found this to be necessary to avoid the interminable 'preparing...' phase.

Be patient.

For me it completed after about 15 minutes and then ran the iPhone app.

On subsequent rebuilds there is further watch activity

If you've installed Xcode from Mac App Store, I've experienced a few cases where Xcode just won't update. (and it says "no update" even if you check for update from the app menu)

Solution: login to your Apple Developer account, then click this link. https://developer.apple.com/download/all/?q=Xcode

Download the latest version of Xcode .xip file (as of today Xcode 13.3.xip ) then move the file to /Applications .

Delete current install of Xcode, then double-click the.xip just downloaded to install it.

It should then work and continue to receive future updates.

For me just turning off Wifi and Bluetooth on the phone worked. So follow the below steps:

  1. Stop the Xcode project
  2. Turn off WIFI and Bluetooth on your phone only
  3. Run the Xcode project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM