import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
// Create an Android box
const box = await gboxSDK.create({ type: "android" });
// Get basic package information (metadata only)
const androidPkgListInfo = await box.pkg.listInfo();
console.log(`Android Pkg List: ${JSON.stringify(androidPkgListInfo, null, 2)}`);
// Get package operators for interaction capabilities
const androidPkgList = await box.pkg.list();
// Iterate through each package operator and perform actions
for (const pkg of androidPkgList) {
console.log(`Pkg data: ${JSON.stringify(pkg.data, null, 2)}`);
}
}
main();
{
"data": [
{
"name": "Google Voice",
"packageName": "com.google.android.apps.googlevoice",
"apkPath": "/data/app/com.google.android.apps.googlevoice-1/base.apk",
"version": "1.0.0",
"pkgType": "thirdParty",
"isRunning": false
},
{
"name": "Chrome Browser",
"packageName": "com.android.chrome",
"apkPath": "/data/app/com.android.chrome-2/base.apk",
"version": "120.0.6099.210",
"pkgType": "thirdParty",
"isRunning": true
},
{
"name": "System Settings",
"packageName": "com.android.settings",
"apkPath": "/system/app/Settings/Settings.apk",
"version": "1.0.0",
"pkgType": "system",
"isRunning": false
}
]
}
Retrieve detailed information for all installed pkg. This endpoint provides comprehensive pkg details
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
// Create an Android box
const box = await gboxSDK.create({ type: "android" });
// Get basic package information (metadata only)
const androidPkgListInfo = await box.pkg.listInfo();
console.log(`Android Pkg List: ${JSON.stringify(androidPkgListInfo, null, 2)}`);
// Get package operators for interaction capabilities
const androidPkgList = await box.pkg.list();
// Iterate through each package operator and perform actions
for (const pkg of androidPkgList) {
console.log(`Pkg data: ${JSON.stringify(pkg.data, null, 2)}`);
}
}
main();
{
"data": [
{
"name": "Google Voice",
"packageName": "com.google.android.apps.googlevoice",
"apkPath": "/data/app/com.google.android.apps.googlevoice-1/base.apk",
"version": "1.0.0",
"pkgType": "thirdParty",
"isRunning": false
},
{
"name": "Chrome Browser",
"packageName": "com.android.chrome",
"apkPath": "/data/app/com.android.chrome-2/base.apk",
"version": "120.0.6099.210",
"pkgType": "thirdParty",
"isRunning": true
},
{
"name": "System Settings",
"packageName": "com.android.settings",
"apkPath": "/system/app/Settings/Settings.apk",
"version": "1.0.0",
"pkgType": "system",
"isRunning": false
}
]
}
Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai
Box ID
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
system or thirdParty, default is thirdParty
Show child attributes
["thirdParty"]
Filter pkgs by running status: running (show only running pkgs), notRunning (show only non-running pkgs). Default is all
Show child attributes
["running", "notRunning"]
Android pkg list
Response containing list of Android pkgs
Was this page helpful?