gbox_sdk.wrapper.box.android package¶
Submodules¶
gbox_sdk.wrapper.box.android.android module¶
gbox_sdk.wrapper.box.android.app_manager module¶
- class gbox_sdk.wrapper.box.android.app_manager.AndroidAppManager(client, box)¶
Bases:
object
Manager class for handling Android app operations within a box.
Provides methods to install, uninstall, list, retrieve, close, and backup Android apps.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object.
- backup_all()¶
Backup all installed Android apps on the box.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.app.backup_all()
- close_all()¶
Close all running Android apps on the box.
- Return type:
None
- Examples:
>>> box.app.close_all()
- get(package_name)¶
Get an operator for a specific installed app.
- Return type:
- Args:
package_name: The package name of the app.
- Returns:
AndroidAppOperator: Operator for the specified app.
- Examples:
>>> box.app.get("com.example.app")
- get_info(package_name)¶
Get detailed information for a specific installed app.
- Return type:
- Args:
package_name: The package name of the app.
- Returns:
AndroidGetResponse: App information response.
- Examples:
>>> box.app.get_info("com.example.app")
- install(*, apk, open=NOT_GIVEN)¶
Install an Android app on the box.
Supports multiple APK input formats: - Local file path: “/path/to/app.apk” - File URL: “file:///path/to/app.apk” - HTTP URL: “https://example.com/app.apk” - File object or stream
- Return type:
- Args:
apk: APK file or ZIP archive to install (max file size: 512MB).
Single APK mode (installMultiple: false):
Upload a single APK file (e.g., app.apk)
Install-Multiple mode (installMultiple: true):
Upload a ZIP archive containing multiple APK files
ZIP filename example: com.reddit.frontpage-gplay.zip
ZIP contents example:
com.reddit.frontpage-gplay.zip └── com.reddit.frontpage-gplay/ (folder)
├── reddit-base.apk (base APK) ├── reddit-arm64.apk (architecture-specific) ├── reddit-en.apk (language pack) └── reddit-mdpi.apk (density-specific resources)
This is commonly used for split APKs where different components are separated by architecture, language, or screen density.
- install_multiple: Whether to use ‘adb install-multiple’ command for installation. When true, uses
install-multiple which is useful for split APKs or when installing multiple related packages. When false, uses standard ‘adb install’ command. Split APKs are commonly used for apps with different architecture variants, language packs, or modular components.
- open: Whether to open the app after installation. Will find and launch the launcher
activity of the installed app. If there are multiple launcher activities, only one will be opened. If the installed APK has no launcher activity, this parameter will have no effect.
- Returns:
AndroidAppOperator: Operator for the installed app.
- Examples:
>>> box.app.install(apk="/path/to/app.apk") >>> box.app.install(apk="https://example.com/app.apk")
- list()¶
List all installed Android apps as operator objects.
- Return type:
- Returns:
ListAndroidApp: Response containing app operator instances.
- Examples:
>>> box.app.list()
- list_info()¶
Get detailed information of all installed Android apps.
- Return type:
- Returns:
AndroidListAppResponse: Response containing app information.
- Examples:
>>> box.app.list_info()
- uninstall(package_name, *, keep_data=NOT_GIVEN)¶
Uninstall an Android app from the box.
- Return type:
None
- Args:
package_name: The package name of the app to uninstall.
keep_data: uninstalls the pkg while retaining the data/cache
- Examples:
>>> box.app.uninstall("com.example.app") >>> box.app.uninstall(package_name="com.example.app", keep_data=True)
gbox_sdk.wrapper.box.android.app_operator module¶
gbox_sdk.wrapper.box.android.pkg_manager module¶
- class gbox_sdk.wrapper.box.android.pkg_manager.AndroidPkgManager(client, box)¶
Bases:
object
Manager class for handling Android package operations within a box.
Provides methods to install, uninstall, list, retrieve, close, and backup Android packages.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object.
- backup_all()¶
Backup all installed Android packages on the box.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.pkg.backup_all()
- close_all()¶
Close all running Android packages on the box.
- Return type:
None
- Examples:
>>> box.pkg.close_all()
- get(package_name)¶
Get an operator for a specific installed package.
- Return type:
- Args:
package_name (str): The package name of the app.
- Returns:
AndroidPkgOperator: Operator for the specified package.
- Examples:
>>> box.pkg.get("com.example.app")
- get_info(package_name)¶
Get detailed information for a specific installed package.
- Return type:
- Args:
package_name (str): The package name of the app.
- Returns:
AndroidGetResponse: Package information response.
- Examples:
>>> box.pkg.get_info("com.example.app")
- install(*, apk, open=NOT_GIVEN)¶
Install an Android package on the box.
- Return type:
- Args:
apk: APK file or ZIP archive to install (max file size: 512MB).
Single APK mode (installMultiple: false):
Upload a single APK file (e.g., app.apk)
Install-Multiple mode (installMultiple: true):
Upload a ZIP archive containing multiple APK files
ZIP filename example: com.reddit.frontpage-gplay.zip
ZIP contents example:
com.reddit.frontpage-gplay.zip └── com.reddit.frontpage-gplay/ (folder)
├── reddit-base.apk (base APK) ├── reddit-arm64.apk (architecture-specific) ├── reddit-en.apk (language pack) └── reddit-mdpi.apk (density-specific resources)
This is commonly used for split APKs where different components are separated by architecture, language, or screen density.
- open: Whether to open the app after installation. Will find and launch the launcher
activity of the installed app. If there are multiple launcher activities, only one will be opened. If the installed APK has no launcher activity, this parameter will have no effect.
- Returns:
AndroidInstallResponse: The response of the install operation.
- Examples:
>>> box.pkg.install(apk="/path/to/app.apk") >>> box.pkg.install(apk="https://example.com/app.apk")
- list(*, pkg_type=NOT_GIVEN, running_filter=NOT_GIVEN)¶
List all installed Android packages as operator objects.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- running_filter: Filter pkgs by running status: running (show only running pkgs), notRunning
(show only non-running pkgs). Default is all
- Returns:
ListAndroidPkg: Response containing package operator instances.
- Examples:
>>> box.pkg.list() >>> box.pkg.list(pkg_type=["system", "thirdParty"], running_filter=["running", "notRunning"])
- list_info(*, pkg_type=NOT_GIVEN, running_filter=NOT_GIVEN)¶
Get detailed information of all installed Android packages.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- running_filter: Filter pkgs by running status: running (show only running pkgs), notRunning
(show only non-running pkgs). Default is all
- Returns:
AndroidListPkgResponse: Response containing package information.
- Examples:
>>> box.pkg.list_info() >>> box.pkg.list_info(pkg_type=["system", "thirdParty"], running_filter=["running", "notRunning"])
- list_simple_info(*, pkg_type=NOT_GIVEN)¶
List all installed Android packages with simple information.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- Returns:
ListAndroidPkgResponse: Response containing package information.
- Examples:
>>> box.pkg.list_simple_info()
- uninstall(package_name, *, keep_data=NOT_GIVEN)¶
Uninstall an Android package from the box.
- Return type:
None
- Args:
package_name: The package name of the app to uninstall.
keep_data: uninstalls the pkg while retaining the data/cache
- Examples:
>>> box.pkg.uninstall("com.example.app") >>> box.pkg.uninstall(package_name="com.example.app", keep_data=True)
gbox_sdk.wrapper.box.android.pkg_operator module¶
gbox_sdk.wrapper.box.android.types module¶
- class gbox_sdk.wrapper.box.android.types.AndroidUninstall¶
Bases:
TypedDict
Parameters for uninstalling an Android package (without box_id).
-
keep_data:
Annotated
[bool
]¶ uninstalls the pkg while retaining the data/cache
-
keep_data:
- class gbox_sdk.wrapper.box.android.types.InstallAndroidAppByLocalFile¶
Bases:
TypedDict
-
apk:
Required
[str
]¶
-
apk:
- class gbox_sdk.wrapper.box.android.types.ListAndroidApp(operators)¶
Bases:
object
Response type for listing Android apps as operators.
- class gbox_sdk.wrapper.box.android.types.ListAndroidPkg(operators)¶
Bases:
object
Response type for listing Android packages as operators.
Module contents¶
- class gbox_sdk.wrapper.box.android.AndroidAppManager(client, box)¶
Bases:
object
Manager class for handling Android app operations within a box.
Provides methods to install, uninstall, list, retrieve, close, and backup Android apps.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object.
- backup_all()¶
Backup all installed Android apps on the box.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.app.backup_all()
- close_all()¶
Close all running Android apps on the box.
- Return type:
None
- Examples:
>>> box.app.close_all()
- get(package_name)¶
Get an operator for a specific installed app.
- Return type:
- Args:
package_name: The package name of the app.
- Returns:
AndroidAppOperator: Operator for the specified app.
- Examples:
>>> box.app.get("com.example.app")
- get_info(package_name)¶
Get detailed information for a specific installed app.
- Return type:
- Args:
package_name: The package name of the app.
- Returns:
AndroidGetResponse: App information response.
- Examples:
>>> box.app.get_info("com.example.app")
- install(*, apk, open=NOT_GIVEN)¶
Install an Android app on the box.
Supports multiple APK input formats: - Local file path: “/path/to/app.apk” - File URL: “file:///path/to/app.apk” - HTTP URL: “https://example.com/app.apk” - File object or stream
- Return type:
- Args:
apk: APK file or ZIP archive to install (max file size: 512MB).
Single APK mode (installMultiple: false):
Upload a single APK file (e.g., app.apk)
Install-Multiple mode (installMultiple: true):
Upload a ZIP archive containing multiple APK files
ZIP filename example: com.reddit.frontpage-gplay.zip
ZIP contents example:
com.reddit.frontpage-gplay.zip └── com.reddit.frontpage-gplay/ (folder)
├── reddit-base.apk (base APK) ├── reddit-arm64.apk (architecture-specific) ├── reddit-en.apk (language pack) └── reddit-mdpi.apk (density-specific resources)
This is commonly used for split APKs where different components are separated by architecture, language, or screen density.
- install_multiple: Whether to use ‘adb install-multiple’ command for installation. When true, uses
install-multiple which is useful for split APKs or when installing multiple related packages. When false, uses standard ‘adb install’ command. Split APKs are commonly used for apps with different architecture variants, language packs, or modular components.
- open: Whether to open the app after installation. Will find and launch the launcher
activity of the installed app. If there are multiple launcher activities, only one will be opened. If the installed APK has no launcher activity, this parameter will have no effect.
- Returns:
AndroidAppOperator: Operator for the installed app.
- Examples:
>>> box.app.install(apk="/path/to/app.apk") >>> box.app.install(apk="https://example.com/app.apk")
- list()¶
List all installed Android apps as operator objects.
- Return type:
- Returns:
ListAndroidApp: Response containing app operator instances.
- Examples:
>>> box.app.list()
- list_info()¶
Get detailed information of all installed Android apps.
- Return type:
- Returns:
AndroidListAppResponse: Response containing app information.
- Examples:
>>> box.app.list_info()
- uninstall(package_name, *, keep_data=NOT_GIVEN)¶
Uninstall an Android app from the box.
- Return type:
None
- Args:
package_name: The package name of the app to uninstall.
keep_data: uninstalls the pkg while retaining the data/cache
- Examples:
>>> box.app.uninstall("com.example.app") >>> box.app.uninstall(package_name="com.example.app", keep_data=True)
- class gbox_sdk.wrapper.box.android.AndroidAppOperator(client, box, data)¶
Bases:
object
Operator class for managing a specific Android app within a box.
Provides methods to open, restart, close, list activities, and backup the app.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object. data (AndroidApp): The app data object.
- backup()¶
Backup the app.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.app.backup()
- close()¶
Close the app.
- Return type:
None
- Examples:
>>> box.app.close()
- list_activities()¶
List all activities of the app.
- Return type:
- Returns:
AndroidListActivitiesResponse: The response containing the list of activities.
- Examples:
>>> box.app.list_activities()
- open(activity_name=NOT_GIVEN)¶
Open the app, optionally specifying an activity name.
- Return type:
None
- Args:
activity_name: Activity name, default is the main activity.
- Examples:
>>> box.app.open() >>> box.app.open("com.example.app.MainActivity")
- restart(activity_name=NOT_GIVEN)¶
Restart the app, optionally specifying an activity name.
- Return type:
None
- Args:
activity_name: Activity name, default is the main activity.
- Examples:
>>> box.app.restart() >>> box.app.restart("com.example.app.MainActivity")
- class gbox_sdk.wrapper.box.android.AndroidBoxOperator(client, data)¶
Bases:
BaseBox
Operator class for managing Android boxes, providing access to app and package management functionalities.
- Attributes:
app (AndroidAppManager): Manager for Android app operations. pkg (AndroidPkgManager): Manager for Android package operations.
- class gbox_sdk.wrapper.box.android.AndroidPkgManager(client, box)¶
Bases:
object
Manager class for handling Android package operations within a box.
Provides methods to install, uninstall, list, retrieve, close, and backup Android packages.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object.
- backup_all()¶
Backup all installed Android packages on the box.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.pkg.backup_all()
- close_all()¶
Close all running Android packages on the box.
- Return type:
None
- Examples:
>>> box.pkg.close_all()
- get(package_name)¶
Get an operator for a specific installed package.
- Return type:
- Args:
package_name (str): The package name of the app.
- Returns:
AndroidPkgOperator: Operator for the specified package.
- Examples:
>>> box.pkg.get("com.example.app")
- get_info(package_name)¶
Get detailed information for a specific installed package.
- Return type:
- Args:
package_name (str): The package name of the app.
- Returns:
AndroidGetResponse: Package information response.
- Examples:
>>> box.pkg.get_info("com.example.app")
- install(*, apk, open=NOT_GIVEN)¶
Install an Android package on the box.
- Return type:
- Args:
apk: APK file or ZIP archive to install (max file size: 512MB).
Single APK mode (installMultiple: false):
Upload a single APK file (e.g., app.apk)
Install-Multiple mode (installMultiple: true):
Upload a ZIP archive containing multiple APK files
ZIP filename example: com.reddit.frontpage-gplay.zip
ZIP contents example:
com.reddit.frontpage-gplay.zip └── com.reddit.frontpage-gplay/ (folder)
├── reddit-base.apk (base APK) ├── reddit-arm64.apk (architecture-specific) ├── reddit-en.apk (language pack) └── reddit-mdpi.apk (density-specific resources)
This is commonly used for split APKs where different components are separated by architecture, language, or screen density.
- open: Whether to open the app after installation. Will find and launch the launcher
activity of the installed app. If there are multiple launcher activities, only one will be opened. If the installed APK has no launcher activity, this parameter will have no effect.
- Returns:
AndroidInstallResponse: The response of the install operation.
- Examples:
>>> box.pkg.install(apk="/path/to/app.apk") >>> box.pkg.install(apk="https://example.com/app.apk")
- list(*, pkg_type=NOT_GIVEN, running_filter=NOT_GIVEN)¶
List all installed Android packages as operator objects.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- running_filter: Filter pkgs by running status: running (show only running pkgs), notRunning
(show only non-running pkgs). Default is all
- Returns:
ListAndroidPkg: Response containing package operator instances.
- Examples:
>>> box.pkg.list() >>> box.pkg.list(pkg_type=["system", "thirdParty"], running_filter=["running", "notRunning"])
- list_info(*, pkg_type=NOT_GIVEN, running_filter=NOT_GIVEN)¶
Get detailed information of all installed Android packages.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- running_filter: Filter pkgs by running status: running (show only running pkgs), notRunning
(show only non-running pkgs). Default is all
- Returns:
AndroidListPkgResponse: Response containing package information.
- Examples:
>>> box.pkg.list_info() >>> box.pkg.list_info(pkg_type=["system", "thirdParty"], running_filter=["running", "notRunning"])
- list_simple_info(*, pkg_type=NOT_GIVEN)¶
List all installed Android packages with simple information.
- Return type:
- Args:
pkg_type: system or thirdParty, default is thirdParty
- Returns:
ListAndroidPkgResponse: Response containing package information.
- Examples:
>>> box.pkg.list_simple_info()
- uninstall(package_name, *, keep_data=NOT_GIVEN)¶
Uninstall an Android package from the box.
- Return type:
None
- Args:
package_name: The package name of the app to uninstall.
keep_data: uninstalls the pkg while retaining the data/cache
- Examples:
>>> box.pkg.uninstall("com.example.app") >>> box.pkg.uninstall(package_name="com.example.app", keep_data=True)
- class gbox_sdk.wrapper.box.android.AndroidPkgOperator(client, box, data)¶
Bases:
object
Operator class for managing a specific Android package within a box.
Provides methods to open, close, restart, list activities, and backup the package.
- Attributes:
client (GboxClient): The API client used for communication. box (AndroidBox): The Android box data object. data (AndroidGetResponse): The package data object.
- backup()¶
Backup the package.
- Return type:
BinaryAPIResponse
- Returns:
BinaryAPIResponse: The backup response containing binary data.
- Examples:
>>> box.pkg.backup()
- close()¶
Close the package.
- Return type:
None
- list_activities()¶
List all activities of the package.
- Return type:
- Returns:
AndroidListActivitiesResponse: The response containing the list of activities.
- Examples:
>>> box.pkg.list_activities()
- open(activity_name=None)¶
Open the package, optionally specifying an activity name.
- Return type:
None
- Args:
activity_name: Activity name, default is the main activity.
- Examples:
>>> box.pkg.open() >>> box.pkg.open("com.example.app.MainActivity")
- restart(activity_name=None)¶
Restart the package, optionally specifying an activity name.
- Return type:
None
- Args:
activity_name: Activity name, default is the main activity.
- Examples:
>>> box.pkg.restart() >>> box.pkg.restart("com.example.app.MainActivity")