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?
Use theos. It makes building anything for jailbroken devices really easy. I believe you can use the tool template for a command-line application.