{ "id": "98228", "key": "TIMOB-10218", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13872", "description": "", "name": "Sprint 2012-16 Core", "archived": true, "released": true, "releaseDate": "2012-08-13" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-15T07:46:49.000+0000", "created": "2012-07-27T14:30:32.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core", "module_build", "qe-port", "qe-testadded", "tooling" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-15T07:46:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nWhen you run a Titanium app in the iPhone Simulator -- either from Titanium Studio or from the command-line \"builder.py run myproj\" -- it sometimes launches two instances of the iPhone Simulator instead of one. Then, one of them displays an error message complaining that the iPhone Simulator is already running.\r\n\r\nExpected behavior: Only one instance of iPhone Simulator launches.\r\n\r\nNote, this bug is intermittent -- it only happens once in a while.\r\n\r\nh2. Test case\r\n\r\n1. Create app for iPhone\r\n2. Run it in iPhone Simulator\r\n3. If only one iPhone Simulator opens, run it again. Keep repeating; eventually, two simulators will open.\r\n", "attachment": [], "flagged": false, "summary": "iOS: Simulator sometimes launches twice", "creator": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacBook Pro.\r\nOS X Lion with Xcode 4.3.x, and OS X Mountain Lion with Xcode 4.4.\r\n\r\nTitanium 2.1.0.GA\r\n", "comment": { "comments": [ { "id": "210277", "author": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request: https://github.com/appcelerator/titanium_mobile/pull/2650\r\n\r\nIt looks like you guys have been going back and forth on this a bit already: https://github.com/appcelerator/titanium_mobile includes several commits over time that go back and forth on the implementation of how to bring the iPhone Simulator to the foreground, including commit c8d81b8 by Jeff Haynie and commits 46aa65d and b947aea by Blain Hamon.\r\n\r\nThis bug is caused by a race condition: First, iphone/builder.py launches the iPhone Simulator with a call to subprocess.Popen(); and then, it executes some AppleScript to bring the iPhone Simulator to the foreground -- but sometimes, the simulator that is being started by Popen() has not yet fully launched (the process has probably started, but AppleScript doesn't \"know\" that yet), so when AppleScript is told to bring it to the foreground, it launches another instance of it.\r\n\r\nMy fix is to change the AppleScript so that it first waits (up to several seconds) for the iPhone Simulator to finish launching, and *then* tell it to come to the foreground.", "updateAuthor": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-27T14:40:05.000+0000", "updated": "2012-07-27T14:40:05.000+0000" }, { "id": "210379", "author": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "body": "By the way, in my pull request, I followed the pattern that this project has followed so far with AppleScript: The AppleScript file I added is a \"compiled\" script, instead of plain text. But I would suggest that it might be nice to use plain text for all short AppleScript files, because if the files are short, then storing them as plain text has essentially no impact on their speed, and offers a few small advantages:\r\n\r\n* it means you can do \"diff\"s on them, e.g. with git.\r\n* it means you can view their contents with any editor, not just the \"AppleScript Editor\" application.", "updateAuthor": { "name": "mmorearty", "key": "mmorearty", "displayName": "Mike Morearty", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-29T10:01:49.000+0000", "updated": "2012-07-29T10:01:49.000+0000" }, { "id": "213339", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged https://github.com/appcelerator/titanium_mobile/pull/2650", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-08T10:59:57.000+0000", "updated": "2012-08-08T10:59:57.000+0000" }, { "id": "214213", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "erified fix with:\r\nTitanium Studio, build: 2.1.1.201207271312\r\nTitanium SDK: 2.2.0.v20120810194112\r\n\r\nMac osx 10.8 Mountain Lion\r\niOS Simulator 5.1", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-13T16:16:21.000+0000", "updated": "2012-08-13T16:16:21.000+0000" }, { "id": "261756", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening just to update label.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-15T07:40:58.000+0000", "updated": "2013-07-15T07:40:58.000+0000" }, { "id": "261757", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated Label and Verified with:\r\n\r\nTitanium Studio:3.1.2.201307091843\r\nTitanium SDK: 3.1.2.v20130710144553\r\nacs:1.0.3\r\nalloy:1.1.3\r\nnpm:1.2.14\r\ntitanium:3.1.1\r\nitanium-code-processor:1.0.1\r\nOS: OSX 10.8\r\nDevice:iPhone simulator(v 6.0)\r\nXcode: 4.5.1\r\n\r\nOnly one instance of iphone simulator launches.\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-15T07:46:49.000+0000", "updated": "2013-07-15T07:46:49.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }