Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-10-2009, 12:41 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default Passing Bash Script Command?

Is there any way of passing bash script commands using xCode.

For example lets say i have a UIButton and when i tap that button, a bash shell Script runs.

Is it possible??
raziiq is offline   Reply With Quote
Old 07-10-2009, 07:37 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

Hey nobody having any kinda experience with bash commands in xcode??
raziiq is offline   Reply With Quote
Old 07-10-2009, 07:42 AM   #3 (permalink)
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
Default

Not recommended for an app distributed in the App Store.
__________________
Visit Me

Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
mnemonic_fx is offline   Reply With Quote
Old 07-10-2009, 07:46 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

thanks for your reply. But i have a jailbroken iPhone so...
raziiq is offline   Reply With Quote
Old 07-10-2009, 09:22 AM   #5 (permalink)
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
Default

Quote:
Originally Posted by raziiq View Post
thanks for your reply. But i have a jailbroken iPhone so...
So it doesn't matter what kind of phone you have, that's not an option for App Store Apps distribution.
__________________
Visit Me

Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
mnemonic_fx is offline   Reply With Quote
Old 07-10-2009, 10:25 AM   #6 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 4
Default

I love how people are so helpful here. I assume you're developing an application for your own used with a Jailbroken iPhone. I'd recommend using system(<insert console command>) or popen(<insert command>, <r/w for read or write>). popen() opens a pipe to the console which you can read or write to like a normal file. Anyway, check those out, they might work out for you
rocomotion is offline   Reply With Quote
Old 07-10-2009, 10:34 AM   #7 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

Quote:
Originally Posted by rocomotion View Post
I love how people are so helpful here. I assume you're developing an application for your own used with a Jailbroken iPhone. I'd recommend using system(<insert console command>) or popen(<insert command>, <r/w for read or write>). popen() opens a pipe to the console which you can read or write to like a normal file. Anyway, check those out, they might work out for you
This forum was really founded for assisting the development of App Store applications, which means the focus is on SDK-centric topics. If you feel that the support towards jailbroken development is lacking, perhaps you could start up your own forum elsewhere?
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 07-10-2009, 11:18 AM   #8 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 4
Default

Quote:
Originally Posted by Kalimba View Post
This forum was really founded for assisting the development of App Store applications, which means the focus is on SDK-centric topics. If you feel that the support towards jailbroken development is lacking, perhaps you could start up your own forum elsewhere?
I don't really mind about the support for Jailbroken development, but it isn't terribly helpful to just spout "APPLE WON'T PUT THAT IN THE APP STORE" without giving any input as to how to resolve OP's problem. but you're right, there are a number of forums geared towards open toolchain / jailbroken development, and you'd do better to ask on one of those
rocomotion is offline   Reply With Quote
Old 07-10-2009, 12:07 PM   #9 (permalink)
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
Default

Well, that's where you contribute.

I only know about NSTask (not available in the iPhone), or adding a run script as a build phase in Xcode (only runs on building). I already forgot most of BSD / Unix system APIs to run another process, fork() ?, passing into main(...) ?

So why are you upset about me unable to give an answer ? He didn't talk about why he needs the bash script anyway...
__________________
Visit Me

Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
mnemonic_fx is offline   Reply With Quote
Old 07-10-2009, 12:20 PM   #10 (permalink)
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
Default

Anyway, just because I'm a geek, I observe that the exec family (man execl) of functions are better ways than system(...).
__________________
Visit Me

Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
mnemonic_fx is offline   Reply With Quote
Old 07-12-2009, 07:11 AM   #11 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

Quote:
Originally Posted by rocomotion View Post
I love how people are so helpful here. I assume you're developing an application for your own used with a Jailbroken iPhone. I'd recommend using system(<insert console command>) or popen(<insert command>, <r/w for read or write>). popen() opens a pipe to the console which you can read or write to like a normal file. Anyway, check those out, they might work out for you
Thank you for those commands. Can you please give me an example for this, or can you please forward me a link to some useful examples for this.

For example what if i want to write a cp command, what should be the procedure?
raziiq is offline   Reply With Quote
Old 07-12-2009, 08:59 AM   #12 (permalink)
Shmoopi LLC
 
Shmoopi's Avatar
 
Join Date: Jun 2009
Posts: 201
Default

Quote:
Originally Posted by raziiq View Post
Thank you for those commands. Can you please give me an example for this, or can you please forward me a link to some useful examples for this.

For example what if i want to write a cp command, what should be the procedure?
I'm also trying to figure this out. I have a command to reboot the iPhone run at a certain time in my app that works just fine in the simulator but doesn't seem to work on the iPhone itself. Does anyone have any ideas?
Here's the code:
Code:
        NSString *cmd = @"killall SpringBoard";
	system([cmd UTF8String]);
Shmoopi is offline   Reply With Quote
Old 07-12-2009, 08:45 PM   #13 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

Quote:
Originally Posted by Shmoopi View Post
I'm also trying to figure this out. I have a command to reboot the iPhone run at a certain time in my app that works just fine in the simulator but doesn't seem to work on the iPhone itself. Does anyone have any ideas?
Here's the code:
Code:
        NSString *cmd = @"killall SpringBoard";
	system([cmd UTF8String]);
I m not too sure about it but shouldnt this command be like this

Code:
system("killall SpringBoard")
I can be wrong though, as i have read this somewhere.
raziiq is offline   Reply With Quote
Old 07-15-2009, 05:46 AM   #14 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

come on guys, no body knows how to pass bash commands?
raziiq is offline   Reply With Quote
Old 07-15-2009, 05:49 AM   #15 (permalink)
Obj-C Learner
 
Join Date: Apr 2009
Location: Manchester, UK
Posts: 1,030
Send a message via MSN to ZunePod Send a message via Yahoo to ZunePod
Default

Quote:
Originally Posted by raziiq View Post
I m not too sure about it but shouldnt this command be like this

Code:
system("killall SpringBoard")
I can be wrong though, as i have read this somewhere.
It's a correct command.
ZunePod is offline   Reply With Quote
Old 07-15-2009, 06:46 AM   #16 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

Ya its working for me too but when i put this in my iPhone, it doesnt respond.

How to make this working ??
raziiq is offline   Reply With Quote
Old 07-23-2009, 11:56 PM   #17 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 172
Default

can i ssh into my iPhone using the following command? Is it valid?

Code:
ssh root-alpine@<ip address>
Where ip address is the actual ip address like 192.168.1.1

Is this command right?
raziiq is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,304
Threads: 89,032
Posts: 379,813
Top Poster: BrianSlick (7,086)
Welcome to our newest member, Azuresilver
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0