{"_id":"@acabai/android","_rev":"8-541b76e4dbc20a8fbcae34159349c229","name":"@acabai/android","dist-tags":{"latest":"2.0.6"},"versions":{"1.0.0":{"name":"@acabai/android","version":"1.0.0","license":"MIT","_id":"@acabai/android@1.0.0","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"47154f2b0d5cbad4d74b27aeec00543f07572575","tarball":"https://registry.npmjs.org/@acabai/android/-/android-1.0.0.tgz","fileCount":8,"integrity":"sha512-ltvqGZtnVWRDz2i9WNqLIaeymITPdLHrj/kkByL+J3/JxJfRqcD+COl6h4vapXRJwqY+k8zznwtgUnaHNdHLgQ==","signatures":[{"sig":"MEYCIQCrNz1ugIjEBZOcGhEHI+7H1yac431Jn6P5rHxPAsYiAQIhAJ5NP7vLSfk7O7SFopWoi1aa35x820O33Y75GUfb7nTD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62325},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"5f8c764feefd91f323ae729adf9c854895166808","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","build:watch":"modern build -w -c ./modern.config.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.7.0","description":"Android automation library for acabAI","directories":{},"_nodeVersion":"22.8.0","dependencies":{"appium-adb":"12.12.1","@acabai/web":"^1.3.0","@acabai/core":"^1.0.0","@acabai/shared":"^1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"_npmOperationalInternal":{"tmp":"tmp/android_1.0.0_1746661917757_0.3960322318766867","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@acabai/android","version":"1.0.1","license":"MIT","_id":"@acabai/android@1.0.1","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"ec4869b45125b7dbc54afbb911ff0ebda0ee43e0","tarball":"https://registry.npmjs.org/@acabai/android/-/android-1.0.1.tgz","fileCount":8,"integrity":"sha512-FtrIJIVnLLf4bv8dhP0cUR6Cxieox6ZG7GCBP3sf2qyYD82x+g/zE0+klAEhgUIT/VX/y8ABQOGZUWpsIGsNXg==","signatures":[{"sig":"MEYCIQCXSoBtYrKaTEOQWyTpVhe7CX/rWe9aztywm8GuD8/J9gIhALO0Zz6Z55hvTxQzTuoZF2tgpL9uyNZsObjOOYuZxN3x","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62325},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"5f8c764feefd91f323ae729adf9c854895166808","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","build:watch":"modern build -w -c ./modern.config.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.7.0","description":"Android automation library for acabAI","directories":{},"_nodeVersion":"22.8.0","dependencies":{"appium-adb":"12.12.1","@acabai/web":"^1.3.0","@acabai/core":"^1.0.1","@acabai/shared":"^1.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"_npmOperationalInternal":{"tmp":"tmp/android_1.0.1_1746662669137_0.6100789657343466","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@acabai/android","version":"2.0.0","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","_id":"@acabai/android@2.0.0","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"618e1ff16b64b424dd58ced58f933eb6e755eafb","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.0.tgz","fileCount":15,"integrity":"sha512-0i+5j7Wzfa2n20G2invgj9L15ayKKNsqY6X/uQ7Qj5jQHMhsY6FJ0nA6xKU1GPp6+THAQeXDhxYQxkQKU2NtnQ==","signatures":[{"sig":"MEUCIH0gQZ79Lac3Gw74/9AGSFOgaX+5iZqpR00SWgOgVWbtAiEA+q34boy+HA1rPq1hQJIsUEKW9T7l2fO7RKMCKiu6G+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":140993},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"46d9c6a75d55e88473b4e21f7c7e67dc7bc3bd31","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:ai":"ts-node examples/ai-automation.ts","build:watch":"modern build -w -c ./modern.config.ts","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.7.0","description":"Appium-based Android automation library for acabAI","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@acabai/web":"^1.3.0","webdriverio":"^8.32.3","@acabai/core":"^1.0.1","@acabai/shared":"^1.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","ts-node":"^10.9.2","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"peerDependencies":{"webdriverio":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/android_2.0.0_1746992130342_0.12290885926956374","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@acabai/android","version":"2.0.1","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","_id":"@acabai/android@2.0.1","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"f42f79bfdbd4af0128204161f7a5549c4c05033e","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.1.tgz","fileCount":17,"integrity":"sha512-LytzRSM1XJsz0wXai9FM3c7BABDX2UwzsoWg33MCkyGDbdhKF0ifNbDz7kPNt1MZJNWXLi1fwUZ0dTlvze2ELQ==","signatures":[{"sig":"MEUCIDyffkYvNZsOgsF2d4KMLGRemWWiCVc/whiPIDuc6nkdAiEAouKu30lBCjUbxjFyF5hm0nZaybDVNA96wa+32K15mAQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153961},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"46d9c6a75d55e88473b4e21f7c7e67dc7bc3bd31","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:ai":"ts-node examples/ai-automation.ts","build:watch":"modern build -w -c ./modern.config.ts","example:w3c":"ts-node examples/w3c-actions.ts","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.7.0","description":"Appium-based Android automation library for acabAI","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@acabai/web":"^1.3.0","webdriverio":"^8.32.3","@acabai/core":"^1.0.1","@acabai/shared":"^1.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","ts-node":"^10.9.2","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"peerDependencies":{"webdriverio":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/android_2.0.1_1746993237012_0.10763339033686603","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@acabai/android","version":"2.0.3","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","_id":"@acabai/android@2.0.3","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"e635b288459ffc72fb5d6be74ae2c63328711dbb","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.3.tgz","fileCount":19,"integrity":"sha512-xvQcGX1ie14PMmj34cIiUXqIkHUx3QX8uK09JSEIvg8cn+T+ns0nzuFiIBPxRJ5PLg+PmZ/LIGZCcey9+OGg+g==","signatures":[{"sig":"MEUCIQCeZdkwkfZUXdpbRRdH4CpA3Lg3cbQepMWUWZnHlDiFQAIgWROQqjYNBtSKdaXZ06zGcdvQTNa5zaEVtIVybhviLsM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":194378},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"46d9c6a75d55e88473b4e21f7c7e67dc7bc3bd31","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:ai":"ts-node examples/ai-automation.ts","build:watch":"modern build -w -c ./modern.config.ts","example:w3c":"ts-node examples/w3c-actions.ts","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts","example:metrics":"ts-node examples/performance-metrics.ts","example:monitoring":"ts-node examples/performance-monitoring.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.7.0","description":"Appium-based Android automation library for acabAI","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@acabai/web":"^1.4.4","webdriverio":"^8.32.3","@acabai/core":"^1.0.3","@acabai/shared":"^1.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","ts-node":"^10.9.2","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"peerDependencies":{"webdriverio":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/android_2.0.3_1747017062634_0.11588859375081717","host":"s3://npm-registry-packages-npm-production"}},"2.0.4":{"name":"@acabai/android","version":"2.0.4","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","_id":"@acabai/android@2.0.4","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"cdb33b41f5a3df4c530c506141cd2b15a90afe0e","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.4.tgz","fileCount":14,"integrity":"sha512-b1KS/BLmlEE3KxRObfvAS9EaSmeHvz/2PXWRqF2sXDxMgnTvkGVFoVBgjQr1ItgDwYibrLtdyTQKJjFYJL2pbg==","signatures":[{"sig":"MEUCICWcPDrIBhgusoNUMZB3TWbKqoJMUJYDyiLFRTW23YwJAiEAyb1ot6skMyB9DqT3oqSvFOH5weFl8eV8MGmC4rjIkdo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65601},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"7807cf1b4615851c0543b25e3fdf82b1009ad0e6","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:ai":"ts-node examples/ai-automation.ts","build:watch":"modern build -w -c ./modern.config.ts","example:w3c":"ts-node examples/w3c-actions.ts","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts","example:metrics":"ts-node examples/performance-metrics.ts","example:monitoring":"ts-node examples/performance-monitoring.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.9.2","description":"Appium-based Android automation library for acabAI","directories":{},"_nodeVersion":"23.10.0","dependencies":{"@acabai/web":"^1.4.4","webdriverio":"^8.32.3","@acabai/core":"^1.0.5","@acabai/shared":"^1.0.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","ts-node":"^10.9.2","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"peerDependencies":{"webdriverio":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/android_2.0.4_1747230158905_0.3255663274653673","host":"s3://npm-registry-packages-npm-production"}},"2.0.5":{"name":"@acabai/android","version":"2.0.5","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","_id":"@acabai/android@2.0.5","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"dist":{"shasum":"8b00faa8109b200261318a56b93e723975bd6cde","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.5.tgz","fileCount":14,"integrity":"sha512-XNNRAvY7xUDtwI49Bti1re93KQOCR1KSh1yZcbkqe28PCLpKrwif4u+goS94XhJOazgA5lI5e+EHA9kjjgEwaA==","signatures":[{"sig":"MEUCIQCY35QNGJQtc1oAaDLRc6JPwtKd2u2HNai6nrJh04LoyAIgPxe4CS5zA46jGUSLddWj5btgGQ/GiBbzp1MYFInP5hU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65601},"main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"gitHead":"7807cf1b4615851c0543b25e3fdf82b1009ad0e6","scripts":{"dev":"modern dev","test":"vitest --run","build":"modern build -c ./modern.config.ts","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:ai":"ts-node examples/ai-automation.ts","build:watch":"modern build -w -c ./modern.config.ts","example:w3c":"ts-node examples/w3c-actions.ts","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts","example:metrics":"ts-node examples/performance-metrics.ts","example:monitoring":"ts-node examples/performance-monitoring.ts"},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"_npmVersion":"10.9.2","description":"Appium-based Android automation library for acabAI","directories":{},"_nodeVersion":"23.10.0","dependencies":{"@acabai/web":"^1.6.0","webdriverio":"^8.32.3","@acabai/core":"^1.0.6","@acabai/shared":"^1.0.8"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"16.4.5","vitest":"3.0.5","ts-node":"^10.9.2","typescript":"^5.8.2","@types/node":"^18.0.0","@modern-js/module-tools":"2.60.6"},"peerDependencies":{"webdriverio":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/android_2.0.5_1747230552154_0.34137643959503117","host":"s3://npm-registry-packages-npm-production"}},"2.0.6":{"name":"@acabai/android","version":"2.0.6","description":"Appium-based Android automation library for acabAI","main":"./dist/lib/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","default":"./dist/lib/index.js"}},"scripts":{"dev":"modern dev","build":"modern build -c ./modern.config.ts","build:watch":"modern build -w -c ./modern.config.ts","test":"vitest --run","test:u":"vitest --run -u","test:ai":"MIDSCENE_CACHE=true npm run test","example:basic":"ts-node examples/basic-usage.ts","example:sauce":"ts-node examples/sauce-labs.ts","example:ai":"ts-node examples/ai-automation.ts","example:w3c":"ts-node examples/w3c-actions.ts","example:metrics":"ts-node examples/performance-metrics.ts","example:monitoring":"ts-node examples/performance-monitoring.ts"},"dependencies":{"@acabai/core":"^1.0.6","@acabai/shared":"^1.0.8","@acabai/web":"^1.6.1","webdriverio":"^8.32.3"},"devDependencies":{"@modern-js/module-tools":"2.60.6","@types/node":"^18.0.0","dotenv":"16.4.5","ts-node":"^10.9.2","typescript":"^5.8.2","vitest":"3.0.5"},"keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"license":"MIT","peerDependencies":{"webdriverio":"^8.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_id":"@acabai/android@2.0.6","gitHead":"7807cf1b4615851c0543b25e3fdf82b1009ad0e6","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Gdue2fX7Mk1EP1I6mh1lsyD3eaVwa8gRNk+adTTI7x8+yMAjVbHYq8fld2VTR7jQhuJc9RNt8UwOUrbJvRsaCA==","shasum":"8236d91a9a055403833afd06697d45a4bd66b4dc","tarball":"https://registry.npmjs.org/@acabai/android/-/android-2.0.6.tgz","fileCount":19,"unpackedSize":193951,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGcwJzYkVQjrx/SSE2B8DyvHS9KMK0oEZ2GBt+CxJUosAiAwtWjwfiN5WkC8fljiP7KpXtJHKlL/XzgNqDirmlyj3Q=="}]},"_npmUser":{"name":"nodevexcon","email":"icguner@hotmail.com"},"directories":{},"maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/android_2.0.6_1747231241589_0.3881982628803533"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-07T23:51:57.672Z","modified":"2025-05-14T14:00:41.964Z","1.0.0":"2025-05-07T23:51:58.019Z","1.0.1":"2025-05-08T00:04:29.327Z","2.0.0":"2025-05-11T19:35:30.536Z","2.0.1":"2025-05-11T19:53:57.216Z","2.0.3":"2025-05-12T02:31:02.885Z","2.0.4":"2025-05-14T13:42:39.078Z","2.0.5":"2025-05-14T13:49:12.321Z","2.0.6":"2025-05-14T14:00:41.773Z"},"license":"MIT","keywords":["android","automation","testing","ai","acabai","appium","webdriverio","mobile"],"description":"Appium-based Android automation library for acabAI","maintainers":[{"name":"nodevexcon","email":"icguner@hotmail.com"}],"readme":"# @acabai/android\n\nAndroid automation library for acabAI. Automate UI actions, extract data, and perform assertions using AI.\n\nThis package uses Appium and WebdriverIO to provide a robust and flexible Android automation solution.\n\n> **Note:** Version 2.0.0 introduces a complete rewrite using Appium and WebdriverIO. If you're migrating from v1.x, please refer to the [Migration Guide](./MIGRATION.md).\n\n## Installation\n\n```bash\nnpm install @acabai/android webdriverio\n```\n\nNote: You need to have Appium server installed and running to use this package. See [Appium Installation Guide](https://appium.io/docs/en/2.0/quickstart/install/) for details.\n\n## AI Methods\n\nThe Android agent provides powerful AI-powered methods for automating interactions with Android apps:\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `aiAction(prompt)` | Perform any action described in natural language | `await agent.aiAction('Find and tap on the Settings button')` |\n| `aiAssert(assertion)` | Check if a condition is true | `await agent.aiAssert('Is Wi-Fi enabled?')` |\n| `aiWaitFor(condition)` | Wait for a condition to be true | `await agent.aiWaitFor('The download is complete')` |\n| `aiQuery(prompt)` | Extract structured data | `await agent.aiQuery('{name: string, price: number}[], Find all products')` |\n\n### Example of AI-Powered Automation\n\n```typescript\nimport { agentFromLocalAppium, type AppiumBaseCapabilities } from '@acabai/android';\n\n// Create an agent using the local Appium server\nconst agent = await agentFromLocalAppium({\n  platformName: 'Android',\n  'appium:automationName': 'UiAutomator2',\n  'appium:deviceName': 'Android Device'\n});\n\n// Launch the settings app\nawait agent.launch('com.android.settings');\n\n// Use AI to find and tap on the \"Wi-Fi\" option\nawait agent.aiAction('Find and tap on the Wi-Fi option');\n\n// Use AI to check if Wi-Fi is enabled\nconst wifiStatus = await agent.aiAssert('Is Wi-Fi enabled?');\nconsole.log('Wi-Fi status:', wifiStatus);\n\n// Use AI to go back to the main settings screen\nawait agent.aiAction('Go back to the main settings screen');\n\n// Use AI to find and tap on the \"Display\" option\nawait agent.aiAction('Find and tap on the Display option');\n\n// Use AI to query information about the current brightness\nconst brightnessInfo = await agent.aiQuery('string, What is the current brightness level?');\nconsole.log('Brightness info:', brightnessInfo);\n```\n\n### Using Custom Appium Server (Hub URL)\n\n```typescript\nimport {\n  agentFromAppiumServer,\n  type AppiumServerConfig,\n  type AppiumBaseCapabilities\n} from '@acabai/android';\n\n// Define Appium server configuration (Hub URL)\nconst serverConfig: AppiumServerConfig = {\n  hostname: '192.168.1.100',  // Your Appium server hostname or IP\n  port: 4723,                 // Your Appium server port (default: 4723)\n  path: '/wd/hub',            // WebDriver path (default: '/wd/hub')\n  protocol: 'http'            // Protocol (http or https)\n};\n\n// The complete Hub URL will be: http://192.168.1.100:4723/wd/hub\n\n// Define capabilities for the Android device\nconst capabilities: AppiumBaseCapabilities = {\n  platformName: 'Android',\n  'appium:automationName': 'UiAutomator2',\n  'appium:deviceName': 'Android Device'\n};\n\n// Create an agent using the specified Appium server\nconst agent = await agentFromAppiumServer(serverConfig, capabilities);\n\n// You can also use environment variables to configure the server\n// Example:\n// const serverConfig: AppiumServerConfig = {\n//   hostname: process.env.APPIUM_HOST || 'localhost',\n//   port: parseInt(process.env.APPIUM_PORT || '4723'),\n//   path: process.env.APPIUM_PATH || '/wd/hub',\n//   protocol: (process.env.APPIUM_PROTOCOL || 'http') as 'http' | 'https'\n// };\n```\n\n## Using Sauce Labs for Cloud Testing\n\nSauce Labs provides cloud-based testing infrastructure for mobile apps. This package includes built-in support for Sauce Labs, making it easy to run your tests on a wide range of real Android devices in the cloud.\n\n### Basic Sauce Labs Setup\n\n```typescript\nimport {\n  agentFromSauceLabs,\n  type SauceLabsConfig,\n  type AppiumBaseCapabilities,\n  type SauceLabsCapabilities\n} from '@acabai/android';\nimport 'dotenv/config';\n\n// Define Sauce Labs configuration\nconst sauceConfig: SauceLabsConfig = {\n  user: process.env.SAUCE_USERNAME || 'your-username',\n  key: process.env.SAUCE_ACCESS_KEY || 'your-access-key',\n  region: 'us-west-1'  // Options: 'us-west-1', 'eu-central-1', 'apac-southeast-1'\n};\n\n// Define capabilities for the Android device\nconst capabilities: AppiumBaseCapabilities & SauceLabsCapabilities = {\n  platformName: 'Android',\n  'appium:automationName': 'UiAutomator2',\n  'appium:platformVersion': '12.0',\n  'appium:deviceName': 'Samsung Galaxy S21',\n  'sauce:options': {\n    build: 'my-build-name',\n    name: 'my-test-name',\n    appiumVersion: '2.0.0'\n  }\n};\n\n// Create an agent using Sauce Labs\nconst agent = await agentFromSauceLabs(sauceConfig, capabilities);\n\n// Use AI methods for automation\nawait agent.aiAction('Find and tap on the Settings button');\nawait agent.aiAssert('Is Wi-Fi enabled?');\n```\n\n### Example .env File for Sauce Labs\n\n```\nSAUCE_USERNAME=your-sauce-username\nSAUCE_ACCESS_KEY=your-sauce-access-key\n```\n\n### Taking Screenshots with Sauce Labs\n\nThe package includes support for taking screenshots using the Sauce Labs agent:\n\n```typescript\n// Take a screenshot using Sauce Labs\nawait agent.page.takeScreenshot('test-screenshot');\n\n// The screenshot will be available in your Sauce Labs dashboard\n```\n\n## Required Appium Capabilities\n\nThe following capabilities are required for basic Appium functionality:\n\n- `platformName`: Must be 'Android'\n- `appium:automationName`: Recommended to use 'UiAutomator2'\n- `appium:deviceName`: A name for the device (can be arbitrary for real devices)\n\nAdditional useful capabilities:\n\n- `appium:udid`: Device ID for connecting to a specific device\n- `appium:app`: Path or URL to the APK file\n- `appium:appPackage`: Package name of the app\n- `appium:appActivity`: Activity name to launch\n- `appium:autoGrantPermissions`: Automatically grant app permissions\n\n## Remote Appium Server Configuration\n\nWhen working with remote Appium servers, you can use environment variables to simplify configuration:\n\n```typescript\n// Load environment variables from .env file\nimport 'dotenv/config';\n\n// Define Appium server configuration using environment variables\nconst serverConfig: AppiumServerConfig = {\n  hostname: process.env.APPIUM_HOST || 'localhost',\n  port: parseInt(process.env.APPIUM_PORT || '4723'),\n  path: process.env.APPIUM_PATH || '/wd/hub',\n  protocol: (process.env.APPIUM_PROTOCOL || 'http') as 'http' | 'https'\n};\n\n// Create an agent using the specified Appium server\nconst agent = await agentFromAppiumServer(serverConfig, capabilities);\n\n// Use AI methods for automation\nawait agent.aiAction('Find and tap on the Settings button');\n```\n\nExample .env file:\n```\nAPPIUM_HOST=192.168.1.100\nAPPIUM_PORT=4725\nAPPIUM_PATH=/wd/hub\nAPPIUM_PROTOCOL=http\n```\n\n## W3C Actions API\n\nVersion 2.0.0 uses the W3C Actions API for touch interactions instead of the deprecated TouchAction API. This provides better compatibility with modern Appium versions and follows the WebDriver standard.\n\n### Example of W3C Actions API Usage\n\n```typescript\n// Tap at specific coordinates\nawait agent.page.tap(100, 200);\n\n// Swipe from one point to another\nawait agent.page.swipe(\n  100, 200,  // start coordinates (x, y)\n  300, 400,  // end coordinates (x, y)\n  800        // duration in milliseconds\n);\n\n// Type text using keyboard actions\nawait agent.page.keyboard.type('Hello World');\n```\n\nFor a complete example, see the [W3C Actions example](./examples/w3c-actions.ts).\n\n## Device Performance Metrics\n\nYou can retrieve various performance metrics from Android devices using the WebdriverIO API. This is useful for monitoring device performance during test execution.\n\n### Example of Retrieving Performance Metrics\n\n```typescript\n// Get the WebdriverIO driver instance\nconst driver = (agent.page as any).driver;\n\n// Get available performance data types\nconst performanceTypes = await driver.getPerformanceDataTypes();\nconsole.log('Available performance data types:', performanceTypes);\n\n// Get CPU info\nconst cpuInfo = await driver.getPerformanceData('com.android.settings', 'cpuinfo', 5);\n\n// Get memory info\nconst memoryInfo = await driver.getPerformanceData('com.android.settings', 'memoryinfo', 5);\n\n// Get battery info\nconst batteryInfo = await driver.getPerformanceData('com.android.settings', 'batteryinfo', 5);\n\n// Get network info\nconst networkInfo = await driver.getPerformanceData('com.android.settings', 'networkinfo', 5);\n\n// Execute custom adb shell commands for additional metrics\nconst deviceModel = await driver.executeScript('mobile: shell', [{\n  command: 'getprop ro.product.model'\n}]);\n\nconst totalRam = await driver.executeScript('mobile: shell', [{\n  command: 'cat /proc/meminfo | grep MemTotal'\n}]);\n```\n\nFor a complete example, see the [Performance Metrics example](./examples/performance-metrics.ts).\n\n### Continuous Performance Monitoring\n\nFor more advanced performance monitoring during test execution, you can use the `PerformanceMonitor` class:\n\n```typescript\nimport { PerformanceMonitor } from '@acabai/android';\n\n// Create a performance monitor for a specific app package\nconst performanceMonitor = new PerformanceMonitor(agent.page, 'com.example.app');\n\n// Initialize the monitor and get available metrics\nawait performanceMonitor.initialize();\n\n// Get device information\nconst deviceInfo = await performanceMonitor.getDeviceInfo();\n\n// Start monitoring performance metrics every 2 seconds\nperformanceMonitor.startMonitoring(2000);\n\n// Perform your test actions...\n\n// Stop monitoring\nperformanceMonitor.stopMonitoring();\n\n// Get collected metrics\nconst metrics = performanceMonitor.getMetrics();\n\n// Export metrics to JSON\nconst metricsJson = performanceMonitor.exportMetricsToJson();\n```\n\nThe `PerformanceMonitor` class provides the following features:\n- Collecting CPU, memory, battery, and network metrics\n- Getting detailed device information\n- Continuous monitoring at specified intervals\n- Exporting metrics to JSON for analysis\n\nFor a complete example with HTML report generation, see the [Performance Monitoring example](./examples/performance-monitoring.ts).\n\n## License\n\nacabAI is MIT licensed.","readmeFilename":"README.md"}