{"action":"created","comment":{"url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments/27462062","id":27462062,"diff_hunk":"@@ -980,30 +983,80 @@ export class PlistService implements Mobile.IiOSDeviceSocket {\n \t}\n }\n \n-export class GDBServer implements Mobile.IGDBServer {\n-\tprivate socket: Mobile.IiOSDeviceSocket  = null;\n+util.inherits(GDBStandardOutputAdapter, stream.Transform);\n+function GDBStandardOutputAdapter(opts?: stream.TransformOptions) {\n+\tstream.Transform.call(this, opts);\n+\tthis.utf8StringDecoder = new string_decoder.StringDecoder(\"utf8\");\n+}\n+GDBStandardOutputAdapter.prototype._transform = function(packet: Buffer, encoding: string, done: Function): void {\n+\tvar result = \"\";\n \n-\tconstructor(private service: number,\n-\t\tprivate $injector: IInjector) {\n+\tfor (var i = 0; i < packet.length; i++) {\n+\t\tif (packet[i] === \"$\".charCodeAt(0)) {\n+\t\t\tvar start = ++i;\n \n-\t\tif(hostInfo.isWindows()) {\n-\t\t\tthis.socket = this.$injector.resolve(WinSocket, {service: this.service, format: 0});\n-\t\t} else if(hostInfo.isDarwin()) {\n-\t\t\tthis.socket = this.$injector.resolve(PosixSocket, {service: this.service, format: CoreTypes.kCFPropertyListXMLFormat_v1_0});\n+\t\t\twhile (packet[i] !== \"#\".charCodeAt(0)) {\n+\t\t\t\ti++;\n+\t\t\t}\n+\t\t\tvar end = i;\n+\n+\t\t\t// Skip checksum\n+\t\t\ti++;\n+\t\t\ti++;\n+\n+\t\t\tif (!(packet[start] === \"O\".charCodeAt(0) && packet[start + 1] !== \"K\".charCodeAt(0))) {\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tstart++;\n+\n+\t\t\tvar hexString = packet.toString(\"ascii\", start, end);\n+\t\t\tvar hex = new Buffer(hexString, \"hex\");\n+\t\t\tresult += this.utf8StringDecoder.write(hex);\n+\t\t}\n+\t}\n+\n+\tdone(null, result);\n+};\n+\n+util.inherits(GDBSignalWatcher, stream.Writable);\n+function GDBSignalWatcher(opts?: stream.WritableOptions) {\n+\tstream.Writable.call(this, opts);\n+}\n+GDBSignalWatcher.prototype._write = function(packet: Buffer, encoding: string, callback: Function) {\n+\tfor (var i = 0; i < packet.length - 2; i++) {\n+\t\tif (packet[i] === \"$\".charCodeAt(0) && (packet[i + 1] === \"T\".charCodeAt(0) || packet[i + 1] === \"S\".charCodeAt(0))) {\n+\t\t\t// SIGKILL\n+\t\t\tif (packet[i + 2] === \"9\".charCodeAt(0)) {\n+\t\t\t\tprocess.exit(1);\n+\t\t\t}\n \t\t}\n \t}\n+\tcallback(null);\n+};\n+\n+export class GDBServer implements Mobile.IGDBServer {\n+\tconstructor(private socket:net.Socket) {\n+\t}\n \n \tpublic run(argv: string[]): void {\n \t\tthis.send(\"QStartNoAckMode\");\n-\t\tthis.socket.sendMessage(\"+\");\n+\t\tthis.socket.write(\"+\");\n \t\tthis.send(\"QEnvironmentHexEncoded:\");\n \t\tthis.send(\"QSetDisableASLR:1\");\n \n-\t\tvar encodedArguments = _.map(argv, (arg, index) => util.format(\"%d,%d,%s\", arg.length*2, index, new Buffer(arg).toString(\"hex\"))).join(\",\");\n-\t\tthis.send(\"A\"+encodedArguments);\n+\t\tvar encodedArguments = _.map(argv, (arg, index) => util.format(\"%d,%d,%s\", arg.length * 2, index, new Buffer(arg).toString(\"hex\"))).join(\",\");\n+\t\tthis.send(\"A\" + encodedArguments);\n \n \t\tthis.send(\"qLaunchSuccess\");\n-\t\tthis.send(\"vCont;c\");\n+\n+\t\tif(options.logging) {\n+\t\t\tthis.socket.pipe(new (<any>GDBStandardOutputAdapter)()).pipe(process.stdout);","path":"mobile/ios/ios-core.ts","position":112,"original_position":102,"commit_id":"d44ae45b4c98890600bfc92ba2f0ce8eba22d8c1","original_commit_id":"653eb050208aef6e2feddb75171cba3414881f6f","user":{"login":"teobugslayer","id":5443453,"avatar_url":"https://avatars.githubusercontent.com/u/5443453?v=3","gravatar_id":"","url":"https://api.github.com/users/teobugslayer","html_url":"https://github.com/teobugslayer","followers_url":"https://api.github.com/users/teobugslayer/followers","following_url":"https://api.github.com/users/teobugslayer/following{/other_user}","gists_url":"https://api.github.com/users/teobugslayer/gists{/gist_id}","starred_url":"https://api.github.com/users/teobugslayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teobugslayer/subscriptions","organizations_url":"https://api.github.com/users/teobugslayer/orgs","repos_url":"https://api.github.com/users/teobugslayer/repos","events_url":"https://api.github.com/users/teobugslayer/events{/privacy}","received_events_url":"https://api.github.com/users/teobugslayer/received_events","type":"User","site_admin":false},"body":"I checked the type definitions, and it seems that pipe is declared ```pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;``` I would try with \\<NodeJS.WritableStream\\>","created_at":"2015-03-31T08:52:25Z","updated_at":"2015-03-31T08:52:25Z","html_url":"https://github.com/telerik/mobile-cli-lib/pull/250#discussion_r27462062","pull_request_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250","_links":{"self":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments/27462062"},"html":{"href":"https://github.com/telerik/mobile-cli-lib/pull/250#discussion_r27462062"},"pull_request":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250"}}},"pull_request":{"url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250","id":32237235,"html_url":"https://github.com/telerik/mobile-cli-lib/pull/250","diff_url":"https://github.com/telerik/mobile-cli-lib/pull/250.diff","patch_url":"https://github.com/telerik/mobile-cli-lib/pull/250.patch","issue_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/250","number":250,"state":"open","locked":false,"title":"Logging","user":{"login":"jasssonpet","id":305639,"avatar_url":"https://avatars.githubusercontent.com/u/305639?v=3","gravatar_id":"","url":"https://api.github.com/users/jasssonpet","html_url":"https://github.com/jasssonpet","followers_url":"https://api.github.com/users/jasssonpet/followers","following_url":"https://api.github.com/users/jasssonpet/following{/other_user}","gists_url":"https://api.github.com/users/jasssonpet/gists{/gist_id}","starred_url":"https://api.github.com/users/jasssonpet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasssonpet/subscriptions","organizations_url":"https://api.github.com/users/jasssonpet/orgs","repos_url":"https://api.github.com/users/jasssonpet/repos","events_url":"https://api.github.com/users/jasssonpet/events{/privacy}","received_events_url":"https://api.github.com/users/jasssonpet/received_events","type":"User","site_admin":false},"body":"Introduce `--logging` flag for `emulate`, `run`, `debug` and `device run` commands that outputs the standard output/logcat to the running terminal.","created_at":"2015-03-30T15:26:10Z","updated_at":"2015-03-31T08:52:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1c6cf8e93ca90292c91a3b7c97b25dcbf44bcff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250/commits","review_comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250/comments","review_comment_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/250/comments","statuses_url":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/d44ae45b4c98890600bfc92ba2f0ce8eba22d8c1","head":{"label":"jasssonpet:master","ref":"master","sha":"d44ae45b4c98890600bfc92ba2f0ce8eba22d8c1","user":{"login":"jasssonpet","id":305639,"avatar_url":"https://avatars.githubusercontent.com/u/305639?v=3","gravatar_id":"","url":"https://api.github.com/users/jasssonpet","html_url":"https://github.com/jasssonpet","followers_url":"https://api.github.com/users/jasssonpet/followers","following_url":"https://api.github.com/users/jasssonpet/following{/other_user}","gists_url":"https://api.github.com/users/jasssonpet/gists{/gist_id}","starred_url":"https://api.github.com/users/jasssonpet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasssonpet/subscriptions","organizations_url":"https://api.github.com/users/jasssonpet/orgs","repos_url":"https://api.github.com/users/jasssonpet/repos","events_url":"https://api.github.com/users/jasssonpet/events{/privacy}","received_events_url":"https://api.github.com/users/jasssonpet/received_events","type":"User","site_admin":false},"repo":{"id":32511678,"name":"mobile-cli-lib","full_name":"jasssonpet/mobile-cli-lib","owner":{"login":"jasssonpet","id":305639,"avatar_url":"https://avatars.githubusercontent.com/u/305639?v=3","gravatar_id":"","url":"https://api.github.com/users/jasssonpet","html_url":"https://github.com/jasssonpet","followers_url":"https://api.github.com/users/jasssonpet/followers","following_url":"https://api.github.com/users/jasssonpet/following{/other_user}","gists_url":"https://api.github.com/users/jasssonpet/gists{/gist_id}","starred_url":"https://api.github.com/users/jasssonpet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasssonpet/subscriptions","organizations_url":"https://api.github.com/users/jasssonpet/orgs","repos_url":"https://api.github.com/users/jasssonpet/repos","events_url":"https://api.github.com/users/jasssonpet/events{/privacy}","received_events_url":"https://api.github.com/users/jasssonpet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasssonpet/mobile-cli-lib","description":"Contains common infrastructure for CLIs - mainly AppBuilder and NativeScript.","fork":true,"url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib","forks_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/forks","keys_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/teams","hooks_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/hooks","issue_events_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/issues/events{/number}","events_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/events","assignees_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/assignees{/user}","branches_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/branches{/branch}","tags_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/tags","blobs_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/languages","stargazers_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/stargazers","contributors_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/contributors","subscribers_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/subscribers","subscription_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/subscription","commits_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/contents/{+path}","compare_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/merges","archive_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/downloads","issues_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/issues{/number}","pulls_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/labels{/name}","releases_url":"https://api.github.com/repos/jasssonpet/mobile-cli-lib/releases{/id}","created_at":"2015-03-19T09:17:49Z","updated_at":"2015-03-31T08:05:36Z","pushed_at":"2015-03-31T08:05:36Z","git_url":"git://github.com/jasssonpet/mobile-cli-lib.git","ssh_url":"git@github.com:jasssonpet/mobile-cli-lib.git","clone_url":"https://github.com/jasssonpet/mobile-cli-lib.git","svn_url":"https://github.com/jasssonpet/mobile-cli-lib","homepage":null,"size":5768,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"telerik:master","ref":"master","sha":"91ad3d65a1a4e1f96b106d231d8ac2ce142824f5","user":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"repo":{"id":21348075,"name":"mobile-cli-lib","full_name":"telerik/mobile-cli-lib","owner":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telerik/mobile-cli-lib","description":"Contains common infrastructure for CLIs - mainly AppBuilder and NativeScript.","fork":false,"url":"https://api.github.com/repos/telerik/mobile-cli-lib","forks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/forks","keys_url":"https://api.github.com/repos/telerik/mobile-cli-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telerik/mobile-cli-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telerik/mobile-cli-lib/teams","hooks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/hooks","issue_events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/events{/number}","events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/events","assignees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/assignees{/user}","branches_url":"https://api.github.com/repos/telerik/mobile-cli-lib/branches{/branch}","tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/tags","blobs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/telerik/mobile-cli-lib/languages","stargazers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/stargazers","contributors_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contributors","subscribers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscribers","subscription_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscription","commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contents/{+path}","compare_url":"https://api.github.com/repos/telerik/mobile-cli-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telerik/mobile-cli-lib/merges","archive_url":"https://api.github.com/repos/telerik/mobile-cli-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telerik/mobile-cli-lib/downloads","issues_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues{/number}","pulls_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/telerik/mobile-cli-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/telerik/mobile-cli-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telerik/mobile-cli-lib/labels{/name}","releases_url":"https://api.github.com/repos/telerik/mobile-cli-lib/releases{/id}","created_at":"2014-06-30T10:54:52Z","updated_at":"2015-03-31T06:56:38Z","pushed_at":"2015-03-31T08:05:36Z","git_url":"git://github.com/telerik/mobile-cli-lib.git","ssh_url":"git@github.com:telerik/mobile-cli-lib.git","clone_url":"https://github.com/telerik/mobile-cli-lib.git","svn_url":"https://github.com/telerik/mobile-cli-lib","homepage":null,"size":10289,"stargazers_count":6,"watchers_count":6,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250"},"html":{"href":"https://github.com/telerik/mobile-cli-lib/pull/250"},"issue":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/250"},"comments":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/250/comments"},"review_comments":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250/comments"},"review_comment":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/250/commits"},"statuses":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/d44ae45b4c98890600bfc92ba2f0ce8eba22d8c1"}}}}