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

resim.dylib not built for iOS simulator - doesn't inject #63

Closed DoggoKt closed 3 years ago

DoggoKt commented 3 years ago

So I've followed the setup for the readme, and when I boot up an simulator, i go to ~/simject/bin and run the resim tool. The simulator resprings but shortly after the script quits, dyld comes on and gives an error in the sense of no suitable image of simject.dylib found, did find one but that's not for simulator.

Precise output:

iMac:bin d0gg3r$ ./resim
resim (C) 2016-2020 Karen/あけみ (angelXwind)
Injecting appropriate dynamic libraries from /opt/simject...
Respringing a booted device ...
iMac:bin d0gg3r$ dyld: warning: could not load inserted library '/opt/simject/simject.dylib' into hardened process because no suitable image found.  Did find:
    /opt/simject/simject.dylib: mach-o, but not built for iOS simulator
dyld: warning: could not load inserted library '/opt/simject/simject.dylib' into hardened process because no suitable image found.  Did find:
    /opt/simject/simject.dylib: mach-o, but not built for iOS simulator

macOS 10.13.6 (High Sierra), Xcode 10.1, tried with simulator iPhone X (iOS 12.1).

DoggoKt commented 3 years ago

Fixed it by changing makefile to use x86_64-apple-ios12.1.0-simulator as target triplet instead of the current one (which with xcode 10.1's clang resolves to macos so it built it for macos, not ios simulator).