My work is blocked by 'ld: warning: URGENT: building for iOS simulator, but linking in object file built for OSX' or vice versa, so I want to find out which platform a lib was built for.
I tried:
file tmp/openssl/lib/libcrypto.dylib
lipo -info tmp/openssl/lib/libcrypto.dylib
otool -hv -arch all tmp/openssl/lib/libcrypto.a
otool -hv -arch all /usr/local/opt/openssl/lib/libcrypto.a
and only thing I got is CPU type x86_64 or i386.
Use vtool with -show-build it will tell you the platform the binary is targeting.
% vtool -show-build foobar.dylib 
build/layers/foobar.dylib:
Load command 8
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform IOS
    minos 13.0
      sdk 17.0
   ntools 1
     tool LD
  version 1015.7
Currently vtool only operates on final linked binaries, such as executable files, dynamic libraries, and bundles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With