使用 ADB 启动带有多个查询字符串参数的网页
Using ADB to Launch Web Page With Multiple Querystring Parameters
我正在尝试在虚拟 android 设备中启动网页。页面地址采用多个查询字符串参数。由于某些原因,在第一个 & 丢失(包括 &)之后传递所有参数中的 url。
我有一个非常简单的 C# WinForm 应用程序来测试它。我正在使用 MadBee NuGet 包将命令发送到 android 虚拟机。
当我发送命令时,我看到 url 已加载,但正如我所描述的,它缺少先 &
之后的参数
下面是我调用的代码片段:
command = "am start -a android.intent.action.VIEW -d http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352";
ConsoleOutputReceiver creciever = new ConsoleOutputReceiver();
device.ExecuteShellCommand(command, creciever);
有没有人知道为什么参数不能传递到 Android?
你的参数"make it across to Android"就好了。您没有意识到的是,您的命令正在被设备端的 Android shell
解析,并且 &
对其具有特殊含义。要阻止 shell
将 &
视为特殊符号,请使用如下引号:
command = "am start -a android.intent.action.VIEW -d 'http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352'";
我正在尝试在虚拟 android 设备中启动网页。页面地址采用多个查询字符串参数。由于某些原因,在第一个 & 丢失(包括 &)之后传递所有参数中的 url。
我有一个非常简单的 C# WinForm 应用程序来测试它。我正在使用 MadBee NuGet 包将命令发送到 android 虚拟机。
当我发送命令时,我看到 url 已加载,但正如我所描述的,它缺少先 &
之后的参数下面是我调用的代码片段:
command = "am start -a android.intent.action.VIEW -d http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352";
ConsoleOutputReceiver creciever = new ConsoleOutputReceiver();
device.ExecuteShellCommand(command, creciever);
有没有人知道为什么参数不能传递到 Android?
你的参数"make it across to Android"就好了。您没有意识到的是,您的命令正在被设备端的 Android shell
解析,并且 &
对其具有特殊含义。要阻止 shell
将 &
视为特殊符号,请使用如下引号:
command = "am start -a android.intent.action.VIEW -d 'http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352'";