如果您能够越狱您的设备,请创建一个LaunchDaemon或使用现有的LaunchDaemon。LaunchDaemon是一个以plist格式呈现的文件,它在重新启动和启动设备时被调用。您还需要一个名为open
的文件,由K3A创建。
从这里下载open
您需要将open
移动到/usr/bin/,或者您可以将其放在您的应用程序中,但无论如何都要设置权限为0755和root:wheel
现在进入LaunchDaemons,它们存储在这里
/System/Library/LaunchDaemons
这里有一个例子。
假设您将LaunchDaemon命名为
com.gauravstomar.test.plist
在com.bundle.identifier
处填写您的应用程序标识符,您也可以在应用程序目录中的Info.plist
中找到它,在那里找到CFBundleIdentifier
现在在plist中插入以下信息
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.gauravstomar.test</string>
<key>ProgramArguments</key>
<array>
<string>open</string>
<string>com.bundle.identifier</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>1</integer>
</dict>
</plist>
确保您的LaunchDaemon权限设置为
0644 root:wheel
您仍然可以使用您的mobileconfig来禁用主页按钮。一旦评估完成,您可以使用以下命令禁用LaunchDaemon,以便应用程序停止自动重新启动:
launchctl unload/System/Library/LaunchDaemon/com.gauravstomar.plist
如果您需要更多帮助,请告诉我。