How do I determine whether a framework contains bitcode?

Hi there

I've recently had my upload rejected in Xcode Organizer as a result of one of the frameworks we use containing bitcode.

Error: [ContentDelivery.Uploader.XXXXXXXXXX] Validation failed (409) Invalid Executable. The executable 'Sam.app/Frameworks/Foo.framework/Foo' contains bitcode.

Is there an accurate way to determine whether an .xcframework contains bitcode ahead of time without using Xcode Organiser?

My current methodology is below, please can I get some confirmation that this is accurate, or suggest a more efficient approach?

I have concerns about my approach and whether it throws false positives for empty bitcode markers.

1. get original framework size
2. run xcrun bitcode_strip -r framework_path -o temp
3. get new framework size
4. if new size is smaller than original, then it contains bitcode

Thanks for the help, Sam

Answered by DTS Engineer in 826868022

The bitcode_strip man page explains that bitcode is stored in the __LLVM segment. You can check for its presence using otool with the -l option.

ps If you search the ’net for "__LLVM", you’ll find various folks explaining how this works in general. I’m focusing on your specific question here because… well… bitcode is no longer relevant to the Apple ecosystem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The bitcode_strip man page explains that bitcode is stored in the __LLVM segment. You can check for its presence using otool with the -l option.

ps If you search the ’net for "__LLVM", you’ll find various folks explaining how this works in general. I’m focusing on your specific question here because… well… bitcode is no longer relevant to the Apple ecosystem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How do I determine whether a framework contains bitcode?
 
 
Q