reference - meroving/FluentAdb GitHub Wiki
FluentAdb
Method Interfaces.IAdb.Target(System.String)
Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").
Name | Description |
---|---|
serialNumber: | adb-assigned serial number |
Returns: Targeted adb instance |
Method Interfaces.IAdb.GetDevices(System.Threading.CancellationToken)
Prints a list of all attached emulator/device instances.
Name | Description |
---|---|
cancellationToken: | |
Returns: List of devices |
Method Interfaces.IAdb.Version(System.Threading.CancellationToken)
Get adb version number.
Name | Description |
---|---|
cancellationToken: | Cancellation token |
Returns: Version number string |
Method Interfaces.IAdb.StartServer(System.Threading.CancellationToken)
Checks whether the adb server process is running and starts it, if not.
Name | Description |
---|---|
cancellationToken: | Cancellation token |
Returns: |
Method Interfaces.IAdb.StopServer(System.Threading.CancellationToken)
Terminates the adb server process.
Name | Description |
---|---|
cancellationToken: | |
Returns: |
Property Interfaces.IAdb.AdbExecutablePath
Current adb executable path
Property Interfaces.IAdb.SingleDevice
Direct an adb command to the only attached USB device.
Property Interfaces.IAdb.SingleEmulator
Direct an adb command to the only running emulator instance.
Method Interfaces.IAdbTargeted.Install(System.String,FluentAdb.Enums.InstallOptions,System.Threading.CancellationToken)
Pushes an Android application (specified as a full path to an .apk file) to an emulator/device.
Name | Description |
---|---|
apkPath: | Full path to an .apk file |
options: | Installtion options |
cancellationToken: | |
Returns: Installation result string |
Method Interfaces.IAdbTargeted.Pull(System.String,System.String,System.Threading.CancellationToken)
Copies a specified file from an emulator/device instance to computer.
Name | Description |
---|---|
remotePath: | Path of file on device |
localPath: | Path on computer to pull file |
cancellationToken: | |
Returns: |
Method Interfaces.IAdbTargeted.Push(System.String,System.String,System.Threading.CancellationToken)
Copies a specified file from computer to an emulator/device instance.
Name | Description |
---|---|
localPath: | Path of file to push |
remotePath: | Path on device to push file |
cancellationToken: | Cancellation token |
Returns: |
Method Interfaces.IAdbTargeted.Backup(FluentAdb.Enums.BackupOptions,System.Collections.Generic.IEnumerable{System.String},System.String,System.Threading.CancellationToken)
Name | Description |
---|---|
options: | |
packages: | |
backupFile: | |
cancellationToken: | |
Returns: |
Method Interfaces.IAdbTargeted.Restore(System.String,System.Action{System.String},System.Threading.CancellationToken)
Name | Description |
---|---|
backupFile: | |
outputHandler: | |
cancellationToken: | |
Returns: |
Method Interfaces.IAdbTargeted.GetState(System.Threading.CancellationToken)
Gets the adb state of an emulator/device instance.
Name | Description |
---|---|
cancellationToken: | |
Returns: Adb state |
Method Interfaces.IAdbTargeted.Logcat(FluentAdb.Enums.LogcatOptions,FluentAdb.Enums.LogOutputFormat,System.Threading.CancellationToken,FluentAdb.Enums.LogFilter[])
Observe logcat from device
Name | Description |
---|---|
options: | Logcat options |
format: | Log output format |
cancellationToken: | |
filters: | Array of logcat filters |
Returns: Logcat observable |
Method Interfaces.IAdbTargeted.RunCommand(System.String,System.Threading.CancellationToken)
Run arbitrary command to targeted device
Name | Description |
---|---|
command: | Command to run |
cancellationToken: | |
Returns: Adb output |
Property Interfaces.IAdbTargeted.Shell
Run a shell command in the target emulator/device instance and then exits the remote shell
Method Interfaces.IActivityManager.Start(FluentAdb.Intent,FluentAdb.Enums.StartOptions,System.Int32,System.Nullable{FluentAdb.InUser},System.Threading.CancellationToken)
Start an Activity specified by intent
Name | Description |
---|---|
intent: | Intent for start activity |
options: | Start options |
repeatCount: | Number of times to repeat the activity launch. Prior to each repeat, the top activity will be finished |
user: | User to run as; if not specified, then run as the current user |
cancellationToken: | |
Returns: |
Method Interfaces.IActivityManager.StartService(FluentAdb.Intent,System.Nullable{FluentAdb.InUser},System.Threading.CancellationToken)
Start the Service specified by intent.
Name | Description |
---|---|
intent: | Intent for start service |
user: | User to run as. If not specified, then run as the current user |
cancellationToken: | |
Returns: |
Method Interfaces.IActivityManager.ForceStop(System.String,System.Threading.CancellationToken)
Force stop everything associated with package/>
Name | Description |
---|---|
package: | App's package name |
cancellationToken: | |
Returns: |
Method Interfaces.IActivityManager.Kill(System.String,System.Nullable{FluentAdb.InUser},System.Threading.CancellationToken)
Kill all processes associated with package. This command kills only processes that are safe to kill and that will not impact the user experience.
Name | Description |
---|---|
package: | App's package name |
user: | User whose processes to kill; all users if not specified |
cancellationToken: | |
Returns: |
Method Interfaces.IActivityManager.KillAll(System.Threading.CancellationToken)
Kill all background processes
Name | Description |
---|---|
cancellationToken: | |
Returns: |
Method Interfaces.IActivityManager.Broadcast(FluentAdb.Intent,System.Nullable{FluentAdb.InUser},System.Threading.CancellationToken)
Issue a broadcast intent
Name | Description |
---|---|
intent: | Broadcast intent |
user: | Which user to send to; if not specified then send to all users |
cancellationToken: | |
Returns: |
Method Interfaces.IDumpSys.DumpService(System.String,System.Threading.CancellationToken)
Dumps data of service to the screen.
Name | Description |
---|---|
service: | Service name |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetPackages(System.String,FluentAdb.Enums.PackageListOptions,System.Nullable{FluentAdb.InUser},System.Threading.CancellationToken)
Get all packages, optionally only those whose package name contains the text in filter.
Name | Description |
---|---|
filter: | Filter for package names |
options: | Options |
user: | The user space to query. |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetPermissionGroups(System.Threading.CancellationToken)
Get all known permission groups
Name | Description |
---|---|
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetPermissions(FluentAdb.Enums.PermissionListOptions,System.String,System.Threading.CancellationToken)
Get all known permissions, optionally only those in group
Name | Description |
---|---|
options: | Options |
group: | Permissions group |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetUsers(System.Threading.CancellationToken)
Get all users on the system.
Name | Description |
---|---|
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetPath(System.String,System.Threading.CancellationToken)
Get the path to the APK of the given package
Name | Description |
---|---|
package: | |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Install(System.String,FluentAdb.Enums.InstallOptions,System.Threading.CancellationToken)
Installs a package (specified by path) to the system.
Name | Description |
---|---|
path: | Package path |
options: | Options |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Uninstall(System.String,FluentAdb.Enums.UninstallOptions,System.Threading.CancellationToken)
Removes a package from the system.
Name | Description |
---|---|
package: | Application package |
options: | Options |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Clear(System.String,System.Threading.CancellationToken)
Deletes all data associated with a package.
Name | Description |
---|---|
package: | Application package |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Enable(System.String,System.Threading.CancellationToken)
Enable the given package or component (written as "package/class").
Name | Description |
---|---|
packageOrComponent: | Application package or component |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Disable(System.String,System.Threading.CancellationToken)
Disable the given package or component (written as "package/class").
Name | Description |
---|---|
packageOrComponent: | Application package or component |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.DisableUser(System.String,FluentAdb.InUser,System.Threading.CancellationToken)
Disable the given package or component (written as "package/class") for specified user
Name | Description |
---|---|
packageOrComponent: | Application package or component |
user: | The user to disable. |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Grant(System.String,System.String,System.Threading.CancellationToken)
Grant a permission to an app. On devices running Android 6.0 (API level 23) and higher, may be any permission declared in the app manifest. On devices running Android 5.1 (API level 22) and lower, must be an optional permission defined by the app.
Name | Description |
---|---|
package: | Application package |
permission: | Permission |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.Revoke(System.String,System.String,System.Threading.CancellationToken)
Revoke a permission from an app. On devices running Android 6.0 (API level 23) and higher, may be any permission declared in the app manifest. On devices running Android 5.1 (API level 22) and lower, must be an optional permission defined by the app.
Name | Description |
---|---|
package: | Application package |
permission: | Permission |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetInstallLocation(System.Threading.CancellationToken)
Returns the current install location.
Name | Description |
---|---|
cancellationToken: | |
Returns: Install location |
Method Interfaces.IPackageManager.SetInstallLocation(FluentAdb.Enums.InstallLocation,System.Threading.CancellationToken)
Changes the default install location.
Name | Description |
---|---|
installLocation: | Install location |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.SetPermissionEnforced(System.String,System.Boolean,System.Threading.CancellationToken)
Specifies whether the given permission should be enforced.
Name | Description |
---|---|
permission: | Permission |
enforced: | Is enforced |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.TrimCaches(System.Int32,System.Threading.CancellationToken)
Trim cache files to reach the given free space.
Name | Description |
---|---|
freeSpace: | Free space to reach |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.CreateUser(System.String,System.Threading.CancellationToken)
Create a new user with the given userName, printing the new user identifier of the user.
Name | Description |
---|---|
userName: | User name |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.RemoveUser(System.String,System.Threading.CancellationToken)
Remove the user with the given userId, deleting all data associated with that user
Name | Description |
---|---|
userId: | User identificator |
cancellationToken: | |
Returns: |
Method Interfaces.IPackageManager.GetMaxUsers(System.Threading.CancellationToken)
Get the maximum number of users supported by the device.
Name | Description |
---|---|
cancellationToken: | |
Returns: |
Property Interfaces.IShell.ActivityManager
Query activity manager
Property Interfaces.IShell.PackageManager
Query package manager
Method Adb.New
Get new adb instance
Returns:
Type Enums.AdbState
The connection state of the device/emulator instane
Field Enums.AdbState.Unknown
The instance state is unknown (unknown output from adb)
Field Enums.AdbState.Offline
The instance is not connected to adb or is not responding
Field Enums.AdbState.Device
The instance is now connected to the adb server
Field Enums.InstallLocation.Auto
Lets system decide the best location
Field Enums.InstallLocation.Internal
Installs on internal device storage
Field Enums.InstallLocation.External
Installs on external media
Field Enums.InstallOptions.None
None
Field Enums.InstallOptions.WithForwardLock
Install the package with forward lock.
Field Enums.InstallOptions.ReinstallKeepingData
Reinstall an exisiting app, keeping its data.
Field Enums.InstallOptions.InstallToShared
Install package on the shared mass storage (such as sdcard).
Field Enums.InstallOptions.InstallToInternal
Install package on the internal system memory.
Field Enums.PackageListOptions.None
None
Field Enums.PackageListOptions.AssociatedFile
Get packages associated file
Field Enums.PackageListOptions.OnlyDisabled
Filter to only show disabled packages
Field Enums.PackageListOptions.OnlyEnabled
Filter to only show enabled packages.
Field Enums.PackageListOptions.OnlySystem
Filter to only show system packages.
Field Enums.PackageListOptions.OnlyThirdparty
Filter to only show third party packages.
Field Enums.PackageListOptions.Installer
Get the installer for the packages.
Field Enums.PackageListOptions.Uninstalled
Also include uninstalled packages.
Field Enums.PermissionListOptions.None
None
Field Enums.PermissionListOptions.OrganizeByGroup
Organize by group.
Field Enums.PermissionListOptions.AllInformation
Get all infromation.
Field Enums.PermissionListOptions.Summary
Short summary.
Field Enums.PermissionListOptions.OnlyDangerous
Only list dangerous permissions.
Field Enums.PermissionListOptions.UsersVisible
List only the permissions users will see.
Field Enums.StartOptions.None
None
Field Enums.StartOptions.EnableDebugging
Enable debugging
Field Enums.StartOptions.WaitForLaunchComplete
Wait for launch to complete
Field Enums.StartOptions.ForceStop
Force stop the target app before starting the activity
Field Enums.UninstallOptions.None
None
Field Enums.UninstallOptions.KeepData
Keep the data and cache directories around after package removal.
Method Intent.With(System.String)
Specify the intent package
Name | Description |
---|---|
package: | |
Returns: |
Method Intent.Action(System.String)
Specify the intent action, such as "android.intent.action.VIEW". You can declare this only once.
Name | Description |
---|---|
action: | Intent action |
Returns: |
Method Intent.DataUri(System.String)
Specify the intent data URI, such as "content://contacts/people/1". You can declare this only once.
Name | Description |
---|---|
dataUri: | Intent data Uri |
Returns: |
Method Intent.MimeType(System.String)
Specify the intent MIME type, such as "image/png". You can declare this only once.
Name | Description |
---|---|
mimeType: | Intent MIME type |
Returns: |
Method Intent.Category(System.String)
Specify an intent category, such as "android.intent.category.APP_CONTACTS".
Name | Description |
---|---|
category: | Intent category |
Returns: |
Method Intent.Component(System.String)
Specify the component name with package name prefix to create an explicit intent, such as "com.example.app/.ExampleActivity".
Name | Description |
---|---|
component: | Component name |
Returns: |
Method Intent.Extra(System.String)
Add a null extra. This option is not supported for URI intents.
Name | Description |
---|---|
key: | |
Returns: |
Method Intent.Extra(System.String,System.String)
Add string data as a key-value pair.
Name | Description |
---|---|
key: | |
value: | |
Returns: |
Method Intent.Extra(System.String,System.Boolean)
Add boolean data as a key-value pair.
Name | Description |
---|---|
key: | |
value: | |
Returns: |
Method Intent.Extra(System.String,System.Int32)
Add integer data as a key-value pair.
Name | Description |
---|---|
key: | |
value: | |
Returns: |
Method Intent.Extra(System.String,System.Int64)
Add long data as a key-value pair.
Name | Description |
---|---|
key: | |
value: | |
Returns: |
Method Intent.Extra(System.String,System.Single)
Add float data as a key-value pair.
Name | Description |
---|---|
key: | |
value: | |
Returns: |
Property Intent.New
Create new Intent