[书中问题] clang编译的程序在iOS中运行结果为killed:9

问题: clang编译的程序在iOS中运行结果为killed:9
环境:
iPhone系统: iOS 9.3
Mac系统: macOS Sierra 10.12.5
clang版本: Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
操作步骤:

  1. 按照书中例子编译: clang -arch arm64 -isysroot xcrun --sdk iphoneos --show-sdk-path -framework Foundation -framework UIKit -o MainBinary main2.m
  2. SCP到手机上
  3. chmod 修改权限为777
  4. 运行MainBinary, 结果为:
    iPhone:/var/tmp root# ./MainBinary
    Killed: 9

代码: main2.m(对着书本敲的):
#include <stuio.h>
#include <dlfcn.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

extern void ImportantAndComplicatedFunction(void)
{
NSLog(@“iOSRE: Suppose I’m a very important and complicated function!”);
}

int main(int argc, char **argv)
{
if ([[[UIDevice currentDevice] systemVersion] isEqualToString:@“8.1.1”]) ImportantAndComplicatedFunction();
return 0;
}

求助: 请问为何运行结果和书中不同. 书中运行无任何提示.在论坛和google搜索了相关的问题, 多数是和debugserver 没有签名相关的, 我的debugserver运行没有问题. 故请教下论坛里的高手, 帮忙看下什么问题.

唔……编译之后ldid -S试试?

果然行了. 谢谢指教!~