打开.xm文件,目前没有发现啥编辑器可以打开,命令行是万能的
open -e /Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/Tweak.xm
.xm文件中输入汉字报错,汉字在xcode中写好黏贴进.xm文件
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
Tweak.xm:3:24: error: non-ASCII characters are not allowed outside of literals
and identifiers
NSString *str = @“看专”;
^
Tweak.xm:3:33: error: non-ASCII characters are not allowed outside of literals
and identifiers
NSString *str = @“看专”;
^
Tweak.xm:3:23: error: unexpected '@' in program
NSString *str = @“看专”;
^
报错:/makefiles/common.mk: No such file or directory
Makefile:11: /tweak.mk: No such file or directory
解决办法:include /opt/theos/makefiles/common.mk
和include /opt/theos/makefiles/tweak.mk
,虽说这样写不是很好,但是没有找到其他的方法,其他的按照文档一步步的来,傻瓜式的
THEOS_DEVICE_IP = 192.168.1.100
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
include /opt/theos/makefiles/common.mk
TWEAK_NAME = iOSREGreetings
iOSREGreetings_FILES = Tweak.xm
iOSREGreetings_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 SpringBoard"
报错: Preprocessing Tweak.xm…
Tweak.xm:2: error: Tweak.xm…的问题重新写
==> Preprocessing Tweak.xm…
Tweak.xm:2: error: %end does not make sense inside a block
make[3]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/Tweak.xm.07780871.o] Error 22
make[2]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/iOSREGreetings.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [iOSREGreetings.all.tweak.variables] Error 2
wanggangdeMacBook-Pro:iosregreetings wanggang$ make package install
报错Error: The vendor/include and/or vendor/lib directories are missing. Please run git submodule update --init --recursive
in your Theos directory.* 按照这个文档 https://github.com/theos/theos/wiki/Installation,一步步的配置,重点说说文档这一句add to your ~/.bash_profile or equivalent:export PATH=/usr/local/opt/gnu-sed/bin/:$PATHIn order to use make troubleshoot
,需要用命令行打开open ~/.bash_profile
==> Error: The vendor/include and/or vendor/lib directories are missing.
Please run `git submodule update --init --recursive` in your Theos directory.
More information: https://github.com/theos/theos/wiki/Installation.
control文件
Package: com.iosre.iosregreetings
Name: iOSREGreetings
Depends: mobilesubstrate
Version: 0.0.1
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: snakeninny
Author: snakeninny
Section: Tweaks
makefile文件
THEOS_DEVICE_IP = 192.168.1.100
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
include /opt/theos/makefiles/common.mk
TWEAK_NAME = iOSREGreetings
iOSREGreetings_FILES = Tweak.xm
iOSREGreetings_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 SpringBoard"
**tream.xm文件 **
%hook SBLockScreenDateViewController
- (void)setCustomSubtitleText:(id)arg1 withColor:(id)arg2
{
NSString *str = @"主人翁健康专注小儿推拿!";
%orig(str, arg2);
}
%end
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)application
{
%orig;
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Come to http://bbs.iosre.com for more fun!" message:nil delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
%end
最后编译运行
网友评论
The "iphone " target is not supported on the “macosx” platform. Stop.
include path for stdlibc++ headers not found; pass '-std=libc++' on the
command line to use the libc++ standard library instead
[-Werror,-Wstdlibcxx-not-found]
楼主知道怎么解决吗?
然后sudo git submodule update --init --recursive
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak iOSReGreetings (armv7)…
==> Generating debug symbols for iOSReGreetings…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Linking tweak iOSReGreetings (arm64)…
==> Generating debug symbols for iOSReGreetings…
==> Merging tweak iOSReGreetings…
==> Signing iOSReGreetings…
> Making stage for tweak iOSReGreetings…
dm.pl: building package `com.victor.iosregreetings:iphoneos-arm' in `./packages/com.victor.iosregreetings_1.0-5+debug_iphoneos-arm.deb'
==> Installing…
root@192.168.2.2's password:
(Reading database ... 4792 files and directories currently installed.)
Preparing to unpack /tmp/_theos_install.deb ...
Unpacking com.victor.iosregreetings (1.0-5+debug) over (1.0-4+debug) ...
Setting up com.victor.iosregreetings (1.0-5+debug) ...
install.exec "killall -9 AlipayWallet"
这算是成功了吗?
为啥不起作用呢
Makefile:6: /opt/theos/makefiles/common.mk: No such file or directory
Makefile:14: /opt/theos/makefiles/tweak.mk: No such file or directory 这个怎么处理
thoes文件的替身也找不到