开发者

Running a terminal command inside an iPhone app

开发者 https://www.devze.com 2023-02-22 05:29 出处:网络
Hey guys. So, I\'m trying to have my iPhone app (jailbreaked) run a terminal command, and show the output. For those who don\'t see what I mean, I want to do the same thing as Cydia does when installi

Hey guys. So, I'm trying to have my iPhone app (jailbreaked) run a terminal command, and show the output. For those who don't see what I mean, I want to do the same thing as Cydia does when installing a package (b开发者_运维问答lack screen with the command output)

I'm using xCode 4.

Thanks!


Cydia is not directly running external programs: it is linked against libapt-inst, which indirectly runs dpkg to generate some (but not all) of that output.

In general, you just want to render a black text box with some white text, and then use popen to run your external program, freading any data from the pipe into your app to add to the end of the box.

0

精彩评论

暂无评论...
验证码 换一张
取 消