写了一个tweak, 无法正常hook

export THEOS_DEVICE_IP = localhost
export THEOS_DEVICE_PORT = 2222

ARCH = arm64 arm64e
TARGET := iphone:clang:latest:7.0
INSTALL_TARGET_PROCESSES = Demo
THEOS_PACKAGE_SCHEME = rootless
DemoHook_FRAMEWORKS = UIKit Foundation
include $(THEOS)/makefiles/common.mk

TWEAK_NAME = DemoHook

DemoHook_FILES = Tweak.x
DemoHook_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/tweak.mk

#import <UIKit/UIKit.h>

%hook ViewController

// Hooking a class method
// + (id)sharedInstance {
// return %orig;
// }

// Hooking an instance method with an argument.

  • (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

    NSLog(@“click view”);
    %log; // Write a message about this call, including its class, name and arguments, to the system log.

    // %orig; // Call through to the original function with its original arguments.
    // %orig(nil); // Call through to the original function with a custom argument.

    // If you use %orig(), you MUST supply all arguments (except for self and _cmd, the automatically generated ones.)
    }

  • %end

$ make install

==> Installing…

(root@localhost) Password for root@TCKtekiiPhone:

Selecting previously unselected package com.yourcompany.demohook.

(Reading database … 8645 files and directories currently installed.)

Preparing to unpack /tmp/_theos_install.deb …

Unpacking com.yourcompany.demohook (0.0.1-6+debug) …

Setting up com.yourcompany.demohook (0.0.1-6+debug) …

Processing triggers for org.coolstar.sileo (2.5) …

正常安装了, 重启了Springboard, 然后打开我的demo 程序, 点击界面, 日志中没看到 “click view”的答应。