{"_id":"@4lpha/easyadb","_rev":"7-fb42d21f05cf5a192827a0aecd912d71","name":"@4lpha/easyadb","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@4lpha/easyadb","version":"0.0.1","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.1","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"0595bc0c4e48113ed6c166ec9998d456bdadb672","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.1.tgz","fileCount":6,"integrity":"sha512-yACV6LSR/+SYHGT7iTQ3bk4+qHUomnfmOAht0Kh6EkhKjvxWWiwek2GFtvzW7HRmZJinxv8KwrMvzIZdkXeQ+g==","signatures":[{"sig":"MEQCIG3HzsFU9wrqe5Ql1MvaUm/H+rR6qxfHrbjsH1vH/C3OAiAmGwPMQHwfhhR6pt4YMoEimwF1BeihkMrN78Mt63AI0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69276},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"d000b1fac680c83e04d3bbba1b61cd7c7ff25846","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.1_1742202734405_0.012419327847269512","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@4lpha/easyadb","version":"0.0.2","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.2","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"f00513aee68f88e92bd5cd92746ff42fb1f75c7b","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.2.tgz","fileCount":6,"integrity":"sha512-gHm8oqSGr9JXStig2K7dYYkgQTeS1eiGDa8tQT1MlYSHvoiZUaBQcoHOuf83Gb6Vw7ZiiNTp/VyjtNO4CfvMFw==","signatures":[{"sig":"MEYCIQC3Alp6TKSy/tPni6bct2h1mZSHFoMLJXrV6j7FVRJ2CwIhAPgtPrForZvuUMaS0wE9bkqSijx5hIOIMP+6PYJA8gAk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69070},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"fc438e609d1058520201dc503d9c22148558ddbf","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.2_1742222817967_0.05326790865529607","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@4lpha/easyadb","version":"0.0.3","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.3","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"45d64534949ea3e962a43f6cbe41b328850c22da","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.3.tgz","fileCount":6,"integrity":"sha512-0bxmvXSeFeySQ49YC5f5XW6B2fwg+s5wF2RgOWWe1lKK0tzB9Y+W6x0EOia9SFLq0QR64eQrXc91OwdphE3XHg==","signatures":[{"sig":"MEYCIQDm/QXRSSPp2R7ARVbJEaP5muMI/AwCjt6vWuh3VxD/vAIhANyxZOONkeKcRZyEaAHtySXgaasHgarnAEL/hlrjY6s8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69078},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"f72e0170959b1eadd2108567f05bab176def2834","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.3_1743517440793_0.28307650176984267","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@4lpha/easyadb","version":"0.0.4","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.4","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"3d5ec28ce6cfe9d9aba3611575bef35816a935ad","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.4.tgz","fileCount":6,"integrity":"sha512-VDI3AbRKJYyWzNoHu3GZ6/RBfaSzyIrE4kF3OcwLV+9fp7l+mItVA4Ytt4G0S/V9ktmaKE3YJtvzLen26D25WA==","signatures":[{"sig":"MEYCIQDPJA677JMoMvmePaCN3VHNW0TL75nPbujhO950DBhkgQIhAKxpM3VWn+PkiJ45B5HmdTHvnL2b6u7MF66fPxz5/XBR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69084},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"0fa6deb50121f689e470aa26629d683ae5d76654","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.4_1743517544385_0.6500546650673711","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@4lpha/easyadb","version":"0.0.5","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.5","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"b8e1fb541374d5d8b5ca66aa5e235378c7d22f19","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.5.tgz","fileCount":6,"integrity":"sha512-9486Z8MixA2EoxoY7qLr5tOEyZQQg4pygNXXU2Yp/d0jP0sTs/Vo33npsYuZdpO9NckYxY/IFkZF7FrukPBS3g==","signatures":[{"sig":"MEYCIQCE2Q1pOOTwD56SKYXfMp6tmcD1Z39LhxTx3ViJPpYA6wIhAN8X1oayvo/kwY9cOpdbYUtZTFU6cDPe+bWLSGu5Pvkv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114796},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"a91e8e73985566d988c8ca76975a712a7161c6b3","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.5_1743583364201_0.2695868770945342","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@4lpha/easyadb","version":"0.0.6","keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","_id":"@4lpha/easyadb@0.0.6","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"dist":{"shasum":"c1fc5f27dde467be1b0cffb15e39cef1394b4f0e","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.6.tgz","fileCount":6,"integrity":"sha512-svF6Pdn2LIkubsR0ilERrTa2IqQ0TrTYKg6dl8xZxnlyAa7T6mqbXIzPn1LXfw98NNEp829K2R6FeNQYDLzSoA==","signatures":[{"sig":"MEYCIQCCaTX4hDeNZeG4i7b04Bi94e9ck3xaTD+u4wkV4zAkuwIhAM2P3FXZx/yE85JRyblQ9IFPZZBtfhc5EOfyS0rbseyE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":141128},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"e644826c6966e73d821d2a2d8ac45bd1d93c8e16","scripts":{"dev":"ts-node src/index.ts","lint":"eslint . --ext .ts","test":"mocha --require ts-node/register test/*.ts","build":"tsup","start":"node ./build/index.js","format":"prettier --write \"src/**/*.{ts,tsx}\"","dev:test":"ts-node src/test.ts","lint:fix":"eslint . --ext .ts --fix","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","format:check":"prettier --check \"src/**/*.{ts,tsx}\""},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"repository":{"url":"git+https://github.com/CanDgrmc/EasyAdb.git","type":"git"},"_npmVersion":"10.9.2","description":"Adb Kit","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^5.2.0","tsup":"^8.4.0","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.8.2","@types/chai":"^5.2.0","@types/node":"^22.13.10","@types/mocha":"^10.0.10","eslint-config-prettier":"^10.1.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/eslint-plugin":"^8.26.1"},"_npmOperationalInternal":{"tmp":"tmp/easyadb_0.0.6_1743591803019_0.9163704150633725","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@4lpha/easyadb","version":"0.0.7","description":"Adb Kit","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/CanDgrmc/EasyAdb.git"},"scripts":{"test":"mocha --require ts-node/register test/*.ts","dev":"ts-node src/index.ts","dev:test":"ts-node src/test.ts","dev:watch":"node --watch --experimental-strip-types --env-file=.env src/index.ts","build":"tsup","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","format":"prettier --write \"src/**/*.{ts,tsx}\"","format:check":"prettier --check \"src/**/*.{ts,tsx}\"","start":"node ./build/index.js"},"keywords":["Adb"],"author":{"name":"Can Doğramacı"},"license":"MIT","dependencies":{"tar":"^6.2.0","unzipper":"^0.11.5"},"devDependencies":{"@types/chai":"^5.2.0","@types/mocha":"^10.0.10","@types/node":"^22.13.10","@types/tar":"^6.1.13","@types/unzipper":"^0.10.9","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","chai":"^5.2.0","eslint-config-prettier":"^10.1.1","mocha":"^11.1.0","ts-node":"^10.9.2","tsup":"^8.4.0","typescript":"^5.8.2"},"_id":"@4lpha/easyadb@0.0.7","gitHead":"07951e97dee0fe6bf5de1d96f095a9a8649767b0","bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"homepage":"https://github.com/CanDgrmc/EasyAdb#readme","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-PY8rFDtwkQuEoU74L8u/4Gf46OijE4c1jjerDjyVSqcjTvOQ54dpHzM/MbYk+BKfzamHBnLrhikEDFekNGqs8Q==","shasum":"738ed3c95d12c285041b5382b2a57b5c99da8cde","tarball":"https://registry.npmjs.org/@4lpha/easyadb/-/easyadb-0.0.7.tgz","fileCount":6,"unpackedSize":149265,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAEaRga4eJQPI+oSxfGrSuTsHnT5OkV6rJXulHVOEG8DAiBt6VjhKISA4IEo5e0eL/7M7XmWTkcEmkOkQ+h+KSSYPg=="}]},"_npmUser":{"name":"candgrmc","email":"candgrmc@gmail.com"},"directories":{},"maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/easyadb_0.0.7_1771417657508_0.6809896492480916"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-17T09:12:14.315Z","modified":"2026-02-18T12:27:37.814Z","0.0.1":"2025-03-17T09:12:14.584Z","0.0.2":"2025-03-17T14:46:58.168Z","0.0.3":"2025-04-01T14:24:01.011Z","0.0.4":"2025-04-01T14:25:44.620Z","0.0.5":"2025-04-02T08:42:44.397Z","0.0.6":"2025-04-02T11:03:23.208Z","0.0.7":"2026-02-18T12:27:37.651Z"},"bugs":{"url":"https://github.com/CanDgrmc/EasyAdb/issues"},"author":{"name":"Can Doğramacı"},"license":"MIT","homepage":"https://github.com/CanDgrmc/EasyAdb#readme","keywords":["Adb"],"repository":{"type":"git","url":"git+https://github.com/CanDgrmc/EasyAdb.git"},"description":"Adb Kit","maintainers":[{"name":"candgrmc","email":"candgrmc@gmail.com"}],"readme":"# EasyAdb\n\nA TypeScript library that provides a clean API for interacting with Android devices using the Android Debug Bridge (ADB).\n\n## Features\n\n- Easy-to-use API for common ADB operations\n- TypeScript support with comprehensive type definitions\n- Connection management to Android devices\n- Device information retrieval (memory, storage, properties)\n- File transfer capabilities\n- App management functions\n- Command execution on connected devices\n- Timeouts and error handling\n- Caching mechanism for frequently accessed device properties\n- Automatic ADB download and setup\n\n## Installation\n\n```bash\nnpm install @4lpha/easyadb\n```\n\n## Prerequisites\n\n- ADB (Android Debug Bridge) must be installed on your system and available in your PATH\n- For connection to physical devices, USB debugging must be enabled on the device\n\n## ADB Management\n\nEasyAdb provides tools to check for and download the ADB executable automatically.\n\n### Check if ADB Exists\n\nYou can check if ADB is installed and accessible:\n\n```typescript\nimport { AdbClient } from \"@4lpha/easyadb\";\n\nconst adb = new AdbClient();\nconst exists = await adb.checkAdbExists();\n\nif (exists) {\n  console.log(\"ADB is available\");\n} else {\n  console.log(\"ADB not found\");\n}\n```\n\n### Download ADB\n\nIf ADB is not installed, you can download the latest platform-tools automatically:\n\n```typescript\nconst adb = new AdbClient();\n\n// Download ADB to default location (current_dir/.adb)\nconst adbPath = await adb.downloadAdb({\n  verbose: true, // Enable logging\n  onProgress: (downloaded, total) => {\n    const percentage = Math.round((downloaded / total) * 100);\n    console.log(`Downloaded: ${percentage}%`);\n  }\n});\n\nconsole.log(`ADB downloaded to: ${adbPath}`);\n\n// The client automatically updates its ADB path to the downloaded version\nawait adb.startServer();\n```\n\nYou can also use the standalone functions:\n\n```typescript\nimport { downloadAdb, checkAdbExists } from \"@4lpha/easyadb\";\n\nconst exists = await checkAdbExists();\nif (!exists) {\n  const path = await downloadAdb();\n}\n```\n\n## Basic Usage\n\n### Connecting to a Device\n\n```typescript\nimport { AdbClient } from \"@4lpha/easyadb\";\n\n// Create an ADB client\nconst adb = new AdbClient();\n\n// Start the ADB server if not already running\nawait adb.startServer();\n\n// Get a list of connected devices\nconst devices = await adb.getDevices();\nconsole.log(`Found ${devices.length} devices`);\n\n// Connect to a specific device using its ID\nconst deviceClient = await adb.getDevice(\"DEVICE_SERIAL_ID\");\n\n// Or connect to a device over network\nawait adb.connect(\"192.168.1.100:5555\");\n```\n\n### Device Information\n\n```typescript\n// Get basic device information\nconst id = deviceClient.getDeviceId();\nconst name = await deviceClient.getName();\nconst model = await deviceClient.getModel();\nconst manufacturer = await deviceClient.getManufacturer();\nconst androidVersion = await deviceClient.getAndroidVersion();\nconst sdkVersion = await deviceClient.getSDKVersion();\nconst brand = await deviceClient.getBrand();\nconst screenDensity = await deviceClient.getScreenDensity();\nconst language = await deviceClient.getSystemLanguage();\nconst locale = await deviceClient.getLocale();\n\n// Get device memory information\nconst memory = await deviceClient.getDeviceMemory();\nconsole.log(`Total Memory: ${memory.totalMemory} kB`);\nconsole.log(`Free Memory: ${memory.memFree} kB`);\nconsole.log(`Used Memory: ${memory.memUsed} kB`);\n\n// Get storage information\nconst storage = await deviceClient.getStorage();\nconsole.log(`Available storage: ${storage[0].Available} kB`);\n\n// Get all device properties as a string\nconst allProps = await deviceClient.getAllProps();\nconsole.log(allProps);\n\n// Get filtered device properties as an object\nconst specificProps = await deviceClient.getAllProps([\n  \"ro.product.model\",\n  \"ro.build.version.release\",\n]);\nconsole.log(specificProps); // { 'ro.product.model': 'Pixel', 'ro.build.version.release': '12' }\n\n// List files in a directory\nconst files = await deviceClient.ls(\"/sdcard\");\nconsole.log(files);\n```\n\n### Executing Shell Commands\n\n```typescript\n// Execute a shell command on the device\nconst result = await deviceClient.shell(\"ls /sdcard\");\nconsole.log(result);\n\n// You can also execute ADB commands directly\nconst output = await adb.exec(\"shell ls /sdcard\");\n\n// Or use the ls convenience method\nconst files = await deviceClient.ls(\"/sdcard\");\nconsole.log(files);\n```\n\n### File Transfer\n\n```typescript\n// Push a file to the device\nawait deviceClient.push(\n  \"/path/to/local/file\",\n  \"/sdcard/destination\",\n  (transferred, total) => {\n    console.log(\n      `Transferred: ${transferred} bytes of ${total || \"unknown\"} bytes`\n    );\n  }\n);\n\n// Using streams\nconst fs = require(\"fs\");\nconst readStream = fs.createReadStream(\"/path/to/local/file\");\n\nawait deviceClient.push(\n  readStream,\n  \"/sdcard/destination\",\n  (transferred, total) => {\n    console.log(\n      `Transferred: ${transferred} bytes of ${total || \"unknown\"} bytes`\n    );\n  }\n);\n\n// Pull a file from the device\nawait deviceClient.pull(\n  \"/sdcard/file.txt\",\n  \"/path/to/local/destination\",\n  (transferred, total) => {\n    console.log(\n      `Transferred: ${transferred} bytes of ${total || \"unknown\"} bytes`\n    );\n  }\n);\n```\n\n### App Management\n\n```typescript\n// Install an APK\nawait deviceClient.install(\"/sdcard/app.apk\");\n\n// Install with options\nawait deviceClient.install(\"/sdcard/app.apk\", {\n  replace: true, // Replace existing app\n  allowDowngrade: true, // Allow version downgrade\n  grantPermissions: true, // Automatically grant all permissions\n});\n\n// Uninstall an app\nawait deviceClient.uninstall(\"com.example.app\");\n\n// Clear app cache\nawait deviceClient.clearCache(\"com.example.app\");\n\n// Set default home app\nawait deviceClient.setHomeApp(\n  \"com.example.launcher/com.example.launcher.MainActivity\"\n);\n\n// Disable system UI\nawait deviceClient.disableSystemUI();\n\n// Enable system UI\nawait deviceClient.enableSystemUI();\n```\n\n### Device Control\n\n```typescript\n// Toggle screen (on/off)\nawait deviceClient.toggleScreen();\n\n// Get screen state\nconst screenState = await deviceClient.getScreenState();\nconsole.log(`Screen is ${screenState}`);\n\n// Get screen resolution\nconst resolution = await deviceClient.getScreenResolution();\nconsole.log(`Screen resolution: ${resolution}`);\n\n// Reboot the device\nawait deviceClient.reboot();\n\n// Enable/disable launcher\nawait deviceClient.disableLauncher();\nawait deviceClient.enableLauncher();\n\n// Device interaction controls\n// Tap on screen\nawait deviceClient.control({\n  type: \"tap\",\n  x: 500,\n  y: 800,\n});\n\n// Swipe on screen\nawait deviceClient.control({\n  type: \"swipe\",\n  x1: 500,\n  y1: 1000,\n  x2: 500,\n  y2: 200,\n});\n\n// Input text\nawait deviceClient.control({\n  type: \"text\",\n  text: \"Hello world\",\n});\n\n// Press a key (keyevent)\nawait deviceClient.control({\n  type: \"key\",\n  keycode: 66, // ENTER key\n});\n\n// Take a basic screenshot\nawait deviceClient.getScreenshot(\"/sdcard/screenshot.png\");\n\n// Take a screenshot with timestamp\nconst timestamp = Date.now();\nawait deviceClient.getScreenshot(`/sdcard/screenshot_${timestamp}.png`);\n\n// Open URL in device browser\nawait deviceClient.openUrl(\"https://www.google.com\");\n\n// Open local file\nawait deviceClient.openUrl(\"file:///sdcard/document.pdf\");\n\n// Open app deep link\nawait deviceClient.openUrl(\"myapp://some/path\");\n\n// Monitor device logs\nconst stopLogging = deviceClient.logcat((log) => {\n  console.log(\"Device log:\", log);\n});\n\n// Filter specific log types\nconst stopErrorLogging = deviceClient.logcat((log) => {\n  if (log.includes(\"ERROR\")) {\n    console.error(\"Error detected:\", log);\n  }\n});\n\n// Stop logging when done\nstopLogging();\nstopErrorLogging();\n```\n\n### Shared Preferences Management\n\n```typescript\n// Set a shared preference for an app\nawait deviceClient.putSharedConfig(\n  \"com.example.app\",\n  \"preference_key\",\n  \"value\",\n  { restart: true }\n);\n\n// Get a shared preference value\nconst value = await deviceClient.getSharedConfig(\n  \"com.example.app\",\n  \"preference_key\"\n);\n\n// Get all shared preferences\nconst allPrefs = await deviceClient.getAllSharedConfig(\"com.example.app\");\n\n// Remove a shared preference\nawait deviceClient.removeSharedConfig(\n  \"com.example.app\",\n  \"preference_key\",\n  \"value\",\n  { restart: true }\n);\n\n// Clear a specific shared preference\nawait deviceClient.clearSharedConfig(\"com.example.app\", \"preference_key\");\n\n// Clear all shared preferences\nawait deviceClient.clearAllSharedConfig(\"com.example.app\");\n```\n\n### Broadcast Actions\n\n```typescript\n// Send a broadcast\nawait deviceClient.broadcast(\"com.example.ACTION\", {\n  extras: {\n    key1: \"value1\",\n    key2: \"value2\",\n  },\n});\n```\n\n## Advanced Configuration\n\n### Custom ADB Path\n\n```typescript\nconst adb = new AdbClient({\n  path: \"/custom/path/to/adb\",\n  timeout: 15000, // 15 seconds\n});\n```\n\n### Connection Options\n\n```typescript\nconst adb = new AdbClient({\n  host: \"127.0.0.1\",\n  port: 5037,\n});\n```\n\n### Logging and Debugging\n\n```typescript\n// Enable verbose output\nconst result = await adb.verbose().shell(\"ls /sdcard\");\n\n// Suppress exceptions\nconst output = await adb.noThrow().exec(\"non-existent-command\");\n// output will be null instead of throwing an exception\n```\n\n## Connection Testing\n\n```typescript\nimport { testAdbConnection } from \"@4lpha/easyadb\";\n\n// Test if ADB is properly connected\nconst isConnected = await testAdbConnection(\"adb\", true);\nif (isConnected) {\n  console.log(\"ADB connection successful!\");\n} else {\n  console.log(\"ADB connection failed.\");\n}\n```\n\n## Error Handling\n\nThe library provides comprehensive error handling:\n\n```typescript\ntry {\n  const result = await adb.exec(\"invalid-command\");\n} catch (error) {\n  console.error(\"ADB execution failed:\", error.message);\n}\n\n// Or use noThrow to prevent exceptions\nconst result = await adb.noThrow().exec(\"invalid-command\");\nif (result === null) {\n  console.log(\"Command failed but no exception was thrown\");\n}\n```\n\n## Example Use Cases\n\n### Automated Testing Scenario\n\n```typescript\n// Example test scenario\nasync function testLoginFlow() {\n  const adb = new AdbClient();\n  await adb.startServer();\n\n  const device = await adb.getDevice(\"emulator-5554\");\n\n  // Launch the app\n  await device.shell(\"am start -n com.example.app/.MainActivity\");\n\n  // Tap on username field\n  await device.control({\n    type: \"tap\",\n    x: 500,\n    y: 700,\n  });\n\n  // Enter username\n  await device.control({\n    type: \"text\",\n    text: \"testuser@example.com\",\n  });\n\n  // Tap on password field\n  await device.control({\n    type: \"tap\",\n    x: 500,\n    y: 800,\n  });\n\n  // Enter password\n  await device.control({\n    type: \"text\",\n    text: \"password123\",\n  });\n\n  // Tap login button\n  await device.control({\n    type: \"tap\",\n    x: 500,\n    y: 900,\n  });\n\n  // Check if main page loaded\n  const logs = [];\n  const stopLogging = device.logcat((log) => {\n    logs.push(log);\n    if (log.includes(\"MainActivity: onResume\")) {\n      console.log(\"Login successful!\");\n      stopLogging();\n    }\n  });\n\n  // Take screenshot of result\n  await device.getScreenshot(\"/sdcard/login_result.png\");\n  await device.pull(\"/sdcard/login_result.png\", \"./login_result.png\");\n}\n```\n\n### Device Monitoring and Reporting\n\n```typescript\n// Monitor and report device status\nasync function monitorDeviceStatus() {\n  const adb = new AdbClient();\n  await adb.startServer();\n\n  const devices = await adb.getDevices();\n\n  for (const device of devices) {\n    // Get device information\n    const model = await device.getModel();\n    const androidVersion = await device.getAndroidVersion();\n    const memory = await device.getDeviceMemory();\n    const storage = await device.getStorage();\n\n    console.log(`Device: ${model} (Android ${androidVersion})`);\n    console.log(`Memory Usage: ${memory.memUsed}/${memory.totalMemory} kB`);\n    console.log(`Storage: ${storage[0].Available}/${storage[0].kBlock} kB`);\n\n    // Take screenshot\n    const timestamp = Date.now();\n    await device.getScreenshot(`/sdcard/status_${timestamp}.png`);\n    await device.pull(\n      `/sdcard/status_${timestamp}.png`,\n      `./status_${model}_${timestamp}.png`\n    );\n  }\n}\n```\n\n## API Reference\n\n### Adb Class\n\nThe base class that provides core ADB functionality.\n\n| Method                                   | Description                                            |\n| ---------------------------------------- | ------------------------------------------------------ |\n| `constructor(options?: IAdbOptions)`     | Creates a new ADB instance with optional configuration |\n| `verbose()`                              | Enables verbose output for the next command            |\n| `noThrow()`                              | Prevents exceptions for the next command               |\n| `shell(command: string)`                 | Executes a shell command                               |\n| `exec(command: string, args?: string[])` | Executes an ADB command with optional arguments        |\n| `reboot()`                               | Reboots the device                                     |\n| `uninstall(packagename: string)`         | Uninstalls an app by package name                      |\n| `downloadAdb(options?: IAdbDownloadOptions)` | Downloads ADB platform-tools                       |\n| `checkAdbExists(adbPath?: string)`       | Checks if ADB exists at path or in PATH                |\n\n## API Reference (continued)\n\n### AdbClient Class\n\nExtends the Adb class with additional client functionality.\n\n| Method                                             | Description                                        |\n| -------------------------------------------------- | -------------------------------------------------- |\n| `startServer()`                                    | Starts the ADB server if not already running       |\n| `killServer()`                                     | Stops the ADB server                               |\n| `getDevices()`                                     | Returns a list of connected devices                |\n| `getDevice(id: string)`                            | Returns a DeviceClient for the specified device ID |\n| `connect(address: string)`                         | Connects to a device over network                  |\n| `disconnect(address?: string)`                     | Disconnects from a device or all devices           |\n| `waitForDevice(serial?: string, timeout?: number)` | Waits for a device to be connected                 |\n| `tcpip(port?: number)`                             | Restarts ADB in TCP/IP mode                        |\n\n### DeviceClient Class\n\nProvides device-specific functionality.\n\n| Method                                                                                               | Description                                         |\n| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| `getDeviceId()`                                                                                      | Returns the device ID                               |\n| `getName()`                                                                                          | Returns the device name                             |\n| `getModel()`                                                                                         | Returns the device model                            |\n| `getManufacturer()`                                                                                  | Returns the device manufacturer                     |\n| `getBrand()`                                                                                         | Returns the device brand                            |\n| `getAndroidVersion()`                                                                                | Returns the Android version                         |\n| `getSDKVersion()`                                                                                    | Returns the SDK version                             |\n| `getScreenDensity()`                                                                                 | Returns the screen density                          |\n| `getSystemLanguage()`                                                                                | Returns the system language                         |\n| `getLocale()`                                                                                        | Returns the device locale                           |\n| `getDeviceMemory()`                                                                                  | Returns memory usage information                    |\n| `getStorage()`                                                                                       | Returns storage information                         |\n| `getScreenResolution()`                                                                              | Returns screen resolution                           |\n| `getScreenState()`                                                                                   | Returns screen state (on/off)                       |\n| `getAllProps(filter?: string[])`                                                                     | Returns device properties                           |\n| `getProp(prop: string)`                                                                              | Returns a specific device property                  |\n| `shell(command: string)`                                                                             | Executes a shell command on the device              |\n| `ls(path: string)`                                                                                   | Lists files in a directory                          |\n| `push(src: string \\| ReadStream, dest: string, callback?: TransferCallback)`                         | Transfers a file to the device                      |\n| `pull(src: string, dest: string \\| WriteStream, callback?: TransferCallback)`                        | Transfers a file from the device                    |\n| `install(apkPath: string, options?: InstallOptions)`                                                 | Installs an APK                                     |\n| `uninstall(packageName: string)`                                                                     | Uninstalls an app                                   |\n| `clearCache(packageName: string)`                                                                    | Clears app cache                                    |\n| `toggleScreen()`                                                                                     | Toggles screen on/off                               |\n| `reboot()`                                                                                           | Reboots the device                                  |\n| `setHomeApp(app: string)`                                                                            | Sets default home app                               |\n| `disableSystemUI()`                                                                                  | Disables system UI                                  |\n| `enableSystemUI()`                                                                                   | Enables system UI                                   |\n| `disableLauncher()`                                                                                  | Disables launcher                                   |\n| `enableLauncher()`                                                                                   | Enables launcher                                    |\n| `getScreenshot(path: string)`                                                                        | Takes a screenshot                                  |\n| `control(options: ControlOptions)`                                                                   | Performs device interaction (tap, swipe, text, key) |\n| `openUrl(url: string)`                                                                               | Opens a URL in the device browser                   |\n| `logcat(callback: (log: string) => void)`                                                            | Monitors device logs                                |\n| `putSharedConfig(packageName: string, key: string, value: string, options?: SharedConfigOptions)`    | Sets a shared preference                            |\n| `getSharedConfig(packageName: string, key: string)`                                                  | Gets a shared preference value                      |\n| `getAllSharedConfig(packageName: string)`                                                            | Gets all shared preferences                         |\n| `removeSharedConfig(packageName: string, key: string, value: string, options?: SharedConfigOptions)` | Removes a shared preference                         |\n| `clearSharedConfig(packageName: string, key: string)`                                                | Clears a specific shared preference                 |\n| `clearAllSharedConfig(packageName: string)`                                                          | Clears all shared preferences                       |\n| `broadcast(action: string, options?: BroadcastOptions)`                                              | Sends a broadcast action                            |\n\n## Common KeyEvent Codes\n\nHere are some commonly used KeyEvent codes for the `control({ type: \"key\", keycode: number })` function:\n\n| Key                      | Code | Description      |\n| ------------------------ | ---- | ---------------- |\n| KEYCODE_ENTER            | 66   | Enter key        |\n| KEYCODE_TAB              | 61   | Tab key          |\n| KEYCODE_SPACE            | 62   | Space key        |\n| KEYCODE_BACK             | 4    | Back button      |\n| KEYCODE_HOME             | 3    | Home button      |\n| KEYCODE_MENU             | 82   | Menu button      |\n| KEYCODE_POWER            | 26   | Power button     |\n| KEYCODE_VOLUME_UP        | 24   | Volume up        |\n| KEYCODE_VOLUME_DOWN      | 25   | Volume down      |\n| KEYCODE_DPAD_UP          | 19   | D-pad up         |\n| KEYCODE_DPAD_DOWN        | 20   | D-pad down       |\n| KEYCODE_DPAD_LEFT        | 21   | D-pad left       |\n| KEYCODE_DPAD_RIGHT       | 22   | D-pad right      |\n| KEYCODE_DPAD_CENTER      | 23   | D-pad center     |\n| KEYCODE_CAMERA           | 27   | Camera button    |\n| KEYCODE_SEARCH           | 84   | Search button    |\n| KEYCODE_MEDIA_PLAY_PAUSE | 85   | Play/pause media |\n| KEYCODE_MEDIA_STOP       | 86   | Stop media       |\n| KEYCODE_MEDIA_NEXT       | 87   | Next media       |\n| KEYCODE_MEDIA_PREVIOUS   | 88   | Previous media   |\n\nFor alphabetic keys, use codes 29-54 (a-z). For numeric keys, use codes 7-16 (0-9).\n\n## Advanced Examples\n\n### App Testing with Screenshots\n\n```typescript\nasync function testApp() {\n  const adb = new AdbClient();\n  const device = await adb.getDevice();\n\n  // Clear app data before testing\n  await device.clearCache(\"com.example.app\");\n\n  // Start the app\n  await device.shell(\"am start -n com.example.app/.MainActivity\");\n\n  // Wait for app to load\n  await new Promise((resolve) => setTimeout(resolve, 2000));\n\n  // Take a screenshot of the initial state\n  await device.getScreenshot(\"/sdcard/test_initial.png\");\n\n  // Perform a series of interactions\n  await device.control({ type: \"tap\", x: 300, y: 500 });\n  await device.control({ type: \"text\", text: \"Test input\" });\n  await device.control({ type: \"key\", keycode: 66 }); // Press Enter\n\n  // Wait for response\n  await new Promise((resolve) => setTimeout(resolve, 1000));\n\n  // Take a screenshot of the result\n  await device.getScreenshot(\"/sdcard/test_result.png\");\n\n  // Pull screenshots to local machine\n  await device.pull(\"/sdcard/test_initial.png\", \"./test_initial.png\");\n  await device.pull(\"/sdcard/test_result.png\", \"./test_result.png\");\n}\n```\n\n### Device Performance Monitoring\n\n```typescript\nasync function monitorPerformance(packageName, durationSeconds) {\n  const adb = new AdbClient();\n  const device = await adb.getDevice();\n\n  console.log(\n    `Starting performance monitoring for ${packageName} for ${durationSeconds} seconds`\n  );\n\n  // Start the app\n  await device.shell(`am start -n ${packageName}/.MainActivity`);\n\n  const startTime = Date.now();\n  const endTime = startTime + durationSeconds * 1000;\n\n  // Collect metrics at intervals\n  const metrics = [];\n\n  while (Date.now() < endTime) {\n    // Get memory usage\n    const memoryOutput = await device.shell(`dumpsys meminfo ${packageName}`);\n    const memMatch = memoryOutput.match(/TOTAL\\s+(\\d+)/);\n    const memoryUsage = memMatch ? parseInt(memMatch[1]) : null;\n\n    // Get CPU usage\n    const cpuOutput = await device.shell(\n      `dumpsys cpuinfo | grep ${packageName}`\n    );\n    const cpuMatch = cpuOutput.match(/(\\d+(?:\\.\\d+)?)%/);\n    const cpuUsage = cpuMatch ? parseFloat(cpuMatch[1]) : null;\n\n    metrics.push({\n      timestamp: new Date(),\n      memory: memoryUsage,\n      cpu: cpuUsage,\n    });\n\n    // Take a screenshot\n    const timestamp = Date.now();\n    await device.getScreenshot(`/sdcard/perf_${timestamp}.png`);\n\n    // Wait before next sample\n    await new Promise((resolve) => setTimeout(resolve, 5000));\n  }\n\n  // Generate report\n  console.log(\"Performance Report:\");\n  console.log(\"==================\");\n\n  metrics.forEach((metric) => {\n    console.log(`Time: ${metric.timestamp.toISOString()}`);\n    console.log(`Memory: ${metric.memory ? metric.memory + \" KB\" : \"N/A\"}`);\n    console.log(`CPU: ${metric.cpu ? metric.cpu + \"%\" : \"N/A\"}`);\n    console.log(\"------------------\");\n  });\n\n  // Calculate averages\n  const avgMemory =\n    metrics.reduce((sum, m) => sum + (m.memory || 0), 0) / metrics.length;\n  const avgCpu =\n    metrics.reduce((sum, m) => sum + (m.cpu || 0), 0) / metrics.length;\n\n  console.log(`Average Memory Usage: ${avgMemory.toFixed(2)} KB`);\n  console.log(`Average CPU Usage: ${avgCpu.toFixed(2)}%`);\n}\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"ADB server not running\"**\n\n   - Solution: Call `adb.startServer()` before other operations.\n\n2. **\"Device not found\"**\n\n   - Ensure the device is connected and USB debugging is enabled\n   - Try `adb.waitForDevice()` to wait for a device connection\n\n3. **Permission errors**\n\n   - Ensure ADB has proper permissions to access files\n   - For push/pull operations, check file permissions on both device and host\n\n4. **\"Command timed out\"**\n   - Increase the timeout in the AdbClient constructor options\n   - Check device connectivity\n\n### Debugging Tips\n\n1. Use `verbose()` to see detailed command output:\n\n   ```typescript\n   const result = await adb.verbose().exec(\"devices\");\n   ```\n\n2. Check ADB version:\n\n   ```typescript\n   const version = await adb.exec(\"version\");\n   console.log(version);\n   ```\n\n3. Test connection:\n   ```typescript\n   const isConnected = await testAdbConnection();\n   console.log(isConnected ? \"Connected\" : \"Not connected\");\n   ```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\nFor more information and updates, visit the [GitHub repository](https://github.com/CanDgrmc/EasyAdb).\n","readmeFilename":"Readme.md"}