BaseHostJUnit4Test
public
abstract
class
BaseHostJUnit4Test
extends Object
implements
IAbiReceiver,
ITestInformationReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.junit4.BaseHostJUnit4Test |
用于运行主机 JUnit4 型测试的基本测试类。此类提供支持,以便从主机端安装、运行和清理插桩测试。此类与多种设备兼容。 应该是从主机端运行插桩测试的单一可信来源,以避免重复的实用程序和基类。
摘要
公共构造函数 | |
|---|---|
BaseHostJUnit4Test()
|
|
公共方法 | |
|---|---|
final
void
|
autoTearDown()
自动拆解所有已安装的 APK。 |
final
IAbi
|
getAbi()
|
final
IBuildInfo
|
getBuild()
|
final
ITestDevice
|
getDevice()
|
final
IInvocationContext
|
getInvocationContext()
|
final
TestRunResult
|
getLastDeviceRunResults()
返回最近一次运行的 runDeviceTests 所产生的 |
final
List<ITestDevice>
|
getListDevices()
|
TestInformation
|
getTestInformation()
|
boolean
|
hasDeviceFeature(String feature)
|
final
void
|
installPackage(DeviceTestRunOptions options)
在设备上安装基于 |
final
void
|
installPackage(String apkFileName, String... options)
在设备上安装指定名称的 APK。 |
final
void
|
installPackage(ITestDevice device, String apkFileName, String... options)
在指定设备上安装指定名称的 APK。 |
final
void
|
installPackageAsUser(ITestDevice device, String apkFileName, boolean grantPermission, int userId, String... options)
在给定设备上为特定用户安装给定名称的 APK。 |
final
void
|
installPackageAsUser(String apkFileName, boolean grantPermission, int userId, String... options)
为特定用户安装指定名称的 APK。 |
final
boolean
|
isPackageInstalled(String pkg)
检查设备上是否安装了具有指定名称的软件包 |
final
boolean
|
isPackageInstalled(ITestDevice device, String pkg)
检查设备上是否安装了具有指定名称的软件包 |
final
boolean
|
runDeviceTests(ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, boolean instrumentInPcc, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, Map<String, String> instrumentationArgs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(String pkgName, String testClassName, String testMethodName)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(DeviceTestRunOptions options)
根据 |
final
boolean
|
runDeviceTests(ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(ITestDevice device, String pkgName, String testClassName, String testMethodName)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(String pkgName, String testClassName, Integer userId, Long testTimeoutMs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(String pkgName, String testClassName)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(String pkgName, String testClassName, Long testTimeoutMs)
运行已安装的插桩软件包的方法。 |
final
boolean
|
runDeviceTests(String runner, String pkgName, String testClassName, String testMethodName)
运行已安装的插桩软件包的方法。 |
final
void
|
setAbi(IAbi abi)
|
final
void
|
setTestInformation(TestInformation testInformation)
|
final
String
|
uninstallPackage(String pkgName)
卸载设备上的软件包。 |
final
String
|
uninstallPackage(ITestDevice device, String pkgName)
卸载设备上的软件包 |
公共构造函数
BaseHostJUnit4Test
public BaseHostJUnit4Test ()
公共方法
autoTearDown
public final void autoTearDown ()
自动拆解所有已安装的 APK。此操作会从安装了相应 APK 的设备中卸载所有这些 APK。
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
getLastDeviceRunResults
public final TestRunResult getLastDeviceRunResults ()
返回最近一次运行的 runDeviceTests 所产生的 TestRunResult。如果没有结果,则为 null。
| 返回 | |
|---|---|
TestRunResult |
|
hasDeviceFeature
public boolean hasDeviceFeature (String feature)
| 参数 | |
|---|---|
feature |
String |
| 返回 | |
|---|---|
boolean |
|
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
installPackage
public final void installPackage (DeviceTestRunOptions options)
在设备上安装基于 DeviceTestRunOptions 的 APK。系统会自动清理 APK。
| 参数 | |
|---|---|
options |
DeviceTestRunOptions:软件包安装的选项。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installPackage
public final void installPackage (String apkFileName,
String... options)在设备上安装指定名称的 APK。系统会自动清理 APK。
| 参数 | |
|---|---|
apkFileName |
String:APK 文件的名称。 |
options |
String:提供给安装命令的额外选项 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installPackage
public final void installPackage (ITestDevice device, String apkFileName, String... options)
在指定设备上安装指定名称的 APK。系统会自动清理 APK。
| 参数 | |
|---|---|
device |
ITestDevice:要安装 APK 的 ITestDevice。 |
apkFileName |
String:APK 文件的名称。 |
options |
String:提供给安装命令的额外选项 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installPackageAsUser
public final void installPackageAsUser (ITestDevice device, String apkFileName, boolean grantPermission, int userId, String... options)
在给定设备上为特定用户安装指定名称的 APK。
| 参数 | |
|---|---|
device |
ITestDevice:要安装 APK 的 ITestDevice。 |
apkFileName |
String:APK 文件的名称。 |
grantPermission |
boolean:在安装 APK 时是否传递授予权限标志。 |
userId |
int:要安装 APK 的用户的用户 ID。 |
options |
String:提供给安装命令的额外选项 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installPackageAsUser
public final void installPackageAsUser (String apkFileName,
boolean grantPermission,
int userId,
String... options)为特定用户安装指定名称的 APK。
| 参数 | |
|---|---|
apkFileName |
String:APK 文件的名称。 |
grantPermission |
boolean:在安装 APK 时是否传递授予权限标志。 |
userId |
int:要安装 APK 的用户的用户 ID。 |
options |
String:提供给安装命令的额外选项 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
isPackageInstalled
public final boolean isPackageInstalled (String pkg)
检查设备上是否安装了指定名称的软件包
| 参数 | |
|---|---|
pkg |
String:软件包的名称 |
| 返回 | |
|---|---|
boolean |
如果软件包在设备上找到,则为 true |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
isPackageInstalled
public final boolean isPackageInstalled (ITestDevice device, String pkg)
检查设备上是否安装了指定名称的软件包
| 参数 | |
|---|---|
device |
ITestDevice:应卸载相应软件包的设备。 |
pkg |
String:软件包的名称 |
| 返回 | |
|---|---|
boolean |
如果软件包在设备上找到,则为 true |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, boolean instrumentInPcc, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
runner |
String |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
maxTimeToOutputMs |
Long:测试必须开始输出内容的最长超时时间。 |
maxInstrumentationTimeoutMs |
Long:完整插桩必须完成的最大超时时间。 |
checkResults |
boolean:是否检查结果是否存在崩溃。 |
isHiddenApiCheckDisabled |
boolean:是否应停用隐藏的 API 检查。 |
isTestApiCheckDisabled |
boolean:是否应停用测试 API 检查。 |
isIsolatedStorageDisabled |
boolean:是否应停用隔离存储。 |
isWindowAnimationDisabled |
boolean:是否应停用窗口动画。 |
isRestartDisabled |
boolean |
instrumentInPcc |
boolean |
instrumentationArgs |
Map:要传递给插桩的实参。 |
extraListeners |
List |
| 返回 | |
|---|---|
boolean |
如果成功且未失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
runner |
String |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
maxTimeToOutputMs |
Long:测试必须开始输出内容的最长超时时间。 |
maxInstrumentationTimeoutMs |
Long:完整插桩必须完成的最大超时时间。 |
checkResults |
boolean:是否检查结果是否存在崩溃。 |
isHiddenApiCheckDisabled |
boolean:是否应停用隐藏的 API 检查。 |
isTestApiCheckDisabled |
boolean:是否应停用测试 API 检查。 |
isIsolatedStorageDisabled |
boolean:是否应停用隔离存储。 |
isWindowAnimationDisabled |
boolean:是否应停用窗口动画。 |
instrumentationArgs |
Map:要传递给插桩的实参。 |
extraListeners |
List |
| 返回 | |
|---|---|
boolean |
如果成功且未失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, Map<String, String> instrumentationArgs)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
runner |
String |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
maxTimeToOutputMs |
Long:测试必须开始输出内容的最长超时时间。 |
maxInstrumentationTimeoutMs |
Long:完整插桩必须完成的最大超时时间。 |
checkResults |
boolean:是否检查结果是否存在崩溃。 |
isHiddenApiCheckDisabled |
boolean:是否应停用隐藏的 API 检查。 |
instrumentationArgs |
Map:要传递给插桩的实参。 |
| 返回 | |
|---|---|
boolean |
如果成功且未失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
maxTimeToOutputMs |
Long:测试必须开始输出内容的最长超时时间。 |
maxInstrumentationTimeoutMs |
Long:完整插桩必须完成的最大超时时间。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (String pkgName,
String testClassName,
String testMethodName)运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (DeviceTestRunOptions options)
根据 DeviceTestRunOptions 中的信息运行插桩。
| 参数 | |
|---|---|
options |
DeviceTestRunOptions:驱动插桩设置的 DeviceTestRunOptions。 |
| 返回 | |
|---|---|
boolean |
如果成功且未失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, Map<String, String> instrumentationArgs, List<ITestLifeCycleReceiver> extraListeners)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
runner |
String |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
maxTimeToOutputMs |
Long:测试必须开始输出内容的最长超时时间。 |
maxInstrumentationTimeoutMs |
Long:完整插桩必须完成的最大超时时间。 |
checkResults |
boolean:是否检查结果是否存在崩溃。 |
isHiddenApiCheckDisabled |
boolean:是否应停用隐藏的 API 检查。 |
isTestApiCheckDisabled |
boolean:是否应停用测试 API 检查。 |
isIsolatedStorageDisabled |
boolean:是否应停用隔离存储。 |
instrumentationArgs |
Map:要传递给插桩的实参。 |
extraListeners |
List |
| 返回 | |
|---|---|
boolean |
如果成功且未失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (ITestDevice device, String pkgName, String testClassName, String testMethodName)
运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
device |
ITestDevice:要针对其运行插桩的设备。 |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (String pkgName,
String testClassName,
Integer userId,
Long testTimeoutMs)运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
userId |
Integer:要针对其运行测试的用户的 ID。可为 null。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (String pkgName,
String testClassName)运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (String pkgName,
String testClassName,
Long testTimeoutMs)运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testTimeoutMs |
Long:要应用于每个测试用例的超时时间(以毫秒为单位)。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
runDeviceTests
public final boolean runDeviceTests (String runner,
String pkgName,
String testClassName,
String testMethodName)运行已安装的插桩软件包的方法。紧接着使用 getLastDeviceRunResults() 获取结果的详细信息。
| 参数 | |
|---|---|
runner |
String:要使用的插桩运行程序。 |
pkgName |
String:要运行的软件包的名称。 |
testClassName |
String:要运行的测试类的名称。 |
testMethodName |
String:要运行的类中的测试方法的名称。 |
| 返回 | |
|---|---|
boolean |
如果成功且没有失败,则为 True。否则输出 false。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
setTestInformation
public final void setTestInformation (TestInformation testInformation)
| 参数 | |
|---|---|
testInformation |
TestInformation |
uninstallPackage
public final String uninstallPackage (String pkgName)
卸载设备上的软件包。
| 参数 | |
|---|---|
pkgName |
String:要卸载的 Android 软件包 |
| 返回 | |
|---|---|
String |
包含错误代码的 String,或 null(如果成功) |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|
uninstallPackage
public final String uninstallPackage (ITestDevice device, String pkgName)
卸载设备上的软件包
| 参数 | |
|---|---|
device |
ITestDevice:应卸载相应软件包的设备。 |
pkgName |
String:要卸载的 Android 软件包 |
| 返回 | |
|---|---|
String |
包含错误代码的 String,或 null(如果成功) |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
|