{ "id": "170530", "key": "DAEMON-200", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12519", "key": "DAEMON", "name": "Appcelerator Daemon" }, "fixVersions": [ { "id": "18407", "description": "", "name": "Appc Daemon 1.0.0", "archived": false, "released": true, "releaseDate": "2017-12-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-12-04T19:04:30.000+0000", "created": "2017-12-04T09:33:32.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "18407", "description": "", "name": "Appc Daemon 1.0.0", "archived": false, "released": true, "releaseDate": "2017-12-05" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-12-05T16:50:55.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15051", "name": "androidlib", "description": "Library for Android related functions" }, { "id": "15622", "name": "appcd-plugin-android" } ], "description": "Steps to Reproduce:\r\n1. Restart the system and make sure to plug out connected android device\r\n2. Start Daemon\r\n3. Run the command \"/android/1.x/info\". The devices section is blank as no device connected yet\r\n4. Connect the device.\r\n5. Again run the command \"/android/1.x/info\".\r\n\r\nActual Result:\r\nThe device section still shows blank and does not show the connected device.\r\nThe device is shown in \"appc ti info\".\r\nNote: Repeating step 5 continues to give device as blank untill daemon is restarted.\r\n\r\nFind attached the daemon dump.", "attachment": [ { "id": "63714", "filename": "androidIssue.json", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-04T09:32:51.000+0000", "size": 483521, "mimeType": "application/json" }, { "id": "63719", "filename": "dump.json", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T16:50:55.000+0000", "size": 8285636, "mimeType": "application/json" } ], "flagged": false, "summary": "Android device not detected when plugged in after daemon start upon system restart", "creator": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OS 10.13, Win Pro 10\r\nAppc CLI: 7.0.0-master.54\r\nAppcd: 1.0.0-29\r\nNode.js: 8.9.1", "closedSprints": [ { "id": 977, "state": "closed", "name": "2017 Sprint 25 Tooling", "startDate": "2017-12-03T23:21:41.825Z", "endDate": "2017-12-17T23:21:00.000Z", "completeDate": "2017-12-18T22:30:55.005Z", "originBoardId": 219 } ], "comment": { "comments": [ { "id": "431690", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "androidlib: https://github.com/appcelerator/androidlib/commit/0c58c695970ebd3833b32c1b2b58b3af5c313988\r\nAppc Daemon master PR: https://github.com/appcelerator/appc-daemon/pull/216\r\nAppc Daemon 1_0_X PR: https://github.com/appcelerator/appc-daemon/pull/217", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-12-04T19:01:03.000+0000", "updated": "2017-12-04T19:03:04.000+0000" }, { "id": "431706", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am still having issues with master.56. [~amukherjee],is having the same issue as well.\r\n\r\n1. Disconnect the connected device/s.\r\n2. Do a {{adb kill-server}}.\r\n3. Do a {{adb start-server}}.\r\n4. Connect the device.\r\n5. Run {{appc appcd exec /android/latest/info/devices}}.\r\n6. I get an empty array object.\r\n7. Run {{appc appcd restart}}.\r\n8. Run {{appc appcd exec /android/latest/info/devices}}.\r\n9. Device is detected successfully.\r\n\r\n\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T03:50:09.000+0000", "updated": "2017-12-05T03:50:09.000+0000" }, { "id": "431707", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Please attach a dump file immediately after reproducing the problem.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-12-05T03:54:31.000+0000", "updated": "2017-12-05T03:54:31.000+0000" }, { "id": "431723", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~lchoudhary] Am I right in assuming that prior to killing the adb server the daemon is running and the android info service has been exec'd once? I was able to reproduce if everything was running beforehand.\r\n\r\n[~cbarber] Looking at it I think that it's tangentially related to DAEMON-164, in that we don't reinit adb if we get a close event. Restart obviously works as we're resetting back to the beginning, a simple change like the below isn't pretty but fixes it in the short-term, alternatively I guess the info service could poll an adb.connect call from androidlib and call initDevices() when it gets a valid response to maybe make it less chatty\r\n\r\n{code}\r\ndiff --git a/plugins/appcd-plugin-android/src/android-info-service.js b/plugins/appcd-plugin-android/src/android-info-service.js\r\nindex a271c38..c5ef498 100644\r\n--- a/plugins/appcd-plugin-android/src/android-info-service.js\r\n+++ b/plugins/appcd-plugin-android/src/android-info-service.js\r\n@@ -62,6 +62,9 @@ export default class AndroidInfoService extends DataServiceDispatcher {\r\n \t\t\t.on('close', () => {\r\n \t\t\t\tconsole.log('ADB connection was closed');\r\n \t\t\t\tgawk.set(this.data.devices, []);\r\n+\t\t\t\tsetTimeout(async () => {\r\n+\t\t\t\t\tawait this.initDevices();\r\n+\t\t\t\t}, 1000);\r\n \t\t\t})\r\n \t\t\t.once('error', err => {\r\n \t\t\t\tconsole.log('Track devices returned error: %s', err.message);\r\n\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-12-05T13:00:10.000+0000", "updated": "2017-12-05T13:10:24.000+0000" }, { "id": "431728", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~eharris], yes I would assume so as I had studio running which was showing the devices, which means {{android info service}} would have been called by studio.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T16:39:44.000+0000", "updated": "2017-12-05T16:39:44.000+0000" }, { "id": "431729", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cbarber], here's the dump: [^dump.json] .", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-05T16:50:24.000+0000", "updated": "2017-12-05T16:50:24.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }