环境: MacOSX 11.5.2(intel) , Xcode 12.5.1
Xcode 12.5.1 正常安装完成MonekeyDev后,能看到MonkeyDev的项目 ,但是Command Tool类型的项目无法编译,编译时报错:
Showing Recent Messages unable to resolve product type ‘com.apple.product-type.tool’ for platform ‘iphoneos’
解决办法:
使用记事本编辑: /Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/Resources/Embedded-Device.xcspec
在头部的 ( 下面添加以下内容,重启xcode即可编译
{
Type = ProductType;
Identifier = com.apple.product-type.tool;
Class = PBXToolProductType;
Name = "Command-line Tool";
Description = "Standalone command-line tool";
IconNamePrefix = "TargetExecutable";
DefaultTargetName = "Command-line Tool";
DefaultBuildProperties = {
MACH_O_TYPE = "mh_execute";
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)";
REZ_EXECUTABLE = YES;
LIBRARY_FLAG_NOSPACE = YES;
FRAMEWORK_FLAG_PREFIX = "-framework";
INSTALL_PATH = "/usr/local/bin";
STRIP_STYLE = "all";
CODE_SIGNING_ALLOWED = YES;
EXECUTABLE_PREFIX = "";
EXECUTABLE_SUFFIX = "";
};
PackageTypes = (
com.apple.package-type.mach-o-executable
);
WantsBundleIdentifierEditing = YES;
WantsSigningEditing = YES;
},
{
Type = PackageType;
Identifier = com.apple.package-type.mach-o-executable;
Name = "Mach-O Executable";
Description = "Mach-O executable";
DefaultBuildSettings = {
EXECUTABLE_PATH = "$(EXECUTABLE_NAME)";
EXECUTABLE_PREFIX = "";
EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)";
EXECUTABLE_SUFFIX = "";
};
ProductReference = {
FileType = compiled.mach-o.executable;
IsLaunchable = YES;
Name = "$(EXECUTABLE_NAME)";
};
},
其他错误 ,如果安装时出现: https://raw.githubusercontent.com/AloneMonkey/frida-ios-dump/3.x/dump.js 等无法下载,
注释掉: /opt/MonkeyDev/bin/md-install文件内容里的下面两行, 手动下载这两个url放到/opt/MonkeyDev/bin/目录下,再重启运行:
sudo /opt/MonkeyDev/bin/md-install
即可安装完成
MonkeyDev安装方法:
sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/AloneMonkey/MonkeyDev/master/bin/md-install)"
安装之前最好先备份: /Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/Resources/Embedded-Device.xcspec 以免xcode无法启动, 重装太麻烦了。