 |
 |
|
 |
07-10-2009, 12:41 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
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??
|
|
|
07-10-2009, 07:37 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
Hey nobody having any kinda experience with bash commands in xcode??
|
|
|
07-10-2009, 07:42 AM
|
#3 (permalink)
|
|
Registered Member
Join Date: Jun 2008
Location: Planet Earth
Posts: 402
|
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.
|
|
|
07-10-2009, 07:46 AM
|
#4 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
thanks for your reply. But i have a jailbroken iPhone so...
|
|
|
07-10-2009, 09:22 AM
|
#5 (permalink)
|
|
Registered Member
Join Date: Jun 2008
Location: Planet Earth
Posts: 402
|
Quote:
Originally Posted by raziiq
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.
|
|
|
07-10-2009, 10:25 AM
|
#6 (permalink)
|
|
New Member
Join Date: Jun 2009
Posts: 4
|
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
|
|
|
07-10-2009, 10:34 AM
|
#7 (permalink)
|
|
Pro. Game Developer
iPhone Dev SDK Supporter
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 1,260
|
Quote:
Originally Posted by rocomotion
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?
__________________
Code free of compiler warnings and errors, and code that won't crash are not mutually exclusive.
How your application performs in the simulator is irrelevant, unless your target audience is people who will run your app only on the simulator.
|
|
|
07-10-2009, 11:18 AM
|
#8 (permalink)
|
|
New Member
Join Date: Jun 2009
Posts: 4
|
Quote:
Originally Posted by Kalimba
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
|
|
|
07-10-2009, 12:07 PM
|
#9 (permalink)
|
|
Registered Member
Join Date: Jun 2008
Location: Planet Earth
Posts: 402
|
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.
|
|
|
07-10-2009, 12:20 PM
|
#10 (permalink)
|
|
Registered Member
Join Date: Jun 2008
Location: Planet Earth
Posts: 402
|
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.
|
|
|
07-12-2009, 07:11 AM
|
#11 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
Quote:
Originally Posted by rocomotion
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?
|
|
|
07-12-2009, 08:59 AM
|
#12 (permalink)
|
|
Shmoopi Gaming
Join Date: Jun 2009
Posts: 181
|
Quote:
Originally Posted by raziiq
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]);
|
|
|
07-12-2009, 08:45 PM
|
#13 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
Quote:
Originally Posted by Shmoopi
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.
|
|
|
07-15-2009, 05:46 AM
|
#14 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
come on guys, no body knows how to pass bash commands?
|
|
|
07-15-2009, 05:49 AM
|
#15 (permalink)
|
|
Registered Member
Join Date: Apr 2009
Posts: 204
|
Quote:
Originally Posted by raziiq
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.
|
|
|
07-15-2009, 06:46 AM
|
#16 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
Ya its working for me too but when i put this in my iPhone, it doesnt respond.
How to make this working ??
|
|
|
07-23-2009, 11:56 PM
|
#17 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Posts: 157
|
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?
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 467 |
| 36 members and 431 guests |
| al31, alexanderlonsky, AXP, bensj, BustinStones, CHV, Corsu, dany88, davidloew, DorkyMohr, dre, gate491, ggalante, iseff, issya, japaternoster, jingledale, jorgmart, KennyChong, kev12345, Kryckter, kvoyt, listingboat, lukeca, macstar, MacSteve85, masc2279, mebarron, mlo, Mr Jack, RegularKid, siemens, Slecorne, Stephane.tamis, supudo, zmarco |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,492
Threads: 35,775
Posts: 156,709
Top Poster: smasher (2,448)
|
| Welcome to our newest member, gate491 |
|