6

背景:

Apple 为他们的 iPad 提供了一种“kiosk 模式”,作为 iOS6 的一部分,它将设备锁定在一个应用程序中(甚至直接启动到应用程序中)。非常适合在零售/餐厅/等场所使用 iPad。

为了使用它,首先必须使用 Apple Configurator 将设备设置为“受监督”设备。然后,您将一个特殊条目添加到名为“App Lock”的配置文件中。我遵循了最近更新的配置文件文档。本质上,您只需将 PayloadType 设置为“com.apple.app.lock”并添加一个名为“Identifier”的属性,该属性设置为应用程序包 ID 的值。

当我尝试将配置文件添加到 iPad 时(无论是通过 Safari 链接、MDM 还是 Apple Configurator),它都会拒绝它。

Xcode 中的控制台输出显示如下:

Sep 24 17:51:56 Test-iPad mc_mobile_tunnel[487] <Notice>: (Note ) MDM: Attempting to perform Supervised request: ProfileList
Sep 24 17:51:56 Test-iPad installd[30] <Error>: 0x2ff9f000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Apple Configurator (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1e58b0b0 [0x3d8f2100]>{type = mutable set, count = 1,
   entries =>
       2 : <CFString 0x3d8de564 [0x3d8f2100]>{contents = "CFBundleSignature"}
   }
Sep 24 17:51:57 Test-iPad mc_mobile_tunnel[492] <Notice>: (Error) MC: MCAppWhitelistPayload Can't parse payload: NSError:
   Desc   : The payload “Test Profile” is invalid.
   Sugg   : The field “App” is invalid.
   US Desc: The payload “Test Profile” is invalid.
   US Sugg: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The field “App” is invalid.
   US Desc: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2003
   Type   : MCFatalError
   Params : (
       App
   )
Sep 24 17:51:57 Test-iPad mc_mobile_tunnel[492] <Notice>: (Error) MC: Payload “(null)” contains ignored fields. They are: <CFBasicHash 0x20819140 [0x3d8f2100]>{type = mutable dict, count = 1,
   entries =>
       1 : <CFString 0x1f527bd0 [0x3d8f2100]>{contents = "Identifier"} = <CFString 0x1f527c10 [0x3d8f2100]>{contents = "com.hubworks.myapp"}
   }
Sep 24 17:51:57 Test-iPad mc_mobile_tunnel[492] <Notice>: (Error) MC: Cannot create profile of type “com.apple.app.lock”. Error: NSError:
   Desc   : The payload “Test Profile” is invalid.
   Sugg   : The field “App” is invalid.
   US Desc: The payload “Test Profile” is invalid.
   US Sugg: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The field “App” is invalid.
   US Desc: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2003
   Type   : MCFatalError
   Params : (
       App
   )
Sep 24 17:51:57 Test-iPad mc_mobile_tunnel[492] <Notice>: (Error) MC: Profile MCConfigurationProfile 0x1f526100, version 1:
   Display Name: “Test Profile”
   Identifier  : home-macbook-air.local.2A8DC5A2-937E-4246-B2AF-7C756C30C447
   UUID        : E06A5B33-9CD3-40CB-8611-0479E642B427
   Is Stub     : No
   Locked      : No
   Encrypted   : No
   Trusted     : 2
   Signed      : Yes
   Signed by   : Apple Configurator (58:55:CA:F7:24:B9)
    Can't parse profile: NSError:
   Desc   : The profile “Test Profile” is invalid.
   Sugg   : The payload “Test Profile” is invalid.
   US Desc: The profile “Test Profile” is invalid.
   US Sugg: The payload “Test Profile” is invalid.
   Domain : MCProfileErrorDomain
   Code   : 1000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The payload “Test Profile” is invalid.
   Sugg   : The field “App” is invalid.
   US Desc: The payload “Test Profile” is invalid.
   US Sugg: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The field “App” is invalid.
   US Desc: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2003
   Type   : MCFatalError
   Params : (
       App
   )
   Extra info:
   {
       isPrimary = 1;
   }
Sep 24 17:51:57 Test-iPad mc_mobile_tunnel[492] <Notice>: (Error) MC: Failed to parse profile data. Error: NSError:
   Desc   : The profile “Test Profile” is invalid.
   Sugg   : The payload “Test Profile” is invalid.
   US Desc: The profile “Test Profile” is invalid.
   US Sugg: The payload “Test Profile” is invalid.
   Domain : MCProfileErrorDomain
   Code   : 1000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The payload “Test Profile” is invalid.
   Sugg   : The field “App” is invalid.
   US Desc: The payload “Test Profile” is invalid.
   US Sugg: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2000
   Type   : MCFatalError
   Params : (
       "Test Profile"
   )
   ...Underlying error:
   NSError:
   Desc   : The field “App” is invalid.
   US Desc: The field “App” is invalid.
   Domain : MCPayloadErrorDomain
   Code   : 2003
   Type   : MCFatalError
   Params : (
       App
   )
   Extra info:
   {
       isPrimary = 1;
   }
4

2 回答 2

8

我想到了!我要么误读,要么 Apple 在他们的配置文件参考中遗漏了一些细节。为了避免错误,“标识符”/bundleId 键/值对必须包装在字典中,字典本身就是名为“App”的键的值。见下文:

<?xml version="1.0"?>
<plist version="1.0">
  <dict>
    <key>PayloadContent</key>
    <array>
      <dict>
        <key>App</key>
        <dict>
          <key>Identifier</key>
          <string>bundle_identifier_of_the_app</string>
        </dict>
        <key>PayloadType</key>
        <string>com.apple.app.lock</string>
        <key>PayloadIdentifier</key>
        <string>#######-#######-#######-######</string>
        <key>PayloadUUID</key>
        <string>#######-#######-#######-######</string>
        <key>PayloadVersion</key>
        <integer>#</integer>
      </dict>
    </array>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadDisplayName</key>
    <string>##########</string>
    <key>PayloadIdentifier</key>
    <string>######-#####-######-#####</string>
    <key>PayloadUUID</key>
    <string>######-######-#####-#####</string>
    <key>PayloadVersion</key>
    <integer>#</integer>
  </dict>
</plist>
于 2012-09-27T06:04:16.853 回答
0

是的,仍在 iOS 9.1 中工作

您可以添加如下选项:

<?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">
<plist version="1.0">
  <dict>
<key>PayloadContent</key>
<array>
      <dict>
        <key>App</key>
        <dict>
          <key>Identifier</key>
          <string>bundle_identifier_of_the_app</string>
          <key>Options</key>
          <dict>
            <key>DisableAutoLock</key>
            <true/>
            <key>DisableVolumeButtons</key>
            <true/>
          </dict>
        </dict>
        <key>PayloadType</key>
        <string>###.#####.#####</string>
        <key>PayloadIdentifier</key>
        <string>com.klangerfinder.lockdown</string>
        <key>PayloadUUID</key>
        <string>######-######-#####-#####</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
      </dict>
    </array>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadDisplayName</key>
    <string>AppLockDown</string>
    <key>PayloadIdentifier</key>
    <string>###.#####.#####</string>
    <key>PayloadUUID</key>
    <string>######-######-#####-#####</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
 </dict>
</plist>

那里有很多旧帖子。这个和上面是实际工作的!!!

于 2015-11-06T21:36:26.340 回答