{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium-adb/issues/310","repository_url":"https://api.github.com/repos/appium/appium-adb","labels_url":"https://api.github.com/repos/appium/appium-adb/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium-adb/issues/310/comments","events_url":"https://api.github.com/repos/appium/appium-adb/issues/310/events","html_url":"https://github.com/appium/appium-adb/pull/310","id":307205163,"number":310,"title":"Fix auto detection main-activity","user":{"login":"KazuCocoa","id":5511591,"avatar_url":"https://avatars3.githubusercontent.com/u/5511591?v=4","gravatar_id":"","url":"https://api.github.com/users/KazuCocoa","html_url":"https://github.com/KazuCocoa","followers_url":"https://api.github.com/users/KazuCocoa/followers","following_url":"https://api.github.com/users/KazuCocoa/following{/other_user}","gists_url":"https://api.github.com/users/KazuCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/KazuCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KazuCocoa/subscriptions","organizations_url":"https://api.github.com/users/KazuCocoa/orgs","repos_url":"https://api.github.com/users/KazuCocoa/repos","events_url":"https://api.github.com/users/KazuCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/KazuCocoa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-21T11:21:06Z","updated_at":"2018-03-21T16:16:49Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/appium/appium-adb/pulls/310","html_url":"https://github.com/appium/appium-adb/pull/310","diff_url":"https://github.com/appium/appium-adb/pull/310.diff","patch_url":"https://github.com/appium/appium-adb/pull/310.patch"},"body":"When I ran with the following capability case, appium server failed to launch app. => [full log](https://gist.github.com/KazuCocoa/d9de39af98dbe62301b6bd8af3b55a01)\r\n\r\n```\r\ninfo: [Appium] Capabilities:\r\ninfo: [Appium]   platformName: Android\r\ninfo: [Appium]   deviceName: Android\r\ninfo: [Appium]   automationName: uiautomator2\r\ninfo: [Appium]   app: /Users/kazuaki/GitHub/AppiumRegressionCheck/test/../test_app/ApiDemos-debug.apk\r\n```\r\n(The ApiDemos is Appium's demo app.)\r\n\r\nThe reason was failed to detect activity the server should launch. The detection worked with Appium 1.7.2, but it started failing after https://github.com/appium/appium-adb/pull/296\r\n\r\n- With `Appium 1.7.2`, we can see the below log.\r\n    ```\r\n    [debug] [ADB] badging package: io.appium.android.apis\r\n    [debug] [ADB] badging act: io.appium.android.apis.ApiDemos\r\n    ```\r\n- After  https://github.com/appium/appium-adb/pull/296 , we can see the following logs and failed to detect the main activity the appium server should launch.\r\n    ```\r\n    [info] [ADB] Package name: 'io.appium.android.apis'\r\n    [info] [ADB] Main activity name: 'ApiDemos'\r\n    ```\r\n    - The demoapp's result of analyser is [this](https://gist.github.com/KazuCocoa/1aa046ebf2a5ed74cf36d8afde708c0f). You can see `android:name=\"ApiDemos\"`\r\n\r\nAfter this PR, we can see the following log instead of the above and succeeds to launch the test app as well as Appium 1.7.2.\r\n\r\n```\r\ninfo: [ADB] Package name: 'io.appium.android.apis'\r\ninfo: [ADB] Main activity name: 'io.appium.android.apis.ApiDemos'\r\n```\r\n\r\nIf we consider variations, the logic will be complex, I guess. So, I just try to care simple case. The name has no separation `.` like the demo app.\r\n\r\nWhat do you think?\r\n\r\n----\r\n\r\nlink: https://github.com/Magic-Pod/AppiumRegressionCheck/issues/2"},"comment":{"url":"https://api.github.com/repos/appium/appium-adb/issues/comments/375001676","html_url":"https://github.com/appium/appium-adb/pull/310#issuecomment-375001676","issue_url":"https://api.github.com/repos/appium/appium-adb/issues/310","id":375001676,"user":{"login":"dpgraham","id":852574,"avatar_url":"https://avatars2.githubusercontent.com/u/852574?v=4","gravatar_id":"","url":"https://api.github.com/users/dpgraham","html_url":"https://github.com/dpgraham","followers_url":"https://api.github.com/users/dpgraham/followers","following_url":"https://api.github.com/users/dpgraham/following{/other_user}","gists_url":"https://api.github.com/users/dpgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgraham/subscriptions","organizations_url":"https://api.github.com/users/dpgraham/orgs","repos_url":"https://api.github.com/users/dpgraham/repos","events_url":"https://api.github.com/users/dpgraham/events{/privacy}","received_events_url":"https://api.github.com/users/dpgraham/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T16:16:48Z","updated_at":"2018-03-21T16:16:48Z","author_association":"CONTRIBUTOR","body":"@KazuCocoa There was also a change to `appium-android-driver` that fixes this (https://github.com/appium/appium-uiautomator2-driver/pull/148)"}}
{"actor":{"display_login":"dpgraham"}}