Skip to content

Commit

Permalink
Revert use of 'open "iOS Simulator"' back to use of Instruments.
Browse files Browse the repository at this point in the history
The use of "open" is causing "Invalid Device State" errors; this is probably because the iOS Simulator can only really launch one instance
at a time, and Instruments knows how to shutdown the previous instance.
  • Loading branch information
shazron committed Mar 19, 2016
1 parent b8f7f57 commit 34426c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 2 additions & 14 deletions lib/simctl-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,9 @@ var shell = require('shelljs'),


var extensions = {
startByApp : function(appName, deviceid) {
var command = 'open -a "' + appName + '"';
if (!deviceid) {
return shell.exec(command, { silent: true } );
} else {
command += util.format(command + ' --args -CurrentDeviceUDID %s', deviceid);
return shell.exec(command, { silent: true } );
}
},

start : function(deviceid) {
// try "iOS Simulator" first (Xcode 6), if that fails, try "Simulator" (Xcode 7)
if (extensions.startByApp('iOS Simulator', deviceid).code !== 0) {
extensions.startByApp('Simulator', deviceid);
}
var command = util.format('xcrun instruments -w "%s"', deviceid);
return shell.exec(command, { silent: true } );
},

log : function(deviceid, filepath) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simctl",
"version": "0.0.8",
"version": "0.0.9",
"description": "library for Xcode simctl utility on OS X",
"repository": {
"type": "git",
Expand Down

0 comments on commit 34426c7

Please sign in to comment.