{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/xctool/issues/453","labels_url":"https://api.github.com/repos/facebook/xctool/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/facebook/xctool/issues/453/comments","events_url":"https://api.github.com/repos/facebook/xctool/issues/453/events","html_url":"https://github.com/facebook/xctool/issues/453","id":50355582,"number":453,"title":"Xctool uses wrong scheme files when building a scheme","user":{"login":"lauriskr","id":2514199,"avatar_url":"https://avatars.githubusercontent.com/u/2514199?v=3","gravatar_id":"","url":"https://api.github.com/users/lauriskr","html_url":"https://github.com/lauriskr","followers_url":"https://api.github.com/users/lauriskr/followers","following_url":"https://api.github.com/users/lauriskr/following{/other_user}","gists_url":"https://api.github.com/users/lauriskr/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriskr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriskr/subscriptions","organizations_url":"https://api.github.com/users/lauriskr/orgs","repos_url":"https://api.github.com/users/lauriskr/repos","events_url":"https://api.github.com/users/lauriskr/events{/privacy}","received_events_url":"https://api.github.com/users/lauriskr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-11-28T09:28:26Z","updated_at":"2015-08-13T20:58:31Z","closed_at":"2015-08-13T20:58:31Z","body":"The issue is that when building a scheme, **XcodeSubjectInfo** functions **matchingSchemePathForWorkspace** and **matchingSchemePathForProject** are used to search for schemes with the name that was given by -scheme argument. The function implementations loop over all schemes and return the last matching scheme.\r\n\r\nHowever, schemes should be searched from *username*.xcuserdatad or xcshareddata/xcschemes directories. Currently, the wrong scheme file is returned (since the active user's scheme is not the last one in the list) and the build does not act as xcodebuild.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/xctool/issues/comments/130843244","html_url":"https://github.com/facebook/xctool/issues/453#issuecomment-130843244","issue_url":"https://api.github.com/repos/facebook/xctool/issues/453","id":130843244,"user":{"login":"ExtremeMan","id":1044236,"avatar_url":"https://avatars.githubusercontent.com/u/1044236?v=3","gravatar_id":"","url":"https://api.github.com/users/ExtremeMan","html_url":"https://github.com/ExtremeMan","followers_url":"https://api.github.com/users/ExtremeMan/followers","following_url":"https://api.github.com/users/ExtremeMan/following{/other_user}","gists_url":"https://api.github.com/users/ExtremeMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ExtremeMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExtremeMan/subscriptions","organizations_url":"https://api.github.com/users/ExtremeMan/orgs","repos_url":"https://api.github.com/users/ExtremeMan/repos","events_url":"https://api.github.com/users/ExtremeMan/events{/privacy}","received_events_url":"https://api.github.com/users/ExtremeMan/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T20:58:30Z","updated_at":"2015-08-13T20:58:30Z","body":"I think I've fixed it in https://github.com/facebook/xctool/commit/728150d6ce8bc90e2603c2b92eec79ac8fd15b08. I've tried to run several tests and xctool behavior was always the same as xcodebuild. I have added several new tests (25113b5219416127c089f6a0df7f47c512cbaa36) to cover use case when there are schemes with the same name in shared and users directory to be sure we don't break it in a future. Please reopen if it is not the case for you."}}