Thank you for the reply Eskimo.
I understand your point, I’m just trying to run a command and then I will figure it out. The issue is with launching the first command, and I’m probably doin something wrong from start.
Post
Replies
Boosts
Views
Activity
@ekismo Would you please provide me some more information on how to solve the issue?
I am building this in SwiftUI, I let the user select the Xcode.app file this way:
	switch result {
		case.success(let urls):
			guard
		let url = urls.first
		else {
			return
		}
		let bookmarkData =
			try url.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
		var isState = false
		let newURL =
			try URL(resolvingBookmarkData: bookmarkData, options: .withSecurityScope, relativeTo: nil, bookmarkDataIsStale: & isState)
		_ = newURL.startAccessingSecurityScopedResource()
		getDeviceList( in: newURL)
		case.failure(let error):
			print("There was a problem selecting the file - \(error)")
	}
} catch {
	print("Unable to read file contents")
	print(error.localizedDescription)
}
And in getDeviceList I am running this task:
	let task = Process()
	task.launchPath = xcodeURL.path
	task.arguments = [
		"xcrun simctl list devices"
	]
	
	let pipe = Pipe()
	task.standardOutput = pipe
	
	task.launch()
	
	let data = pipe.fileHandleForReading.readDataToEndOfFile()
	if let string = String(data: data, encoding: String.Encoding.utf8) {
		print(string)
	}
}
But as I keep getting the error:
caught non-fatal NSInternalInconsistencyException 'Couldn't posix_spawn: error 13'
Where am i going wrong?
Same problem with Xcode 12.3 for me! It freezes every 2 minutes and I have to restart Xcode.
Very bad update!
I am pretty sure it's possible. I have some apps downloaded from the App Store that do some things that are available only with that command.
Hello, I am trying to run "xcrun simctl ..." commands in a App Sandboxed app but I am getting errors like:
Couldn't posix_spawn: error 13
I let the user select the Xcode.app path but I really don't know what to do after that.
Any help?