Click or drag to resize
Ranorex

HostInstrumentAndDeployAndroidApp Method (String, String, Boolean, HostDeploymentModes, Duration, InstrumentApkOptions)

Can be invoked to instrument/deploy an Android app to a configured device.

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public void InstrumentAndDeployAndroidApp(
	string deviceName,
	string sourceApkFilePath,
	bool instrument,
	HostDeploymentModes deployMode,
	Duration timeout,
	InstrumentApkOptions options
)

Parameters

deviceName
Type: SystemString
The display name of the device on that the app shall be deployed
sourceApkFilePath
Type: SystemString
File path to the android application that shall be instrumented/deployed (*.apk)
instrument
Type: SystemBoolean
If set to true Ranorex will instrument the application prior to deployment. If set to false Ranorex assumes the APK file is instrumented already. The application will simply be deployed to the device. If this parameter is set to false but the *.apk file you try to deploy is not instrumented Ranorex will not be able to communicate with the device correctly.
deployMode
Type: RanorexHostDeploymentModes
States how the deployment shall be done. Possible modes are NoDeploy, WiFi and USB. If NoDeploy is passed no deployment will be done (just instrument the APK file). The instrumented file then can be found in [Drive]:\Users\[UserName]\Documents\Ranorex\InstrumentedApk\[APKName]-instrumented.apk. When WiFi is selected the apk file will be deployed over your wireless network (RanorexService needs to be installed). When Usb is selected the app will be deployed over USB cable to your connected device (deployment can be done without installed device service; but for automation the service is still required!). When Auto is selected the app will be deployed using the mode that was used to add the device.
timeout
Type: RanorexDuration
Specifies the timeout for each operation in the instrument and deploy process. After the specified timeout the operation aborts (timeout can happen when no connection can be established, instrumentation fails...). Depending on the size of your app, instrumentation and deployment can take quite some time. Instrumentation and deployment on low spec PCs can take up to about 10 minutes.
options
Type: InstrumentApkOptions
Advanced instrumentation options. InstrumentApkOptions for more information what the specific options are.
Exceptions
ExceptionCondition
NullReferenceException Will be throw if options is null.
See Also