NSTask Class on OS X API , lets you run another program as a subprocess and monitor that program’s execution
Questions tagged [nstask]
459 questions
2
votes
2 answers
NSTask not working on older version of Mac OSX
I have a very odd issue with a method that contains an NSTask. In 10.7+ the functionality works absolutely fine and successfully executes, returning the result and copying the file to the desired directory.
When trying my application in 10.6.8 the…

Jack Handy
- 21
- 1
2
votes
5 answers
Problems with NSTask in OS X 10.6 Snow Leopard
Has anyone else seen or heard of any issues with NSTask in 10.6?
This code worked fine yesterday, and is not working today.
NSTask *task = [converter task];
[task waitUntilExit];
NSLog(@"Task did complete");
The task does what it's supposed to do…

kubi
- 48,104
- 19
- 94
- 118
2
votes
1 answer
How to use NSTask run terminal commands in loop in consistent environment?
I want to use NSTask to simulate the Terminal to run commands. The codes as follows. It can get input in loop and return the process output.
int main(int argc, const char * argv[])
{
@autoreleasepool {
while (1) {
char str[80] =…

Tom Jacky
- 203
- 1
- 7
- 20
2
votes
2 answers
Understanding Multithreading in iOS
I am trying to understand multi-threading on iOS in more detail. I went through some of the class references like NSThread, NSRunLoop, NSTask..
First of all as indicated on the following link:
use of runloop
Runloop runs within a Thread.
So why do…

shebelaw
- 3,992
- 6
- 35
- 48
2
votes
1 answer
How do I have an NSTextField constantly update its value based on the output of a command line argument?
I am trying to create a small rsync program in Cbjective-C. It presently accesses the terminal command line through an NSTask and reads the command line's output to a string that is displayed in a NSTextField; however, when I use this small program…

crashprophet
- 327
- 1
- 4
- 13
2
votes
2 answers
Obj-c codesigning without entering admin password?
Is it possible to 'automatically' codesign bundles via cocoa without the user having to enter their admin username and password each time? If there is some way to implement this, some type of working example would be appreciated. Here is the code…

Hans Rufote
- 21
- 1
2
votes
1 answer
Execute Binary File On jailbroken iPhone
Since iPhone sandboxes its applications, I am unable to access the /bin/ folder. So I used an SSH connection to get the /bin/date binary file off the iPhone and I include it in my project. The path to my file is correct when I use NSLog it prints:…

MrHappyAsthma
- 6,332
- 9
- 48
- 78
2
votes
1 answer
Check if process is running from within cocoa app
I am a cocoa beginner and am trying to build an app for personal use, to manage local Apache/MySQL processes. I want to check if httpd (/usr/sbin/httpd) is running. I searched and found some hints pointing to NSTask and isRunning method, but could…

riccardolardi
- 1,713
- 5
- 20
- 35
2
votes
1 answer
How to access SVN through Mac OSX application
I would like to access SVN through a new application I am building for Mac OS X platform, using native cocoa libraries. I believe, I need to invoke the SVN command-line application through NSTask, to run it in the background. I have two problems…

attuser
- 111
- 8
2
votes
1 answer
NSTask - execute echo command
I'm trying to run a simple task which has to execute an echo "Hello World"
Well here is my code:
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/bash"];
NSArray *arguments;
arguments = [NSArray…

Alberto
- 4,212
- 5
- 22
- 36
2
votes
1 answer
NSTask spawned from a sandboxed application
Let's say a sandboxed Cocoa-based Application spawns an instance of SSH. So far so good, the SSH process is starting.
The problem is, how to allow the child process to read files (e.g. ~/.ssh/config or ~/.ssh/known_hosts, or even…

Doodloo
- 869
- 5
- 18
1
vote
1 answer
Cocoa App: How to find running process
my app Cocoa app for OS X was rejected by Apple. This is what they said:
2.23 The app spawns a process that continues running after the user quits the app, without first obtaining user consent.
The spawned
process is…

Daniel
- 1,473
- 3
- 33
- 63
1
vote
1 answer
Launch additional executable with mac app
I am currently stuck into a problem that I think is easy, if you know how to do it. In may Mac App (Don´t worry, it´s not for the MAS, so there won´t be any problems) I need to launch a little extra executable in the backround. It´s just a deamon…

Elefantosque
- 180
- 9
1
vote
2 answers
Running xcodebuild twice from a Cocoa app (via NSTask) silently fails
I have a Cocoa app that does a number of things, but among them, uses 'xcodebuild' to clean and re-build a iOS project in XCode. The Cocoa app was developed using XCode 4.1, and runs only on OS X 10.7 (because of the NSTask termination handlers). I…

churowa
- 220
- 1
- 12
1
vote
1 answer
NSTask pipes output to Console rather than the NSFileHandle
I set up an NSNotification for NSFileHandleReadCompletionNotification.
I set up the standard I/O with two separate pipes.
NSPipe * input = NSPipe.new;
NSPipe * output = NSPipe.new;
[serverTask setStandardInput:input];
[serverTask…

evdude100
- 437
- 4
- 18