macOS Sierra - how to enable “Allow Remote Automation” using command line

后端 未结 2 2053
南方客
南方客 2021-02-04 01:58

I am working on an automation stuff in macOS Sierra (10.12.2). By using python\'s atomac support I can launch the safari browser and make the settings enabled via Safari -> Pre

2条回答
  •  甜味超标
    2021-02-04 02:57

    I found the answer from: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari

    safaridriver --enable
    

    It will prompt for an admin password, so some people setup passwordless sudo (dangerous) or do another workaround like calling from an Applescript

    I tested that this works with Mojave and Safari 12.0.3 and verified that it works regardless of if the Develop menu is enabled, though you probably want to save yourself the clicks and just enable that too:

    defaults write com.apple.Safari IncludeDevelopMenu 1
    

提交回复
热议问题