akemin-dayo / simject

simject is a command-line tool and iOS dynamic library that allows developers to easily test their tweaks on the iOS Simulator.
BSD 2-Clause "Simplified" License
486 stars 55 forks source link

Dylib not loading into the simulator with arm64 (and it doesn't compile with x86_64) #54

Closed jontelang closed 4 years ago

jontelang commented 4 years ago

Okay so I have the same error as #46 and #35 however neither solutions seems to work. When I compile with ARCHS = arm64 it does compile, but it won't load into the simulator. It says:

[simject] simject.xm:102 ERROR: Couldn't inject /opt/simject/Snapper2.dylib into com.apple.springboard:
dlopen(/opt/simject/Snapper2.dylib, 9): no suitable image found.  Did find:
    /opt/simject/Snapper2.dylib: no matching architecture in universal wrapper.

When I look at the dyblib itself it has, predictably, this:

Snapper2.dylib: Mach-O universal binary with 1 architecture: [arm64:Mach-O 64-bit dynamically linked shared library arm64]
Snapper2.dylib (for architecture arm64):    Mach-O 64-bit dynamically linked shared library arm64

While the simject.dylib has:

simject.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
simject.dylib (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64
simject.dylib (for architecture i386):  Mach-O dynamically linked shared library i386

My guess was that I definitely need x86_64 to make it work, but since #35 said he got it to work with arm64 I am not sure what else I can try.

Thanks

jontelang commented 4 years ago

Nevermind, I didn't read literally the only other open issue currently (#47) which points to #49 which says:

You should not specify SDKVERSION and SYSROOT while you are building tweaks for iOS simulators as they will point to the native iOS SDK.

You should specify it like TARGET=simulator:clang:latest:8.0, for example.

Removing my SDKVERSION and SYSROOT made this work. Thanks