Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad CPU type in executable #2

Open
alrjqow opened this issue Jul 19, 2019 · 4 comments
Open

Bad CPU type in executable #2

alrjqow opened this issue Jul 19, 2019 · 4 comments

Comments

@alrjqow
Copy link

alrjqow commented Jul 19, 2019

在 iOS12 上使用出现这个错误,请问杰哥是系统版本原因吗

@kingka
Copy link

kingka commented Jul 24, 2019

在 iOS12 上使用出现这个错误,请问杰哥是系统版本原因吗

@MrGuys
Copy link

MrGuys commented Jul 26, 2019

我遇到这个问题,求大佬解答

@Navimark
Copy link

我遇到这个问题,求大佬解答

修改 Makefile 的 ARCH 为 arm64,即:

# Config
ARCH = arm64
IOS_VERSION = 8.0
EXECUTABLE_NAME = MJAppTools

# Dirs
RELEASE_DIR = Release
PROJECT_DIR = MJAppTools
EXECUTABLE_FILE = $(RELEASE_DIR)/$(EXECUTABLE_NAME)

# Header Files
HEADER_DIR1 = $(PROJECT_DIR)
HEADER_DIR2 = $(PROJECT_DIR)/SystemHeaders
HEADER_DIR3 = $(PROJECT_DIR)/Extensions
HEADER_DIR4 = $(PROJECT_DIR)/Models
HEADER_DIR5 = $(PROJECT_DIR)/Tools

# Source Files
SOURCE_FILES = $(HEADER_DIR1)/*.m
SOURCE_FILES += $(HEADER_DIR3)/*.m
SOURCE_FILES += $(HEADER_DIR4)/*.m
SOURCE_FILES += $(HEADER_DIR5)/*.m

# Entitlements
ENTITLEMENT_FILE = $(RELEASE_DIR)/MJAppTools.entitlements

codesign: compile
	@codesign -fs- --entitlements $(ENTITLEMENT_FILE) $(EXECUTABLE_FILE)

compile:
	@xcrun -sdk iphoneos \
		clang -arch $(ARCH) \
		-mios-version-min=$(IOS_VERSION) \
		-fobjc-arc \
		-framework Foundation \
		-framework UIKit \
		-framework MobileCoreServices \
		-Os \
		-I $(HEADER_DIR1) \
		-I $(HEADER_DIR2) \
		-I $(HEADER_DIR3) \
		-I $(HEADER_DIR4) \
		-I $(HEADER_DIR5) \
		$(SOURCE_FILES) \
		-o $(EXECUTABLE_FILE)

再次 make,得到的 MJAppTools 二进制即为arm64架构

@ko1o
Copy link

ko1o commented Feb 19, 2020

直接使用Xcode,选择真机设备, Command + B编译成功后,导入到手机即可解决问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants