语言

Context.StartInstrumentation(ComponentName, String, Bundle) 方法

定义

开始执行类 android.app.Instrumentation 。

[Android.Runtime.Register("startInstrumentation", "(Landroid/content/ComponentName;Ljava/lang/String;Landroid/os/Bundle;)Z", "GetStartInstrumentation_Landroid_content_ComponentName_Ljava_lang_String_Landroid_os_Bundle_Handler")]
public abstract bool StartInstrumentation(Android.Content.ComponentName className, string? profileFile, Android.OS.Bundle? arguments);
[<Android.Runtime.Register("startInstrumentation", "(Landroid/content/ComponentName;Ljava/lang/String;Landroid/os/Bundle;)Z", "GetStartInstrumentation_Landroid_content_ComponentName_Ljava_lang_String_Landroid_os_Bundle_Handler")>]
abstract member StartInstrumentation : Android.Content.ComponentName * string * Android.OS.Bundle -> bool

参数

className
ComponentName

要运行的检测组件的名称。

profileFile
String

用于在检测运行时写入分析数据的可选路径,如果没有分析,则为 null。

arguments
Bundle

要传递给检测的其他可选参数,或为 null。

返回

true 如果检测已成功启动,则为 ;否则 false 找不到检测。

特性

注解

开始执行类 android.app.Instrumentation 。 给定的检测组件将通过终止其目标应用程序(如果当前正在运行)、启动目标进程、实例化检测组件,然后让其驱动应用程序来运行。

此函数不是同步的 -- 它一旦启动,并在运行检测时立即返回。

通常,仅允许检测针对未签名的包运行,或者使用检测包也签名的签名(确保目标信任检测)。

Java文档android.content.Context.startInstrumentation(android.content.ComponentName, java.lang.String, android.os.Bundle)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于