@dimitri #if compiler(>=5.3) this checking runs only in Swift. How can I check in objective-C side code?
Post
Replies
Boosts
Views
Activity
This happens due to Apples data protection policy which is at some level obscure. I have been using an workaround so far which is working consistently. When app's launched check if keychain is inaccessible or not, if inaccessible just kill your app.
(BOOL) isKeychainAccessible
{
		NSString *keychainAvailablilityTestKey = @"keychainAvailablilityTestKey";
		NSString *keychainAvailablilityTestValue = @"keychainAvailablilityTestValue";
		[self createKeychainValue:keychainAvailablilityTestValue forIdentifier:keychainAvailablilityTestKey];
		NSString *loadedValue = [self keychainStringFromMatchingIdentifier:keychainAvailablilityTestKey];
		[self deleteItemFromKeychainWithIdentifier:keychainAvailablilityTestKey];
		return ([keychainAvailablilityTestValue isEqualToString: loadedValue]);
}
@Developer Tools Engineer
The library produced by lipo tool has no issue when used by a simple Sample app (Swift5). But it produces that issue for a large hybrid app (objc+Swift). Any chances of misconfigurations of my app that is using the .a file?
@Developer Tools Engineer,
My library's Base SDK is already set to iOS and I need to get a .a file that supports both iOS real device and simulators. If I only build for simulators I am getting only architectures for simulators.
Here is my Post Script to make an universal .a
define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
Step 1. Build Device and Simulator versions
xcodebuild -target CustomLib ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -target CustomLib -configuration ${CONFIGURATION} -sdk iphonesimulator -arch x86_64 -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
Step 2. Create universal binary file using lipo
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
I don't know why the library is building for macOS.
However,
otool -lv customLib.a | grep -A5 LC_BUILD produces no output for me. Need suggestion.