BTServer may cause CPU spikes for some iOS developers Read more: http://reviews.cnet.com/8301-13727


最近机器老嗡嗡地响,在Activity Monitor里一看,发现BTServer这个进程的CPU占用率180%多,数据明显异常。Google了一下,发现如下文章,我是按照其中的这个方法去改的:

 Go to the Macintosh HD > Developer > Platforms > iPhoneSimulator.platform > Developer > SDKs > iPhoneSimulator5.0.sdk > System > Library > LaunchDaemons directory and then open the plist file from there. Locate the "Disabled" key and change its value from "false" to "true." (说明:需要获取修改权限,才能修改LaunchDaemons下的com.apple.BTServer.plist文件。在Terminal中用sudo vi即可修改)。


----------------------------------------------------------------------------------------------------------------------------------------

If you develop applications for Apple's iPhone or iPad, you may run into an issue where the Mac you're working on may start lagging or even lock up. If this happens, checking Activity Monitor may show the process BTServer running in the background.

For some people experiencing this problem, their Macs start running slower with the fans blaring at high speed, but for others the system crawls to a halt, requiring a forced reset of the system.

In order to properly test iOS applications, Apple includes an iOS simulator in its XCode package that is regularly used to launch and test code. This simulator tries to mimic every component of the iOS device, including the OS environment as well as the hardware components of the device.

The iOS Simulator mimics the iPhone and iPad hardware so developers can test their applications.

(Credit: Screenshot by Topher Kessler)

The BTServer process is supposed to mimic Bluetooth hardware for the iOS simulator, and may have a bug or two, or otherwise be affected by the code that certain developers are using in their applications.

This problem happens on a number of different setups, but in a recent Apple discussion on the topic it appears to happen most for people running XCode 4.2 (the latest version) on Snow Leopard 10.6.8.

If the BTServer process causes repeated issues for you, then there are several approaches you can take:

  1. Kill the process
    In the immediate event of a hang or slowdown, you can use Activity Monitor to force the BTServer process to quit. Alternatively you can enter "killall BTServer" in the Terminal if that is faster.
  2. Disable the Bluetooth server
    If your coding project does not require Bluetooth connectivity, then you can disable the server for the iOS Simulator. To do this, enter the following command in the Terminal (copy and paste the entire command to one line in the Terminal):

    sudo defaults write `locate com.apple.BTServer.plist` Disabled -bool true

    If this does not work, then you may have multiple instances of the XCode developer tools installed, in which case you will need to specify the file to edit. Go to the Macintosh HD > Developer > Platforms > iPhoneSimulator.platform > Developer > SDKs > iPhoneSimulator5.0.sdk > System > Library > LaunchDaemons directory and then open the plist file from there. Locate the "Disabled" key and change its value from "false" to "true."


Read more: http://reviews.cnet.com/8301-13727_7-57325358-263/btserver-may-cause-cpu-spikes-for-some-ios-developers/#ixzz1gQBSDG5u

你可能感兴趣的:(BTServer may cause CPU spikes for some iOS developers Read more: http://reviews.cnet.com/8301-13727)