在Android仪器测试运行中的自定义ARG中的Whitespace
我想在Android中使用此仪器测试套件,我想通过一些自定义的论点。我一直在使用这种格式,如官方文档中所述:
adb shell am instrument -w -e key value -e class com.testpackage.tests.TestClass#testMethod
对于每个自定义参数,需要有一个-e键值
对。
这对于没有空格的数字或字符串的参数非常有效。但是,当我尝试使用whitespace的参数(引号,双引号)之间,例如-e user_name“ john doe”
,它没有正确解析,我会收到以下错误:
Error: No instrumentation found for: Doe
这表明该命令是解析user_name
作为john
,并尝试使用doe
作为目标测试类或其他东西。
现在,这是对此命令的限制吗?还是错误?还有其他方法可以实现这一目标吗?
I have this instrumented test suite in Android, that I would like to pass some custom arguments to. I've been using this format, as stated in the official documentation:
adb shell am instrument -w -e key value -e class com.testpackage.tests.TestClass#testMethod
Where for each custom argument there needs to be a -e key value
pair.
This works well for arguments that are numbers or strings with no whitespace in it. However, when I try to pass an argument with whitespace in it, between quotes, double quotes or not, such as -e user_name "John Doe"
, it's not parsed correctly and I get the following error:
Error: No instrumentation found for: Doe
Which suggests the command is parsing user_name
as John
and trying to use Doe
as the target test class or something.
Now, is this a limitation on this command? Or a bug? Is there any other way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论