{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/240015905","pull_request_review_id":182956300,"id":240015905,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDAxNTkwNQ==","diff_hunk":"@@ -195,15 +195,23 @@ def install_apks(device_serial, app_apk_path, tests_apk_path)\n     end\n \n     def uninstall_apks(device_serial, app_package_name, tests_package_name)\n-      UI.message('Uninstalling app APK')\n-      run_adb_command(\"adb -s #{device_serial} uninstall #{app_package_name}\",\n-                      print_all: true,\n-                      print_command: true)\n+      packages = run_adb_command(\"adb -s #{device_serial} shell pm list packages #{app_package_name}\",\n+                                 print_all: true,\n+                                 print_command: true)\n \n-      UI.message('Uninstalling tests APK')\n-      run_adb_command(\"adb -s #{device_serial} uninstall #{tests_package_name}\",\n-                      print_all: true,\n-                      print_command: true)\n+      if packages =~ /#{app_package_name}/","path":"screengrab/lib/screengrab/runner.rb","position":16,"original_position":16,"commit_id":"aa6fd541c0969686ff4674092b64c83fe42a8d11","original_commit_id":"aa6fd541c0969686ff4674092b64c83fe42a8d11","user":{"login":"janpio","id":183673,"node_id":"MDQ6VXNlcjE4MzY3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/183673?v=4","gravatar_id":"","url":"https://api.github.com/users/janpio","html_url":"https://github.com/janpio","followers_url":"https://api.github.com/users/janpio/followers","following_url":"https://api.github.com/users/janpio/following{/other_user}","gists_url":"https://api.github.com/users/janpio/gists{/gist_id}","starred_url":"https://api.github.com/users/janpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpio/subscriptions","organizations_url":"https://api.github.com/users/janpio/orgs","repos_url":"https://api.github.com/users/janpio/repos","events_url":"https://api.github.com/users/janpio/events{/privacy}","received_events_url":"https://api.github.com/users/janpio/received_events","type":"User","site_admin":false},"body":"We have an `AdbHelper` class that could be used to house a new `installed_packages` that returns a list of package names that are installed instead of 1 big string. Would that make sense?","created_at":"2018-12-08T20:38:03Z","updated_at":"2018-12-08T20:38:17Z","html_url":"https://github.com/fastlane/fastlane/pull/13656#discussion_r240015905","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/13656","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/240015905"},"html":{"href":"https://github.com/fastlane/fastlane/pull/13656#discussion_r240015905"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/13656"}},"in_reply_to_id":240015877},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/13656","id":229278020,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5Mjc4MDIw","html_url":"https://github.com/fastlane/fastlane/pull/13656","diff_url":"https://github.com/fastlane/fastlane/pull/13656.diff","patch_url":"https://github.com/fastlane/fastlane/pull/13656.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/13656","number":13656,"state":"open","locked":false,"title":"[screengrab] check if package is already installed before uninstalling","user":{"login":"joeboyscout04","id":1489809,"node_id":"MDQ6VXNlcjE0ODk4MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1489809?v=4","gravatar_id":"","url":"https://api.github.com/users/joeboyscout04","html_url":"https://github.com/joeboyscout04","followers_url":"https://api.github.com/users/joeboyscout04/followers","following_url":"https://api.github.com/users/joeboyscout04/following{/other_user}","gists_url":"https://api.github.com/users/joeboyscout04/gists{/gist_id}","starred_url":"https://api.github.com/users/joeboyscout04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeboyscout04/subscriptions","organizations_url":"https://api.github.com/users/joeboyscout04/orgs","repos_url":"https://api.github.com/users/joeboyscout04/repos","events_url":"https://api.github.com/users/joeboyscout04/events{/privacy}","received_events_url":"https://api.github.com/users/joeboyscout04/received_events","type":"User","site_admin":false},"body":"…to prevent error on later versions of Android.\r\n\r\n<!-- Thanks for contributing to _fastlane_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->\r\n\r\n### Checklist\r\n- [x] I've run `bundle exec rspec` from the root directory to see all new and existing tests pass\r\n- [x] I've followed the _fastlane_ code style and run `bundle exec rubocop -a` to ensure the code style is valid\r\n- [x] I've read the [Contribution Guidelines](https://github.com/fastlane/fastlane/blob/master/CONTRIBUTING.md)\r\n- [x] I've updated the documentation if necessary.\r\n\r\n### Motivation and Context\r\n<!-- Why is this change required? What problem does it solve? -->\r\n<!-- If it fixes an open issue, please link to the issue here. -->\r\nFixes #9825  by checking if app is installed before attempting to uninstall. \r\n\r\n### Description\r\n<!-- Describe your changes in detail -->\r\nRun `adb -s #{device_serial} shell pm list packages #{app_package_name}\"` to determine packages on the device, and then check to make sure the package exists before uninstalling. \r\nBased on suggestions in comments of #9825 \r\n<!-- Please describe in detail how you tested your changes. -->\r\nTested against a physical device that has the issue on newer Android devices (Nexus 5, Android 8.1.0).  Also tested on older Android device (Android 5.x).  \r\n\r\nThanks!","created_at":"2018-11-08T07:58:38Z","updated_at":"2018-12-08T20:38:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04abb2f1b6cf4326cee320b36748d4e01a42324b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":560540952,"node_id":"MDU6TGFiZWw1NjA1NDA5NTI=","url":"https://api.github.com/repos/fastlane/fastlane/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false},{"id":516992007,"node_id":"MDU6TGFiZWw1MTY5OTIwMDc=","url":"https://api.github.com/repos/fastlane/fastlane/labels/status:%20needs-attention","name":"status: needs-attention","color":"FF71C2","default":false},{"id":337787114,"node_id":"MDU6TGFiZWwzMzc3ODcxMTQ=","url":"https://api.github.com/repos/fastlane/fastlane/labels/tool:%20screengrab","name":"tool: screengrab","color":"bfe5bf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/13656/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/13656/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/13656/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/aa6fd541c0969686ff4674092b64c83fe42a8d11","head":{"label":"joeboyscout04:fix/9825/reinstall-screengrab","ref":"fix/9825/reinstall-screengrab","sha":"aa6fd541c0969686ff4674092b64c83fe42a8d11","user":{"login":"joeboyscout04","id":1489809,"node_id":"MDQ6VXNlcjE0ODk4MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1489809?v=4","gravatar_id":"","url":"https://api.github.com/users/joeboyscout04","html_url":"https://github.com/joeboyscout04","followers_url":"https://api.github.com/users/joeboyscout04/followers","following_url":"https://api.github.com/users/joeboyscout04/following{/other_user}","gists_url":"https://api.github.com/users/joeboyscout04/gists{/gist_id}","starred_url":"https://api.github.com/users/joeboyscout04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeboyscout04/subscriptions","organizations_url":"https://api.github.com/users/joeboyscout04/orgs","repos_url":"https://api.github.com/users/joeboyscout04/repos","events_url":"https://api.github.com/users/joeboyscout04/events{/privacy}","received_events_url":"https://api.github.com/users/joeboyscout04/received_events","type":"User","site_admin":false},"repo":{"id":156571100,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY1NzExMDA=","name":"fastlane","full_name":"joeboyscout04/fastlane","private":false,"owner":{"login":"joeboyscout04","id":1489809,"node_id":"MDQ6VXNlcjE0ODk4MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1489809?v=4","gravatar_id":"","url":"https://api.github.com/users/joeboyscout04","html_url":"https://github.com/joeboyscout04","followers_url":"https://api.github.com/users/joeboyscout04/followers","following_url":"https://api.github.com/users/joeboyscout04/following{/other_user}","gists_url":"https://api.github.com/users/joeboyscout04/gists{/gist_id}","starred_url":"https://api.github.com/users/joeboyscout04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeboyscout04/subscriptions","organizations_url":"https://api.github.com/users/joeboyscout04/orgs","repos_url":"https://api.github.com/users/joeboyscout04/repos","events_url":"https://api.github.com/users/joeboyscout04/events{/privacy}","received_events_url":"https://api.github.com/users/joeboyscout04/received_events","type":"User","site_admin":false},"html_url":"https://github.com/joeboyscout04/fastlane","description":"🚀 The easiest way to automate building and releasing your iOS and Android apps","fork":true,"url":"https://api.github.com/repos/joeboyscout04/fastlane","forks_url":"https://api.github.com/repos/joeboyscout04/fastlane/forks","keys_url":"https://api.github.com/repos/joeboyscout04/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joeboyscout04/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joeboyscout04/fastlane/teams","hooks_url":"https://api.github.com/repos/joeboyscout04/fastlane/hooks","issue_events_url":"https://api.github.com/repos/joeboyscout04/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/joeboyscout04/fastlane/events","assignees_url":"https://api.github.com/repos/joeboyscout04/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/joeboyscout04/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/joeboyscout04/fastlane/tags","blobs_url":"https://api.github.com/repos/joeboyscout04/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joeboyscout04/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joeboyscout04/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/joeboyscout04/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joeboyscout04/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/joeboyscout04/fastlane/languages","stargazers_url":"https://api.github.com/repos/joeboyscout04/fastlane/stargazers","contributors_url":"https://api.github.com/repos/joeboyscout04/fastlane/contributors","subscribers_url":"https://api.github.com/repos/joeboyscout04/fastlane/subscribers","subscription_url":"https://api.github.com/repos/joeboyscout04/fastlane/subscription","commits_url":"https://api.github.com/repos/joeboyscout04/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/joeboyscout04/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/joeboyscout04/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/joeboyscout04/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/joeboyscout04/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/joeboyscout04/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joeboyscout04/fastlane/merges","archive_url":"https://api.github.com/repos/joeboyscout04/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joeboyscout04/fastlane/downloads","issues_url":"https://api.github.com/repos/joeboyscout04/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/joeboyscout04/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/joeboyscout04/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/joeboyscout04/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joeboyscout04/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/joeboyscout04/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/joeboyscout04/fastlane/deployments","created_at":"2018-11-07T15:55:06Z","updated_at":"2018-11-07T15:55:17Z","pushed_at":"2018-11-11T19:30:27Z","git_url":"git://github.com/joeboyscout04/fastlane.git","ssh_url":"git@github.com:joeboyscout04/fastlane.git","clone_url":"https://github.com/joeboyscout04/fastlane.git","svn_url":"https://github.com/joeboyscout04/fastlane","homepage":"https://fastlane.tools","size":64087,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"947560ddc2311475e29312e463e7bc1ca76d0066","user":{"login":"fastlane","id":11098337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDk4MzM3","avatar_url":"https://avatars2.githubusercontent.com/u/11098337?v=4","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"node_id":"MDEwOlJlcG9zaXRvcnkyNzQ0Mjk2Nw==","name":"fastlane","full_name":"fastlane/fastlane","private":false,"owner":{"login":"fastlane","id":11098337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDk4MzM3","avatar_url":"https://avatars2.githubusercontent.com/u/11098337?v=4","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fastlane/fastlane","description":"🚀 The easiest way to automate building and releasing your iOS and Android apps","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2018-12-08T18:32:58Z","pushed_at":"2018-12-08T02:08:58Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":64711,"stargazers_count":23910,"watchers_count":23910,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3636,"mirror_url":null,"archived":false,"open_issues_count":305,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3636,"open_issues":305,"watchers":23910,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/13656"},"html":{"href":"https://github.com/fastlane/fastlane/pull/13656"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/13656"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/13656/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/13656/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/13656/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/aa6fd541c0969686ff4674092b64c83fe42a8d11"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"janpio"}}