越狱 iOS 的命令行程序会在 iPad 中消失,但不会在 iPhone 3G 中消失
我正在尝试构建一个命令行程序以在越狱的 iOS 设备的终端中运行。
为了简单起见,我用一个简单的 hello world 进行了测试:
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello world!\n");
}
我用它构建:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/ main.c -o hello
生成的可执行文件在运行 iOS 4.2.1 的 iPhone 3G 中工作正常,但在运行 4.3.5 的 iPad 中输出:
Killed: 9
两者都已越狱,并且可以运行Cydia 的应用程序就很好。
我尝试直接在iPad上使用Cydia的gdb进行调试,但是当程序收到kill信号时gdb退出。
就其价值而言,我真正想要构建的程序是 Ledger。我在 iPhone 3G 上运行它,但是当我在 iPad 上尝试它时,它失败了,如上所述。
有什么想法吗?
I'm trying to build a command line program to run in the terminal of jailbroken iOS devices.
To keep it simple I tested with a simple hello world:
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello world!\n");
}
Which I build with:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/ main.c -o hello
The generated executable works fine in an iPhone 3G running iOS 4.2.1, but in an iPad running 4.3.5 it outputs:
Killed: 9
Both are jailbroken, and can run apps from Cydia just fine.
I tried debugging directly on the iPad with gdb from Cydia, but gdb exits when the program receives the kill signal.
For what it's worth, the program I'm really trying to build is Ledger. I have it running on my iPhone 3G, but when I tried it on the iPad it fails as above.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 theos。它使得为越狱设备构建任何东西都变得非常容易。我相信您可以将工具模板用于命令行应用程序。
Use theos. It makes building anything for jailbroken devices really easy. I believe you can use the tool template for a command-line application.
您必须对应用程序进行自签名,或者使用 ldid -S 来欺骗 iOS 加载程序。
ldid
可在 iPhone 本身的命令行上使用。这里还有一个 Mac OS X 二进制文件 http://dl.dropbox.com/u/3157793 /ldid 。另一种选择是安装 iOSOpenDev 工具,默认情况下,它会在 Xcode 之上安装所有这些工具
You must either self signed the app either use
ldid -S
to fool the iOS loader.ldid
is available on command line on the iPhone itself. There is also a Mac OS X binary available here http://dl.dropbox.com/u/3157793/ldid .Another option is to install iOSOpenDev tools which will install all this by default, on top of Xcode
iOSOpenDev 扩展了 Xcode,并为 iOS 开发提供项目模板,例如您尝试创建的命令行工具以及处理代码 -为 Cydia 签名和创建 Debian 软件包。值得一看;对某些人来说可能比 Theos 更容易。
iOSOpenDev extends Xcode and provides project templates for iOS development like command-line tools that you're trying to create along with handling code-signing and Debian package creation for Cydia. Worth a look; can be easier than Theos for some.
请对应用程序进行协同设计,然后安装它..它将运行
Please codesign the app and then install it .. it will run