问题
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