最近升级了 xcode8 和 ios10,先说我遇到的一个问题,
使用 libimobiledevice 系列工具遇到: ERROR: Could not start service com.apple.syslog_relay.
,重装即可:
brew reinstall --HEAD libimobiledevice
再执行 sudo chmod 777 /var/db/lockdown
注 1
xcode8 移除了 UIAutomation,所以以前的 UIAutomation 那一套肯定不能用了。
[MJSONWP] Encountered internal error running command: Error: Could not find Automation.tracetemplate in any of the followinglocations /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate,/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
at getAutomationTraceTemplatePathWithoutRetry$ (lib/xcode.js:172:9)
注 1:
Tracing failing libimobiledevice commands using opensnoop, points to /var/db/lockdown/. This directory turns out to have different permissions than those of working machines, blocking libimobiledevice from access to device plists (certificates, keys, etc). This explains why the commands work while using sudo.
This issue can only temporarily be fixed by either using chmod or repair_packages (OSX 10.11) to change the permissions back:
QA01:~$ sudo chmod 777 /var/db/lockdown
orQA01:~$ sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
Password:
Permissions differ on "private/var/db/lockdown", should be drwxrwxrwx , they are drwx------ .
Repaired "private/var/db/lockdown".