haydenbleasel / corellium-typescript

A simple and beautiful TypeScript SDK for Corellium
https://www.npmjs.com/package/corellium-typescript
MIT License
1 stars 0 forks source link

ready for device returns Error on agent not ready #19

Closed kelvissu closed 1 month ago

kelvissu commented 1 month ago

const ready = await corellium.device('deviceId').ready(); When run on a IOS device in creation returns the following:

Error: Agent not yet available.
    at Object.ready (/home/kelvissu/source/ui-test/node_modules/corellium-typescript/dist/index.js:1:23764)
    at async CorelliumTs.areyouready (/home/kelvissu/source/ui-test/test/helpers/corellium-ts.ts:56:19)
    at async Context.<anonymous> (/home/kelvissu/source/ui-test/test/specs/ios_device.ts:46:5)

This is because the method throws an error when the agent isn't available. Should this be doing this? I believe it should instead return { ready: false } so that we can detect when the agent is ready.

haydenbleasel commented 1 month ago

Fixed - no need for a try catch anymore and the ready() command returns the boolean instead of { ready: boolean }