{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-adb/pulls/comments/71048981","id":71048981,"diff_hunk":"@@ -344,6 +345,23 @@ systemCallMethods.killAllEmulators = async function () {\n   }\n };\n \n+systemCallMethods.killEmulator = async function (avdName) {\n+  let cmd;\n+  if (system.isWindows()) {\n+    cmd = `for /f \"tokens=2 delims=,\" %a in ('tasklist /FI \"imagename eq emulator*\" /V /FO:csv /NH ^| findstr /r /c:\".*:${avdName}.*\"') do taskkill /pid %a /F`;\n+  } else {\n+    cmd = `pkill -9 -f 'avd ${avdName}|@${avdName}'`;\n+  }\n+  try {\n+    log.debug(`killing avd '${avdName}'`);\n+    await (B.promisify(cp.exec))(cmd);\n+    await sleep(1000);","path":"lib/tools/system-calls.js","position":22,"original_position":22,"commit_id":"0ab325194d5d75c3b334eebca29f6b2f7d3ee7da","original_commit_id":"0ab325194d5d75c3b334eebca29f6b2f7d3ee7da","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":"what's the reason for the sleep?","created_at":"2016-07-15T22:25:02Z","updated_at":"2016-07-15T22:25:02Z","html_url":"https://github.com/appium/appium-adb/pull/165#discussion_r71048981","pull_request_url":"https://api.github.com/repos/appium/appium-adb/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/comments/71048981"},"html":{"href":"https://github.com/appium/appium-adb/pull/165#discussion_r71048981"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-adb/pulls/165","id":77071097,"html_url":"https://github.com/appium/appium-adb/pull/165","diff_url":"https://github.com/appium/appium-adb/pull/165.diff","patch_url":"https://github.com/appium/appium-adb/pull/165.patch","issue_url":"https://api.github.com/repos/appium/appium-adb/issues/165","number":165,"state":"open","locked":false,"title":"adding killEmulator function to kill specific emulator with AVD name.","user":{"login":"alizelzele","id":6006621,"avatar_url":"https://avatars.githubusercontent.com/u/6006621?v=3","gravatar_id":"","url":"https://api.github.com/users/alizelzele","html_url":"https://github.com/alizelzele","followers_url":"https://api.github.com/users/alizelzele/followers","following_url":"https://api.github.com/users/alizelzele/following{/other_user}","gists_url":"https://api.github.com/users/alizelzele/gists{/gist_id}","starred_url":"https://api.github.com/users/alizelzele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alizelzele/subscriptions","organizations_url":"https://api.github.com/users/alizelzele/orgs","repos_url":"https://api.github.com/users/alizelzele/repos","events_url":"https://api.github.com/users/alizelzele/events{/privacy}","received_events_url":"https://api.github.com/users/alizelzele/received_events","type":"User","site_admin":false},"body":"Add a new function to kill emulator with specific AVD name.\r\nThis function is required by `appium-android-driver` to be able to wipe-data of running emulator and close emulator at the end of the test.\r\n\r\nI was not able to make it work with `teen_process`. Teen_process escape command parameters. If that can be fixed it is better to use `exec` instead of `execRuntime`.","created_at":"2016-07-12T07:08:53Z","updated_at":"2016-07-15T22:25:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dc8b19817d56f90be1c91bbaec839d5072d960d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-adb/pulls/165/commits","review_comments_url":"https://api.github.com/repos/appium/appium-adb/pulls/165/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/165/comments","statuses_url":"https://api.github.com/repos/appium/appium-adb/statuses/0ab325194d5d75c3b334eebca29f6b2f7d3ee7da","head":{"label":"alizelzele:master","ref":"master","sha":"0ab325194d5d75c3b334eebca29f6b2f7d3ee7da","user":{"login":"alizelzele","id":6006621,"avatar_url":"https://avatars.githubusercontent.com/u/6006621?v=3","gravatar_id":"","url":"https://api.github.com/users/alizelzele","html_url":"https://github.com/alizelzele","followers_url":"https://api.github.com/users/alizelzele/followers","following_url":"https://api.github.com/users/alizelzele/following{/other_user}","gists_url":"https://api.github.com/users/alizelzele/gists{/gist_id}","starred_url":"https://api.github.com/users/alizelzele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alizelzele/subscriptions","organizations_url":"https://api.github.com/users/alizelzele/orgs","repos_url":"https://api.github.com/users/alizelzele/repos","events_url":"https://api.github.com/users/alizelzele/events{/privacy}","received_events_url":"https://api.github.com/users/alizelzele/received_events","type":"User","site_admin":false},"repo":{"id":63132030,"name":"appium-adb","full_name":"alizelzele/appium-adb","owner":{"login":"alizelzele","id":6006621,"avatar_url":"https://avatars.githubusercontent.com/u/6006621?v=3","gravatar_id":"","url":"https://api.github.com/users/alizelzele","html_url":"https://github.com/alizelzele","followers_url":"https://api.github.com/users/alizelzele/followers","following_url":"https://api.github.com/users/alizelzele/following{/other_user}","gists_url":"https://api.github.com/users/alizelzele/gists{/gist_id}","starred_url":"https://api.github.com/users/alizelzele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alizelzele/subscriptions","organizations_url":"https://api.github.com/users/alizelzele/orgs","repos_url":"https://api.github.com/users/alizelzele/repos","events_url":"https://api.github.com/users/alizelzele/events{/privacy}","received_events_url":"https://api.github.com/users/alizelzele/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alizelzele/appium-adb","description":"Wrapper around adb used by appium + helper libs","fork":true,"url":"https://api.github.com/repos/alizelzele/appium-adb","forks_url":"https://api.github.com/repos/alizelzele/appium-adb/forks","keys_url":"https://api.github.com/repos/alizelzele/appium-adb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alizelzele/appium-adb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alizelzele/appium-adb/teams","hooks_url":"https://api.github.com/repos/alizelzele/appium-adb/hooks","issue_events_url":"https://api.github.com/repos/alizelzele/appium-adb/issues/events{/number}","events_url":"https://api.github.com/repos/alizelzele/appium-adb/events","assignees_url":"https://api.github.com/repos/alizelzele/appium-adb/assignees{/user}","branches_url":"https://api.github.com/repos/alizelzele/appium-adb/branches{/branch}","tags_url":"https://api.github.com/repos/alizelzele/appium-adb/tags","blobs_url":"https://api.github.com/repos/alizelzele/appium-adb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alizelzele/appium-adb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alizelzele/appium-adb/git/refs{/sha}","trees_url":"https://api.github.com/repos/alizelzele/appium-adb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alizelzele/appium-adb/statuses/{sha}","languages_url":"https://api.github.com/repos/alizelzele/appium-adb/languages","stargazers_url":"https://api.github.com/repos/alizelzele/appium-adb/stargazers","contributors_url":"https://api.github.com/repos/alizelzele/appium-adb/contributors","subscribers_url":"https://api.github.com/repos/alizelzele/appium-adb/subscribers","subscription_url":"https://api.github.com/repos/alizelzele/appium-adb/subscription","commits_url":"https://api.github.com/repos/alizelzele/appium-adb/commits{/sha}","git_commits_url":"https://api.github.com/repos/alizelzele/appium-adb/git/commits{/sha}","comments_url":"https://api.github.com/repos/alizelzele/appium-adb/comments{/number}","issue_comment_url":"https://api.github.com/repos/alizelzele/appium-adb/issues/comments{/number}","contents_url":"https://api.github.com/repos/alizelzele/appium-adb/contents/{+path}","compare_url":"https://api.github.com/repos/alizelzele/appium-adb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alizelzele/appium-adb/merges","archive_url":"https://api.github.com/repos/alizelzele/appium-adb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alizelzele/appium-adb/downloads","issues_url":"https://api.github.com/repos/alizelzele/appium-adb/issues{/number}","pulls_url":"https://api.github.com/repos/alizelzele/appium-adb/pulls{/number}","milestones_url":"https://api.github.com/repos/alizelzele/appium-adb/milestones{/number}","notifications_url":"https://api.github.com/repos/alizelzele/appium-adb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alizelzele/appium-adb/labels{/name}","releases_url":"https://api.github.com/repos/alizelzele/appium-adb/releases{/id}","deployments_url":"https://api.github.com/repos/alizelzele/appium-adb/deployments","created_at":"2016-07-12T06:21:23Z","updated_at":"2016-07-12T06:21:25Z","pushed_at":"2016-07-15T08:14:52Z","git_url":"git://github.com/alizelzele/appium-adb.git","ssh_url":"git@github.com:alizelzele/appium-adb.git","clone_url":"https://github.com/alizelzele/appium-adb.git","svn_url":"https://github.com/alizelzele/appium-adb","homepage":null,"size":27379,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"appium:master","ref":"master","sha":"66b07f1c0dcac0db16e8a8703875966c17c910e7","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}","deployments_url":"https://api.github.com/repos/appium/appium-adb/deployments","created_at":"2014-03-02T14:20:10Z","updated_at":"2016-06-21T06:38:31Z","pushed_at":"2016-07-15T16:58:06Z","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":27694,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":17,"forks":55,"open_issues":17,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/165"},"html":{"href":"https://github.com/appium/appium-adb/pull/165"},"issue":{"href":"https://api.github.com/repos/appium/appium-adb/issues/165"},"comments":{"href":"https://api.github.com/repos/appium/appium-adb/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-adb/pulls/165/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/165/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-adb/statuses/0ab325194d5d75c3b334eebca29f6b2f7d3ee7da"}}}}
{"actor":{"display_login":"jlipps"}}