当前位置:   article > 正文

【FAQ】通过 crontab 定时执行 xcodebuild 打包签名,无法解锁钥匙串?_ios自动化打包签名无法访问钥匙串

ios自动化打包签名无法访问钥匙串

参考:https://stackoverflow.com/questions/52197941/xcode-build-works-from-command-line-but-not-in-crontab

crontab 默认使用 root 执行,无法访问用户login keychain

改用 launchd 设置定时任务即可解决:

$ launchctl load -w test.plist

$ launchctl start com.test.start.auto

$ launchctl list | grep com.test.start.auto

 

test.plist:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5. <key>Label</key>
  6. <string>com.test.start.auto</string>
  7. <key>ProgramArguments</key>
  8. <array>
  9. <string>/Users/test/test.sh</string>
  10. </array>
  11. <key>StartCalendarInterval</key>
  12. <dict>
  13. <key>Hour</key>
  14. <integer>16</integer>
  15. <key>Minute</key>
  16. <integer>37</integer>
  17. </dict>
  18. <key>RunAtLoad</key>
  19. <true/>
  20. <key>StandardErrorPath</key>
  21. <string>/Users/test/test.err</string>
  22. <key>StandardOutPath</key>
  23. <string>/Users/test/test.out</string>
  24. </dict>
  25. </plist>

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/314483
推荐阅读
  

闽ICP备14008679号