我目前在做iPad设备上的自动化测试,编写一个Test Client,接收PC的任务,播放制定列表中的媒体文件(几百个,全部完成会持续十几个小时),但是我的test client运行一段时间后就会crash,不能完成测试。 Boss要求:test client crash之后需要再次启动,我考虑使用守护进程,但是最初开发的人告诉我,IOS不允许守护进程,我在网上搜索到有人说不放到App Store就可以。 非常谢谢!
调试欢乐多
2、写一个守护进程
3、在 /Library/LaunchDaemons放一个list文件。<?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>MyScript</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/Application.app/Application</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>900</integer>
</dict>
</plist>
path/to/Application.app/Application:指定运行的程序。
请注意啊,启动的程序必须为 守护进程即是没有界面的程序了,不可能启动一个app了
2、写一个守护进程
3、在 /Library/LaunchDaemons放一个list文件。<?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>MyScript</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/Application.app/Application</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>900</integer>
</dict>
</plist>
path/to/Application.app/Application:指定运行的程序。
请注意啊,启动的程序必须为 守护进程即是没有界面的程序了,不可能启动一个app了
2、写一个守护进程
3、在 /Library/LaunchDaemons放一个list文件。3
Java代码
<?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>MyScript</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/Application.app/Application</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>900</integer>
</dict>
</plist>
path/to/Application.app/Application:指定运行的程序。
请注意啊,启动的程序必须为 守护进程即是没有界面的程序了,不可能启动一个app了