@Elliot wrote:
在mac上写了一个hello.c
include
int main()
{
printf("Hello,world!\n");
return 0;
}用clang交叉编译为arm的执行文件hello,ldid签名之后放在ipad的/usr/bin/下,然后ssh到ipad上是可以执行的。之后写了一个com.bigpig.hello.plist文件,把这个文件放在了/Library/LaunchDaemon/下,重启设备。
plist如下:
<?xml version="1.0" encoding="UTF-8"?>
Label
com.bigpig.hello
Program
hello
ProgramArguments
hello
SessionCreate
Sockets
Listeners
SockServiceName
7
StandardErrorPath
/dev/null
inetdCompatibility
Wait
在mac终端上telnet x.x.x.x 7可以登录上,但是不会去执行hello程序打印出来。打印结果
telnet 192.168.0.100 7
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.就到这,本来应该在下一行打印一句hello world!
各位大大看看是什么原因,小弟感谢了~~~~~~
Posts: 1
Participants: 1