{ "id": "174695", "key": "TIMOB-27750", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" }, { "id": "20987", "name": "node-titanium-sdk 4.3.1", "archived": false, "released": true, "releaseDate": "2020-02-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-02-12T11:35:19.000+0000", "created": "2020-02-06T15:01:00.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "cb-tooling" ], "versions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" } ], "issuelinks": [ { "id": "58150", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "170042", "key": "TIMOB-25406", "fields": { "summary": "Android: First run for emulator doesn't see emulator started", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2020-02-12T11:35:19.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "We're seeing native modules builds (like this one for ti.map: https://jenkins.appcelerator.org/blue/organizations/jenkins/modules%2Fti.map/detail/PR-285/9/pipeline/) failing to run our test suite because once it generates a project and launches, it never seems to think the emulator is fully booted. I can reproduce locally. If I pre-boot an emulator and launch, it recognizes the emulator has booted and works. If I don't have one up and running, it fails to recognize when the emulator has booted.", "attachment": [], "flagged": false, "summary": "Android: CLI fails to recognize avd emulator is booted when it starts it", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 1179, "state": "closed", "name": "2020 Sprint 3", "startDate": "2020-02-03T16:58:00.000Z", "endDate": "2020-02-14T16:58:00.000Z", "completeDate": "2020-02-17T09:45:06.128Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "454093", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "My best guess here is that the adb:track-devices command isn't re-firing when the device has booted up. I assume it used to to denote a \"state\" change, but suddenly it no longer does so, so the node-titanium-sdk code just never re-checks on it's own to see if the emulator has booted?\r\n\r\nhttps://github.com/appcelerator/node-titanium-sdk/blob/master/lib/emulator.js#L233-L280", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-02-06T15:11:46.000+0000", "updated": "2020-02-06T15:11:54.000+0000" }, { "id": "454094", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Adding some logging, in this case \"adb host:track-devices\" typically gets called twice. Once with \"undefined\" (aka no devices running), and then again when he emulator process starts (with a value like \"emulator5554 offline\"). But in the second case, the emulator boots pretty much *immediately* due to snapshots - so while adb is reporting the emulator is alive but \"offline\" it's actually booted almost instantaneously - but \"adb host:track-devices\" won't fire again. So we'll see the initial offline state and wait around for another event that never happens.\r\n\r\nIt looks like we can't rely on \"adb host:track-devices\" to be the only trigger for re-checking emulator state.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-02-06T15:36:41.000+0000", "updated": "2020-02-06T15:36:41.000+0000" }, { "id": "454096", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/node-titanium-sdk/pull/140", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-02-06T16:17:07.000+0000", "updated": "2020-02-06T16:17:07.000+0000" }, { "id": "454104", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For everyone's info, this is only an issue when launching the Android emulator via QuickBoot/Snapshot.\r\n\r\n*Steps to reproduce:*\r\n# Ensure you have Android Emulator (aka: AVD) version {{27.0.2}} installed.\r\n# Launch the emulator by handle.\r\n# Quit the emulator via the {{\\[x\\]}} button, which will auto-create a snapshot. (Do not shut it down via virtual power button.)\r\n# Launch emulator via Titanium CLI.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-06T20:05:54.000+0000", "updated": "2020-02-06T20:05:54.000+0000" }, { "id": "454105", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Possibly related to TIMOB-25406, TIMOB-25194, and TIMOB-19995.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2020-02-06T20:27:41.000+0000", "updated": "2020-02-06T20:27:41.000+0000" }, { "id": "454106", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I cannot reproduce. I've tried both from the SDK (master/9.0.0) and by directly invoking node-titanium-sdk's ADB via Node's REPL and they both work. I've looked at the current code as well as the proposed PR and I can't find anything wrong with the current code other than {{isRunning()}} could possibly be renamed to {{isReady()}}.\r\n\r\nIf a device is \"offline\", then it might as well be shutdown. I don't believe we can connect via ADB to a device that is \"offline\", thus given the context, we need {{isRunning()}} to return {{true}} if and only if the device is online and ready.\r\n\r\nFurthermore, you can't even get Android Emulator 27.0.2. The latest as of today is 29.3.4. There's no way to downgrade. I find it hard to believe that code that hasn't been touched in over a year does NOT work with 27.0.2, but works with 29.3.4.\r\n\r\nI'm curious about how/why {{trackDevices()}} would only emit an \"offline\" event without a subsequent \"device\" event? In my testing, I could always get the \"device\" event. Are you seeing a race condition? Can you reproduce by manually invoking node-titanium-sdk?\r\n\r\nSo, until I see some more reason/proof, I do NOT think we should merge the PR.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2020-02-06T21:18:38.000+0000", "updated": "2020-02-06T21:18:38.000+0000" }, { "id": "454114", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Happens for us every time. cb: You can try our app if you want. It definitely does not happen for all apps, but at least for some of them (maybe our modules / Alloy play into it).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-02-07T11:56:23.000+0000", "updated": "2020-02-07T11:56:23.000+0000" }, { "id": "454121", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "The updated node-titanium-sdk 4.3.1 with the fix is in master. Anecdotally, the ti.map PR that was previously failing with this issue now builds/passes: https://github.com/appcelerator-modules/ti.map/pull/285", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-02-07T16:44:14.000+0000", "updated": "2020-02-07T16:44:14.000+0000" }, { "id": "454123", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], there are 2 work-arounds you can do \"now\" if you can't wait.\r\n\r\n1) Shutdown the emulator via the virtual power button like how you do it on a real device. That is, do not quit the emulator via the {{\\[x\\]}} button. When you \"quit\" the emulator, it will take a snapshot by default which it will quickboot from upon the next launch.\r\n\r\n2) Disable the \"Quick Boot\" option in the emulator's conifg window. This will force it to do a cold boot every time.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-07T18:45:03.000+0000", "updated": "2020-02-07T18:45:03.000+0000" }, { "id": "454201", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version 9.0.0.v20200211122336.\r\n\r\nTest and other information can be found at:\r\nhttps://github.com/appcelerator/node-titanium-sdk/pull/140", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-12T11:35:13.000+0000", "updated": "2020-02-12T11:35:13.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }