{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/81946778","pull_request_review_id":2887706,"id":81946778,"diff_hunk":"@@ -129,7 +133,15 @@ function buildProject(xcodeProject, udid, scheme) {\n     '-derivedDataPath', 'build',\n   ];\n   console.log(`Building using \"xcodebuild ${xcodebuildArgs.join(' ')}\"`);\n-  child_process.spawnSync('xcodebuild', xcodebuildArgs, {stdio: 'inherit'});\n+  var buildProcess = child_process.spawnSync('xcodebuild', xcodebuildArgs, {stdio: 'pipe'});\n+  var buildOutput = buildProcess.stdout.toString();\n+  console.log(buildOutput);\n+  //FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name,  example output line: export FULL_PRODUCT_NAME=\"Super App Dev.app\"\n+  var exportFullProductLines = buildOutput.match(new RegExp(\"export FULL_PRODUCT_NAME=.+\\.app\"));","path":"local-cli/runIOS/runIOS.js","position":37,"original_position":37,"commit_id":"4db0df2f5045a557a070904957f998ddc41f159b","original_commit_id":"4db0df2f5045a557a070904957f998ddc41f159b","user":{"login":"javache","id":5676,"avatar_url":"https://avatars.githubusercontent.com/u/5676?v=3","gravatar_id":"","url":"https://api.github.com/users/javache","html_url":"https://github.com/javache","followers_url":"https://api.github.com/users/javache/followers","following_url":"https://api.github.com/users/javache/following{/other_user}","gists_url":"https://api.github.com/users/javache/gists{/gist_id}","starred_url":"https://api.github.com/users/javache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javache/subscriptions","organizations_url":"https://api.github.com/users/javache/orgs","repos_url":"https://api.github.com/users/javache/repos","events_url":"https://api.github.com/users/javache/events{/privacy}","received_events_url":"https://api.github.com/users/javache/received_events","type":"User","site_admin":false},"body":"Use a regex capture group to match once here and extract the value you're looking for later: http://www.regular-expressions.info/refcapture.html","created_at":"2016-10-05T10:50:55Z","updated_at":"2016-10-05T10:50:59Z","html_url":"https://github.com/facebook/react-native/pull/10178#discussion_r81946778","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/10178","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/81946778"},"html":{"href":"https://github.com/facebook/react-native/pull/10178#discussion_r81946778"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/10178"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/10178","id":87364883,"html_url":"https://github.com/facebook/react-native/pull/10178","diff_url":"https://github.com/facebook/react-native/pull/10178.diff","patch_url":"https://github.com/facebook/react-native/pull/10178.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/10178","number":10178,"state":"open","locked":false,"title":"Fix error in react-native run-ios when Product Name and Scheme are inequal","user":{"login":"StevePotter","id":271103,"avatar_url":"https://avatars.githubusercontent.com/u/271103?v=3","gravatar_id":"","url":"https://api.github.com/users/StevePotter","html_url":"https://github.com/StevePotter","followers_url":"https://api.github.com/users/StevePotter/followers","following_url":"https://api.github.com/users/StevePotter/following{/other_user}","gists_url":"https://api.github.com/users/StevePotter/gists{/gist_id}","starred_url":"https://api.github.com/users/StevePotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevePotter/subscriptions","organizations_url":"https://api.github.com/users/StevePotter/orgs","repos_url":"https://api.github.com/users/StevePotter/repos","events_url":"https://api.github.com/users/StevePotter/events{/privacy}","received_events_url":"https://api.github.com/users/StevePotter/received_events","type":"User","site_admin":false},"body":"In xcode, you can modify the Product Name per build configuration.  During the build, the app file name is made using that value.  For example, I name my app \"MyApp Dev\", it will build into \"MyApp Dev.app\". \r\n\r\nreact-native run-ios doesn't extract the proper app name.  Instead it uses the scheme name + \".app\".  So if in the example above I use the default Scheme \"MyApp\", which references the build configuration whose name is \"MyApp Dev\".  The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.\r\n\r\nMy fix parses the build output and extracts the app name from the line \"export FULL_PRODUCT_NAME=$(appfilename)\" and uses that instead of the scheme.  If there is any issue parsing, the scheme name is used like it currently is.\r\n\r\n**Test plan (required)**\r\n\r\n1) Change the Product Name in xcode project manager to be something different than the scheme name.\r\n2) Run react-native run-ios and ensure it works.\r\n","created_at":"2016-09-29T18:13:40Z","updated_at":"2016-10-05T10:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12cae9c548e2e37395ec275d06ac51a15090bd99","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/10178/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/10178/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/10178/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/4db0df2f5045a557a070904957f998ddc41f159b","head":{"label":"StevePotter:fixiosappname","ref":"fixiosappname","sha":"4db0df2f5045a557a070904957f998ddc41f159b","user":{"login":"StevePotter","id":271103,"avatar_url":"https://avatars.githubusercontent.com/u/271103?v=3","gravatar_id":"","url":"https://api.github.com/users/StevePotter","html_url":"https://github.com/StevePotter","followers_url":"https://api.github.com/users/StevePotter/followers","following_url":"https://api.github.com/users/StevePotter/following{/other_user}","gists_url":"https://api.github.com/users/StevePotter/gists{/gist_id}","starred_url":"https://api.github.com/users/StevePotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevePotter/subscriptions","organizations_url":"https://api.github.com/users/StevePotter/orgs","repos_url":"https://api.github.com/users/StevePotter/repos","events_url":"https://api.github.com/users/StevePotter/events{/privacy}","received_events_url":"https://api.github.com/users/StevePotter/received_events","type":"User","site_admin":false},"repo":{"id":69502858,"name":"react-native","full_name":"StevePotter/react-native","owner":{"login":"StevePotter","id":271103,"avatar_url":"https://avatars.githubusercontent.com/u/271103?v=3","gravatar_id":"","url":"https://api.github.com/users/StevePotter","html_url":"https://github.com/StevePotter","followers_url":"https://api.github.com/users/StevePotter/followers","following_url":"https://api.github.com/users/StevePotter/following{/other_user}","gists_url":"https://api.github.com/users/StevePotter/gists{/gist_id}","starred_url":"https://api.github.com/users/StevePotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevePotter/subscriptions","organizations_url":"https://api.github.com/users/StevePotter/orgs","repos_url":"https://api.github.com/users/StevePotter/repos","events_url":"https://api.github.com/users/StevePotter/events{/privacy}","received_events_url":"https://api.github.com/users/StevePotter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StevePotter/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/StevePotter/react-native","forks_url":"https://api.github.com/repos/StevePotter/react-native/forks","keys_url":"https://api.github.com/repos/StevePotter/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StevePotter/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StevePotter/react-native/teams","hooks_url":"https://api.github.com/repos/StevePotter/react-native/hooks","issue_events_url":"https://api.github.com/repos/StevePotter/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/StevePotter/react-native/events","assignees_url":"https://api.github.com/repos/StevePotter/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/StevePotter/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/StevePotter/react-native/tags","blobs_url":"https://api.github.com/repos/StevePotter/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StevePotter/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StevePotter/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/StevePotter/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StevePotter/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/StevePotter/react-native/languages","stargazers_url":"https://api.github.com/repos/StevePotter/react-native/stargazers","contributors_url":"https://api.github.com/repos/StevePotter/react-native/contributors","subscribers_url":"https://api.github.com/repos/StevePotter/react-native/subscribers","subscription_url":"https://api.github.com/repos/StevePotter/react-native/subscription","commits_url":"https://api.github.com/repos/StevePotter/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/StevePotter/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/StevePotter/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/StevePotter/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/StevePotter/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/StevePotter/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StevePotter/react-native/merges","archive_url":"https://api.github.com/repos/StevePotter/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StevePotter/react-native/downloads","issues_url":"https://api.github.com/repos/StevePotter/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/StevePotter/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/StevePotter/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/StevePotter/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StevePotter/react-native/labels{/name}","releases_url":"https://api.github.com/repos/StevePotter/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/StevePotter/react-native/deployments","created_at":"2016-09-28T20:53:49Z","updated_at":"2016-09-28T20:53:59Z","pushed_at":"2016-10-04T20:29:02Z","git_url":"git://github.com/StevePotter/react-native.git","ssh_url":"git@github.com:StevePotter/react-native.git","clone_url":"https://github.com/StevePotter/react-native.git","svn_url":"https://github.com/StevePotter/react-native","homepage":"http://facebook.github.io/react-native/","size":89891,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"facebook:master","ref":"master","sha":"6130650d9327e73f7e519fd6a6719ac4be2fb01a","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-10-05T10:48:14Z","pushed_at":"2016-10-05T10:18:47Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":134563,"stargazers_count":38467,"watchers_count":38467,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8569,"mirror_url":null,"open_issues_count":1342,"forks":8569,"open_issues":1342,"watchers":38467,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/10178"},"html":{"href":"https://github.com/facebook/react-native/pull/10178"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/10178"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/10178/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/10178/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/10178/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/4db0df2f5045a557a070904957f998ddc41f159b"}}}}
{"actor":{"display_login":"javache"}}