6

我能够查询设备信息、获取设备上安装的配置文件列表等,但无法将配置文件安装到设备上。

我已经配置了一个限制配置文件。当我将它托管在我的服务器上并通过 Safari 下载它时,它会安装。但是当我将它编码为 base64(根据 MDM 要求)并尝试安装它时,我收到以下错误。

DM: Attempting to perform MDM request: InstallProfile
Oct 10 10:25:32 iPhone-4 mdmd[516] <Notice>: (Error) MC: Failed to parse profile data. Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalError
Oct 10 10:25:32 iPhone-4 mdmd[516] <Notice>: (Error) MDM: Command Status: Error
Error: NSError:
Desc   : Invalid Profile
US Desc: Invalid Profile
Domain : MCProfileErrorDomain
Code   : 1000
Type   : MCFatalError

下面是我尝试安装的配置文件的 Base64 编码数据。我根据此处此处的建议生成了以下数据

PHBsaXN0IHZlcnNpb249IjEuMCI+CjxkaWN0PgoJPGtleT5QYXlsb2FkQ29udGVudDwva2V5PgoJ
PGFycmF5PgoJCTxkaWN0PgoJCQk8a2V5PlBheWxvYWREZXNjcmlwdGlvbjwva2V5PgoJCQk8c3Ry
aW5nPjwvc3RyaW5nPgoJCQk8a2V5PlBheWxvYWREaXNwbGF5TmFtZTwva2V5PgoJCQk8c3RyaW5n
PlJlc3RyaWN0aW9uczwvc3RyaW5nPgoJCQk8a2V5PlBheWxvYWRJZGVudGlmaWVyPC9rZXk+CgkJ
CTxzdHJpbmc+Y28ubXltZG0ucmVzdHJpY3Rpb25zLnJlc3RyaWN0aW9uczE8L3N0cmluZz4KCQkJ
PGtleT5QYXlsb2FkT3JnYW5pemF0aW9uPC9rZXk+CgkJCTxzdHJpbmc+PC9zdHJpbmc+CgkJCTxr
ZXk+UGF5bG9hZFR5cGU8L2tleT4KCQkJPHN0cmluZz5jb20uYXBwbGUuYXBwbGljYXRpb25hY2Nl
c3M8L3N0cmluZz4KCQkJPGtleT5QYXlsb2FkVVVJRDwva2V5PgoJCQk8c3RyaW5nPjg0MzA2NThB
L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kJCTxmYWxzZS8+CgkJPC9kaWN0PgoJPC9hcnJheT4KCTxrZXk+UGF5bG9hZERlc2NyaXB0
aW9uPC9rZXk+Cgk8c3RyaW5nPlByb2ZpbGUgZGVzY3JpcHRpb24uPC9zdHJpbmc+Cgk8a2V5PlBh
eWxvYWREaXNwbGF5TmFtZTwva2V5PgoJPHN0cmluZz5HZW5lcmFsPC9zdHJpbmc+Cgk8a2V5PlBh
eWxvYWRJZGVudGlmaWVyPC9rZXk+Cgk8c3RyaW5nPmNvLm15bWRtLnJlc3RyaWN0aW9uczwvc3Ry
aW5nPgoJPGtleT5QYXlsb2FkT3JnYW5pemF0aW9uPC9rZXk+Cgk8c3RyaW5nPjwvc3RyaW5nPgoJ
PGtleT5QYXlsb2FkUmVtb3ZhbERpc2FsbG93ZWQ8L2tleT4KCTxmYWxzZS8+Cgk8a2V5PlBheWxv
YWRUeXBlPC9rZXk+Cgk8c3RyaW5nPkNvbmZpZ3VyYXRpb248L3N0cmluZz4KCTxrZXk+UGF5bG9h
ZFVVSUQ8L2tleT4KCTxzdHJpbmc+MUU4MjY0NEEtQjRCRi00RkM0LTgxQTgtNTdCRTFDOTg4MTg1
PC9zdHJpbmc+Cgk8a2V5PlBheWxvYWRWZXJzaW9uPC9rZXk+Cgk8aW50ZWdlcj4xPC9pbnRlZ2Vy
Pgo8L2RpY3Q+CjwvcGxpc3Q+Cg==

我已在 MDM 有效负载中启用配置文件安装。请帮助我找出问题所在。

4

2 回答 2

3

您缺少 XML 声明和 plist 文档类型。将以下两行添加到配置文件的顶部(在对其进行 base64 编码之前):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
于 2012-10-10T23:25:02.153 回答
2

问题已经解决了。只是出于烦恼,我删除了 .mobileConfig 的 XML 标记之间的额外空格。见下文...

改变了

<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadDescription</key>
            <string></string>
            <key>PayloadDisplayName</key>
            <string>Restrictions</string>
..........
</dict>

<dict><key>PayloadContent</key><array><dict><key>PayloadDescription</key><string></string><key>PayloadDisplayName</key><string>Restrictions</string>..........</dict>

我用这个网站将它编码成base64。(仅用于测试)

对于未来的观众,您需要从<dict>标签开始

于 2012-10-12T11:59:42.293 回答