{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-adb/pulls/comments/32538870","id":32538870,"diff_hunk":"@@ -216,4 +217,178 @@ systemCallMethods.getPortFromEmulatorString = function (emStr) {\n   return false;\n };\n \n+systemCallMethods.getConnectedEmulators = async function () {\n+  try {\n+    log.debug(\"Getting connected emulators\");\n+    let devices = await this.getConnectedDevices();\n+    let emulators = [];\n+    for (let device of devices) {\n+      let port = this.getPortFromEmulatorString(device.udid);\n+      if (port) {\n+        device.port = port;\n+        emulators.push(device);\n+      }\n+    }\n+    log.debug(`${emulators.length} emulator(s) connected`);\n+    return emulators;\n+  } catch (e) {\n+    log.errorAndThrow(`Error getting emulators. Original error: ${e.message}`);","path":"lib/tools/system-calls.js","position":29,"original_position":29,"commit_id":"2489bebb7eaf8c9b7d2343643c4dba7703a249c2","original_commit_id":"2489bebb7eaf8c9b7d2343643c4dba7703a249c2","user":{"login":"jlipps","id":605053,"avatar_url":"https://avatars.githubusercontent.com/u/605053?v=3","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"body":"I'm starting to wonder whether this pattern (catching all errors and then wrapping them up in a catch block with a more descriptive error) is really what we want to do.\r\n\r\nthe value that it adds for the user is they get a message saying \"error getting emulators\" instead of something potentially harder to decipher.\r\n\r\nis this worth it?","created_at":"2015-06-16T16:22:56Z","updated_at":"2015-06-16T16:22:56Z","html_url":"https://github.com/appium/appium-adb/pull/84#discussion_r32538870","pull_request_url":"https://api.github.com/repos/appium/appium-adb/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/comments/32538870"},"html":{"href":"https://github.com/appium/appium-adb/pull/84#discussion_r32538870"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-adb/pulls/84","id":37761853,"html_url":"https://github.com/appium/appium-adb/pull/84","diff_url":"https://github.com/appium/appium-adb/pull/84.diff","patch_url":"https://github.com/appium/appium-adb/pull/84.patch","issue_url":"https://api.github.com/repos/appium/appium-adb/issues/84","number":84,"state":"open","locked":false,"title":"Adding last set of functionalities to ADB. ","user":{"login":"moizjv","id":1308607,"avatar_url":"https://avatars.githubusercontent.com/u/1308607?v=3","gravatar_id":"","url":"https://api.github.com/users/moizjv","html_url":"https://github.com/moizjv","followers_url":"https://api.github.com/users/moizjv/followers","following_url":"https://api.github.com/users/moizjv/following{/other_user}","gists_url":"https://api.github.com/users/moizjv/gists{/gist_id}","starred_url":"https://api.github.com/users/moizjv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moizjv/subscriptions","organizations_url":"https://api.github.com/users/moizjv/orgs","repos_url":"https://api.github.com/users/moizjv/repos","events_url":"https://api.github.com/users/moizjv/events{/privacy}","received_events_url":"https://api.github.com/users/moizjv/received_events","type":"User","site_admin":false},"body":"- Adding more functionalities to ADB.\r\n- Adding more functional and unit tests.\r\n- Restructuring tests to have fixtures. #81\r\n- @jlipps @sebv @imurchie  please review!","created_at":"2015-06-16T05:57:01Z","updated_at":"2015-06-16T16:22:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b22a3b3018c5932a59af810ec46b99226582fe4d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-adb/pulls/84/commits","review_comments_url":"https://api.github.com/repos/appium/appium-adb/pulls/84/comments","review_comment_url":"https://api.github.com/repos/appium/appium-adb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium-adb/issues/84/comments","statuses_url":"https://api.github.com/repos/appium/appium-adb/statuses/2489bebb7eaf8c9b7d2343643c4dba7703a249c2","head":{"label":"moizjv:2.0","ref":"2.0","sha":"2489bebb7eaf8c9b7d2343643c4dba7703a249c2","user":{"login":"moizjv","id":1308607,"avatar_url":"https://avatars.githubusercontent.com/u/1308607?v=3","gravatar_id":"","url":"https://api.github.com/users/moizjv","html_url":"https://github.com/moizjv","followers_url":"https://api.github.com/users/moizjv/followers","following_url":"https://api.github.com/users/moizjv/following{/other_user}","gists_url":"https://api.github.com/users/moizjv/gists{/gist_id}","starred_url":"https://api.github.com/users/moizjv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moizjv/subscriptions","organizations_url":"https://api.github.com/users/moizjv/orgs","repos_url":"https://api.github.com/users/moizjv/repos","events_url":"https://api.github.com/users/moizjv/events{/privacy}","received_events_url":"https://api.github.com/users/moizjv/received_events","type":"User","site_admin":false},"repo":{"id":20572387,"name":"appium-adb","full_name":"moizjv/appium-adb","owner":{"login":"moizjv","id":1308607,"avatar_url":"https://avatars.githubusercontent.com/u/1308607?v=3","gravatar_id":"","url":"https://api.github.com/users/moizjv","html_url":"https://github.com/moizjv","followers_url":"https://api.github.com/users/moizjv/followers","following_url":"https://api.github.com/users/moizjv/following{/other_user}","gists_url":"https://api.github.com/users/moizjv/gists{/gist_id}","starred_url":"https://api.github.com/users/moizjv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moizjv/subscriptions","organizations_url":"https://api.github.com/users/moizjv/orgs","repos_url":"https://api.github.com/users/moizjv/repos","events_url":"https://api.github.com/users/moizjv/events{/privacy}","received_events_url":"https://api.github.com/users/moizjv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/moizjv/appium-adb","description":"Wrapper around adb used by appium + helper libs","fork":true,"url":"https://api.github.com/repos/moizjv/appium-adb","forks_url":"https://api.github.com/repos/moizjv/appium-adb/forks","keys_url":"https://api.github.com/repos/moizjv/appium-adb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moizjv/appium-adb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moizjv/appium-adb/teams","hooks_url":"https://api.github.com/repos/moizjv/appium-adb/hooks","issue_events_url":"https://api.github.com/repos/moizjv/appium-adb/issues/events{/number}","events_url":"https://api.github.com/repos/moizjv/appium-adb/events","assignees_url":"https://api.github.com/repos/moizjv/appium-adb/assignees{/user}","branches_url":"https://api.github.com/repos/moizjv/appium-adb/branches{/branch}","tags_url":"https://api.github.com/repos/moizjv/appium-adb/tags","blobs_url":"https://api.github.com/repos/moizjv/appium-adb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moizjv/appium-adb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moizjv/appium-adb/git/refs{/sha}","trees_url":"https://api.github.com/repos/moizjv/appium-adb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moizjv/appium-adb/statuses/{sha}","languages_url":"https://api.github.com/repos/moizjv/appium-adb/languages","stargazers_url":"https://api.github.com/repos/moizjv/appium-adb/stargazers","contributors_url":"https://api.github.com/repos/moizjv/appium-adb/contributors","subscribers_url":"https://api.github.com/repos/moizjv/appium-adb/subscribers","subscription_url":"https://api.github.com/repos/moizjv/appium-adb/subscription","commits_url":"https://api.github.com/repos/moizjv/appium-adb/commits{/sha}","git_commits_url":"https://api.github.com/repos/moizjv/appium-adb/git/commits{/sha}","comments_url":"https://api.github.com/repos/moizjv/appium-adb/comments{/number}","issue_comment_url":"https://api.github.com/repos/moizjv/appium-adb/issues/comments{/number}","contents_url":"https://api.github.com/repos/moizjv/appium-adb/contents/{+path}","compare_url":"https://api.github.com/repos/moizjv/appium-adb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moizjv/appium-adb/merges","archive_url":"https://api.github.com/repos/moizjv/appium-adb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moizjv/appium-adb/downloads","issues_url":"https://api.github.com/repos/moizjv/appium-adb/issues{/number}","pulls_url":"https://api.github.com/repos/moizjv/appium-adb/pulls{/number}","milestones_url":"https://api.github.com/repos/moizjv/appium-adb/milestones{/number}","notifications_url":"https://api.github.com/repos/moizjv/appium-adb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moizjv/appium-adb/labels{/name}","releases_url":"https://api.github.com/repos/moizjv/appium-adb/releases{/id}","created_at":"2014-06-06T17:38:31Z","updated_at":"2015-04-16T22:48:50Z","pushed_at":"2015-06-16T06:11:56Z","git_url":"git://github.com/moizjv/appium-adb.git","ssh_url":"git@github.com:moizjv/appium-adb.git","clone_url":"https://github.com/moizjv/appium-adb.git","svn_url":"https://github.com/moizjv/appium-adb","homepage":null,"size":27056,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"appium:2.0","ref":"2.0","sha":"39cb79b54f2e9c3fd8d970442f3d0de656558432","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":17339088,"name":"appium-adb","full_name":"appium/appium-adb","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-adb","description":"Wrapper around adb used by appium + helper libs","fork":false,"url":"https://api.github.com/repos/appium/appium-adb","forks_url":"https://api.github.com/repos/appium/appium-adb/forks","keys_url":"https://api.github.com/repos/appium/appium-adb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-adb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-adb/teams","hooks_url":"https://api.github.com/repos/appium/appium-adb/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-adb/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-adb/events","assignees_url":"https://api.github.com/repos/appium/appium-adb/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-adb/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-adb/tags","blobs_url":"https://api.github.com/repos/appium/appium-adb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-adb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-adb/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-adb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-adb/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-adb/languages","stargazers_url":"https://api.github.com/repos/appium/appium-adb/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-adb/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-adb/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-adb/subscription","commits_url":"https://api.github.com/repos/appium/appium-adb/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-adb/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-adb/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-adb/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-adb/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-adb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-adb/merges","archive_url":"https://api.github.com/repos/appium/appium-adb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-adb/downloads","issues_url":"https://api.github.com/repos/appium/appium-adb/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-adb/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-adb/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-adb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-adb/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-adb/releases{/id}","created_at":"2014-03-02T14:20:10Z","updated_at":"2015-04-16T17:09:50Z","pushed_at":"2015-06-16T06:11:56Z","git_url":"git://github.com/appium/appium-adb.git","ssh_url":"git@github.com:appium/appium-adb.git","clone_url":"https://github.com/appium/appium-adb.git","svn_url":"https://github.com/appium/appium-adb","homepage":null,"size":27392,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":15,"forks":24,"open_issues":15,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/84"},"html":{"href":"https://github.com/appium/appium-adb/pull/84"},"issue":{"href":"https://api.github.com/repos/appium/appium-adb/issues/84"},"comments":{"href":"https://api.github.com/repos/appium/appium-adb/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-adb/statuses/2489bebb7eaf8c9b7d2343643c4dba7703a249c2"}}}}