{ "id": "171324", "key": "TIMOB-25867", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-07T02:39:35.000+0000", "created": "2018-03-14T17:06:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" }, { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" }, { "id": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "issuelinks": [ { "id": "56574", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171745", "key": "TIMOB-26099", "fields": { "summary": "Android: CLI \"appc run\" should launch app with intent action MAIN category LAUNCHER", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-06-28T22:18:23.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" } ], "description": "Starting an Android application with 'appc run' or 'ti build' causes it to flicker at start when the main activity is launched.\r\nLaunching afterwards from the device works just fine.", "attachment": [], "flagged": false, "summary": "Android: Running an application through CLI flickers it's main activity at launch.", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "environment": null, "comment": { "comments": [ { "id": "435590", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/node-titanium-sdk/pull/26", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-03-14T17:26:51.000+0000", "updated": "2018-03-14T17:26:51.000+0000" }, { "id": "435681", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "titanium-mobile PR: https://github.com/appcelerator/titanium_mobile/pull/9938", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-03-16T16:50:34.000+0000", "updated": "2018-03-16T16:50:34.000+0000" }, { "id": "438139", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ybanev], removing the \"-n\" parameter triggers our \"Restart Required\" dialog on app startup and it gets stuck in an infinite loop displaying this dialog. This happens to me on a real Pixel XL device. Note that not all devices exhibit this behavior, but it shows that the default intent handling is not the same across all devices and we should be explicit.\r\n\r\nI think a better solution would be to keep the \"-n\" parameter (it is needed to specify the package/activity name)... and also provide intent parameters action \"MAIN\" and category \"LAUNCHER\" so that we'll correctly simulate an app launch from the app menu.\r\n\r\nFor example:\r\n{code}\r\n./adb shell am start -n com.appcelerator.testing/.ClassicapptestActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000\r\n{code}\r\n\r\nI'll write up a PR since what I'm doing solves another problem as well.\r\n\r\n_Edit: Added \"-f 0x10200000\" intent flags parameter which sets {{FLAG_ACTIVITY_NEW_TASK}} and {{FLAG_ACTIVITY_RESET_TASK_IF_NEEDED}}. I've verified that these flags are set when launch from the app menu on the newest Android OS versions. Android 4.1 only sets the {{FLAG_ACTIVITY_NEW_TASK}} flag, but adding the 2nd flag is harmless for that version._", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-05T19:17:12.000+0000", "updated": "2018-06-05T20:18:35.000+0000" }, { "id": "438141", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~jquick] I checked it and it seemed that the {{-n}} flag had no effect. Both running the command's help and the docs do not indicate that the {{-n}} flag does anything: https://developer.android.com/studio/command-line/adb#am.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-06-05T20:17:10.000+0000", "updated": "2018-06-05T20:17:10.000+0000" }, { "id": "438142", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cbarber],\r\n\r\nJust updated my comment. It happens to me on a real Pixel XL device. Not all devices have this behavior though.\r\n\r\nI'm going to go ahead with my changes since those extra arguments is how Android Studio does it.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-05T20:19:30.000+0000", "updated": "2018-06-05T20:19:30.000+0000" }, { "id": "438145", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also, the {{-n}} flag is used to specify the component name for the intent as documented here...\r\nhttps://developer.android.com/studio/command-line/adb#IntentSpec\r\n\r\nI agree that the way Google documents it in the link below doesn't make it clear, but in {{start [options] intent}}, the {{intent}} part takes the intent arguments in the link above.\r\nhttps://developer.android.com/studio/command-line/adb#am\r\n\r\nCase-in-point, I can do the following to show our website via the default web browser app...\r\n{code}\r\n./adb shell am start -a android.intent.action.VIEW -d https://www.appcelerator.com\r\n{code}\r\n\r\nDevelopers sometimes do stuff like the above to easily test their app's intent-filter handling, such as with customer URL schemes.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-05T21:31:33.000+0000", "updated": "2018-06-05T21:31:33.000+0000" }, { "id": "438842", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.3.0.v20180628132121.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-28T22:18:17.000+0000", "updated": "2018-06-28T22:18:17.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }