relaxed Security AppiumService

五迷三道 提交于 2020-12-11 02:39:25

问题


I am new to Appium, and I want to execute some ADB commands using appium with C#, example to execute "adb shell ps"

Dictionary<string, object> map = new Dictionary<string, object>();
map.Add("command", "ps");
var output = driverAndroid.ExecuteScript("mobile: shell", map);

And I start appium programatically

AppiumLocalService service;
AppiumServiceBuilder builder;
if (service == null)
{
   builder = new 
   AppiumServiceBuilder().WithLogFile(new System.IO.FileInfo("Log"));
   service = builder.Build();
}

if (!service.IsRunning)
{
   service.Start();
}
service.Start();

So an exception raised and it says to run appium with relaxed Security. I try running appium by command line with this "appium --relaxed-security" and it works. I try to check this link
I think I need to add an argument but I don't know which one.

OptionCollector args = new OptionCollector().AddArguments(GeneralOptionList.);

So how to start appium with relaxed security?


回答1:


After digging, I find that this feautre can't run programatically on appium. So I run appium in command line like this appium --relaxed-security and from that, I can run adb commands using appium.




回答2:


If you're using Appium desktop, go to advanced and check the "relaxed security" checkbox.



来源:https://stackoverflow.com/questions/50858703/relaxed-security-appiumservice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!