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

error running resim #68

Closed nico671 closed 3 years ago

nico671 commented 3 years ago

`dyld: could not load inserted library '/opt/simject/simject.dylib' because no suitable image found. Did find: /opt/simject/simject.dylib: mach-o, but wrong architecture

Child process terminated with signal 6: Abort trap Error executing command, exiting.

` on an arm64 Mac with the latest Xcode and Theos

PoomSmart commented 3 years ago

What's the output of xcode-select -p on your machine?

nico671 commented 3 years ago

/Applications/Xcode.app/Contents/Developer

PoomSmart commented 3 years ago

@nico671 Could you also give me the output of lipo -info /opt/simject/simject.dylib ?

nico671 commented 3 years ago

Non-fat file: /opt/simject/simject.dylib is architecture: x86_64

EthanArbuckle commented 3 years ago

Was that simject dylib compiled on your arm64 machine? make setup uses clang's target triple, which in this case should be arm64-apple-darwin*

When you run make setup, does it saying "Compiling simject for arm64"?

nico671 commented 3 years ago

it says Compiling resim for x86_64-apple-darwin20.5.0

EthanArbuckle commented 3 years ago

Can you try compiling the simject dylib manually:

cd simject
clang simject.m -framework Foundation -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -DDYLIB_DIR='@"/opt/simject"' -target arm64-apple-darwin20.5.0 -dynamiclib -o simject.dylib

then run resim

nico671 commented 3 years ago

that worked perfectly thank you