NSBluetoothAlwaysUsageDescription是必需的,但未使用蓝牙

Nik*_*Kov 13 permissions xcode ios xcode11

在部署新Xcode 11 GM Seed 2的ios应用中,苹果返回了错误: ITMS-90683:Info.plist中缺少NSBluetoothAlwaysUsageDescription的目的字符串

https://developer.apple.com/documentation/bundleresources/information_property_list/nsbluetoothalwaysusagedescription?language=objc已读取。

问题是我没有在应用程序中使用蓝牙。也许我不知道。我如何找出为什么需要此许可目的?

我没用 CoreBluetooth.framework

Mau*_*ice 7

我今天也遇到了同样的问题。当我执行grep搜索时,我发现在project.pbxproj中有对CoreBluetooth.framework的引用

我删除了参考,构建应用程序运行良好。上传到Apple并成功通过,因此对我有用。

要搜索,请使用以下命令

grep -r -a CoreBluetooth.framework ProjectFolder
Run Code Online (Sandbox Code Playgroud)


Cha*_*rts 6

打开您的 Info.plist 并添加一个NSBluetoothAlwaysUsageDescription. 您可以在编辑器中通过添加这样的行项目来执行此操作:

info.plist 的屏幕截图,以 NSBluetoothAlwaysUsadeDescription 为键,以解释文本为 String 值

或者,您可以右键单击 Info.plist 并打开为 -> 源代码,然后将两行粘贴为 xml:

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
    ....
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>We use Bluetooth to connect to the MantisX hardware device.</string>
    ....
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

  • 该问题是在应用程序不使用蓝牙时提出的,因此添加此描述可能会导致将来出现混乱 (2认同)

Joh*_*ohn 5

我能够通过扫描符号用法(特别是寻找CBCentralManager. 我为此编写的脚本:

#!/usr/bin/env bash
#
# find-bluetooth-usages.sh <app1.app> <app2.app> ...

check_references_corebluetooth() {
  nm "$1" | grep "CBCentralManager" 2>&1 >/dev/null
}

find_usages () {
  app_path=$1
  if [[ ! -d $app_path || ! -d "$app_path/Frameworks" ]]; then
    echo "$app_path is not a valid app directory."
    exit 1
  fi
  app_filename=$(basename -- "$app_path")
  app_name="${app_filename%.*}"

  if check_references_corebluetooth "$app_path/$app_name"; then
    echo "$app_name contains references to CoreBluetooth"
  fi
  for framework_filename in $(ls "$app_path/Frameworks" | egrep '\.framework$'); do
    framework_path="$app_path/Frameworks/$framework_filename"
    framework_name=$(basename "$framework_path" .framework)
    if check_references_corebluetooth "$framework_path/$framework_name"; then
      echo "$framework_name contains references to CoreBluetooth"
    fi
  done
}

for arg in "$@"; do
  find_usages "$arg"
done
Run Code Online (Sandbox Code Playgroud)

这将深入挖掘主要二进制文件及其包含的框架以查找CBCentralManager参考。前任:

./find-bluetooth-usages.sh /path/to/MyApp.app