Xcode 4.3.2 bypass code signing - ios

I'm using Xcode 4.3.2 to compile Cydia Applications.
4.1 has a simple way to allow un-signed Applications to build (plist edit), however, in 4.3.2, it does not share the same simplicity of editing a plist file.
Now, in 4.3.2, I receive this error:
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 5.1'
So my question is, how Do I bypass code signing in Xcode 4.3.2?
Thanks!

Found it! the plist is located at
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist
i assume its the same steps as http://txcom2003.wordpress.com/2011/05/11/disable-code-signing-in-xcode-4/ have not tested it yet.
EDIT: Tested it, and it worked. :)

The post below allowed me to compile from command line without changing my xcode settings (in case you still want to be able to easily test, debug on your phone and build for the app store)
Building iOS applications using xcodebuild without codesign
cd to your xcode project directory
do this: xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
You will get the application built in the release folder unless you pass the output folder as a param.
In order to locate the output, do the following:
XCode > Preferences > Locations
Below derived data is the folder to which xcode outputs the apps. I use a list view to check the time of change, which allows me to locate the correct app.
Of course, you'll next have to sign the app with ldid and do other stuff required for Cydia, the big boss does a great job there:
http://thebigboss.org/hosting-repository-cydia/submit-your-app/compile-for-cydia-submission

Related

Xcode 11.2.1 codesign error when building react native on a physical device

I am using Xcode 11.2.1 (latest now) to build my iOS react native app (react-native#0.61.4)
The build succeed on any simulator but fails on any physical device (no specific OS version)
Is there any special configuration for the new Xcode - even the react-native template app have the same issue - exit with code 1.
Finally I was able to figure out the issue. It was a code signing issue on the physical device. Simply deleting the old certificates from the keychain access then clean and build did the job.
From your terminal rm -rf ~/Library/Developer/Xcode/DerivedData
Go to KeyChain Access and Search for Apple Development ... in your KeyChains and delete them, Xcode will then ask for KeyChain password, make sure to check "Always Allow"
Inside Xcode Product > Clean (or Clean Build Folder)
Build and Run your Project again!
If the error persists you may need to restart your Xcode or even your macbook.
Also, in case of having error with exit code 1, File > Workspace Settings > Build System: Legacy Build System may help debugging your issue.

How to remove scripts (in a framework) when the ios app is archived?

I'm working on a cocoa pod framework which has a couple of shell scripts in it. After installing the pod, the user should add the following in app's build phase -> run script :
“${PODS_ROOT}/MyPod/MyPod/framework/MyPod.framework/scripts/build.sh”
After this the build works fine and app runs. But archiving creates problems. XCode gives an error saying:
iTunes Store Operation Failed
Invalid Signature. Code object is not signed at all. The file at path [SampleApp.app/Frameworks/MyPod.framework/scripts/build.sh] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
I've two concerns now:
Xcode doens't allow scripts to be a part of archive?
If thats the case, then how do I remove these scripts from archive? Is there a build setting like ${ARCHIVE_DIR} from where I can search for the latest archive and then remove the script. Or, is there some build setting where I can mention what files to ignore while building or archiving?
Also, I've already tried adding these files to 'exclude source file names' to the app's build settings. It didn't work since the script to be executed isn't a part of the app, but part of the framework integrated in app.
Also, my framework is a fat framework generated by using lipo on simulator build and device build. Which means that framework won't be code signed.
Apple does not allow simulation code inside framework when push to store, to overcome this, either ship the framework without simulator arch, or use external script to remove it during app build.
Example script can be found in some framework like Realm, basically you have to add the script file in your framework, and tell user/dev to call this on their build script (it's the strip-frameworks.sh)
This issue is stated in this archiving universal framework bug

ERROR ITMS-90046 using xctool / xcodebuild vs XCode Archive's success

I've got a command line script I use to compile, archive and submit my ios builds to ITC for TestFlight deployment. They work great, but I recently ran into an issue when trying to use an embedded framework within my otherwise working project. My script compiles and archives the project successfully but is getting ITC signing errors because of the embedded binary conflict.
xctool -workspace $BASE_DIR/$PROJECT_NAME -scheme $SCHEME -configuration $CONFIG clean archive -archivePath ./$PRODUCT_NAME.xcarchive
xcodebuild -exportArchive -archivePath ./$PRODUCT_NAME.xcarchive -exportPath $PRODUCT_NAME -exportFormat ipa -exportProvisioningProfile "$DIST_PROVISIONING_PROFILE_NAME"
# result is successful, with .ipa file generated
After a successful compilation my script tries to upload to ITC, and fails with the below msg. I get the same message if I try to upload the generated IPA file to ITC myself using Application Loader tool.
ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application
bundle's signature contains code signing entitlements that are not
supported on iOS. Specifically, value 'XXXXXXXXX.com.domain.Product'
for key 'application-identifier' in
'Payload/Product.app/Frameworks/Charts.framework/Charts' is not
supported. This value should be a string starting with your TEAMID,
followed by a dot '.', followed by the bundle identifier.
There is no application-identifier string used in my project or settings that I can find with a global search.
Extra Info
com.domain.Product would be my project's main bundleIdentifier, which has a distribution certificate and provisioning profile generated for it. Without the embedded binary that works just fine. The "Charts" embedded project has a bundleIdentifier but the team is set to "None" in the Info tab, and signing is set to Automatic. Since it is an embedded binary/framework, I'm assuming it doesn't independently sign it. When using Xcode's Archive, it is listed as a subset of the main Project with no independent identifier or entitlements.
I have also tried creating an independent appId and distribution provisioning profile for the embedded binary called "com.domain.ProductCharts" and setup the project correctly. This does not change the error.
I have further tried setting the embedded binary's project to use the same bundleIdentier and settings as the parent Project, but this does not change the error.
Why is xctool/xcodebuild unable to properly compile and sign this to get through to ITC, while the native Archiver can?
Currently, I encountered what I think is a bug in xcodebuild command similar to this, way I fixed it for me was to setup provisioning profile in the project settings. Try updating your project and run build again.
The investigation into the issue was here: https://forums.developer.apple.com/thread/14378
But others reported problem with associated domains:
SO question: Apple Store submit fails with Error ITMS-90046, but Associated Domains is not among entitlements
What is your OS, XCode ... etc?
Just a guess: Maybe you need to specify an application-identifier in your Entitlements.plist if you use the command line. Here https://developer.apple.com/library/ios/qa/qa1710/_index.html it is stated that in "In modern versions of Xcode.."
You said:
They work great, but I recently ran into an issue...
Have you created a new profile meanwhile and now there are two? Or two certificates? Here is a description on how to check your entitlements. Maybe this helps.
Creating .entitlements for the embedded framework will solve the issue only in Xcode 7.x. In the version 8.x the issue still exists.

Xcode 6.0.1 - error: CODE_SIGNING_REQUIRED=YES but EXPANDED_CODE_SIGN_IDENTITY is unset or empty

I am working on an Objective-C project that was finished pre-Xcode 6, all written in Objective-C. I just got Xcode 6.0.1 for OS X Mavericks (10.9.4). When I go to build the app (no code changes) using Xcode 6.0.1, I get an issue under the Pods-app target with the following output:
*** error: CODE_SIGNING_REQUIRED=YES but EXPANDED_CODE_SIGN_IDENTITY is unset or empty.: No such file or directory
swift-stdlib-tool --print
Find and print the Swift libraries required by an app.
swift-stdlib-tool --copy
Copy the Swift libraries into an app bundle, and optionally codesign them.
`--verbose` logs progress.
`--verbose --verbose` prints debugging details.
`--help` prints this usage information.
Environment variables from Xcode:
SWIFT_LIBRARY_PATH
Directory containing the Swift libraries.
SWIFT_EXEC
Path to the Swift compiler. The Swift libraries are
found relative to it if SWIFT_LIBRARY_PATH is unset.
DT_TOOLCHAIN_DIR
Path to toolchain that contains the Swift libraries,
if SWIFT_LIBRARY_PATH and SWIFT_EXEC are unset.
PLATFORM_NAME
macosx/iphoneos/iphonesimulator, for SWIFT_EXEC or DT_TOOLCHAIN_DIR.
CONFIGURATION_BUILD_DIR
Build destination containing the app bundle.
EXECUTABLE_PATH
Path to app's executable, relative to build dir.
FRAMEWORKS_FOLDER_PATH
Path to app's Frameworks folder, relative to build dir.
UNSIGNED_FRAMEWORKS_FOLDER_PATH
Path to another Frameworks folder, relative to build dir.
Files copied here are never codesigned.
EXPANDED_CODE_SIGN_IDENTITY
Code signing identity for /usr/bin/codesign.
CODE_SIGN_KEYCHAIN
Optional keychain to search for the code signing identity.
CODE_SIGNING_ALLOWED=YES
Perform code signing, if EXPANDED_CODE_SIGN_IDENTITY is also set.
CODE_SIGNING_REQUIRED=YES
Perform code signing, and fail if EXPANDED_CODE_SIGN_IDENTITY
is not set.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 1
Additional facts:
Xcode 6.0.1 knows about my developer profile.
Xcode 6.0.1 knows about the correct provisioning profile associated with said developer profile.
I have set the Provisioning Profile setting in Xcode's Build Settings for the app target to said provisioning profile.
I have set the Release Code Signing Identity to the identity associated with said provisioning profile.
Here is the question: why am I getting the error described in the Xcode output above?
EDIT:
After upgrading to OS X 10.9.5 (Mavericks), I still get the same error.
Try updating mavericks to version 10.9.5, I'm fairly sure this is an issue with Xcode 6.0.1 under 10.9.4

Phonegap local builds fail with media plugin

create new project
build for iOS: SUCCESS
add media plugin
build for iOS: FAIL
The following build commands failed:
CompileC build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Objects-normal/i386/CDVSound.o HelloWorld/Plugins/org.apache.cordova.media/CDVSound.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
[error] /Projects/Code/hello/platforms/ios/cordova/build: Command failed with exit code 65
Here's the list of commands
phonegap create hello
cd hello
phonegap build ios # WORKS
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
phonegap build ios # FAILS
Same scenario happens with cordova, and if I use sudo.
I fixed the problem by completely deleting the iOS folder under platforms, then re-running phonegap build ios.
This is something I ran into a while back. If you’re not an iOS developer, but get tasked with building iOS apps, you may run into this. This particular exit code is fun because xcodebuild doesn’t tell you what the problem is.
Aside from building your app using the Xcode IDE, you also have the command line utility xcodebuild available to you. Assuming the code itself compiles just fine, this tool will tell you, for example, if you’re missing a provisioning profile or something.
In my case, it turned out xcodebuild didn’t have access to the certificate I was using.
So… here’s some things to check for:
Make sure you’ve installed an up to date certificate in your Keychain
Remove expired certificates
Grant access to xcode to use your certificate (or allow all programs to use the certificate)
Make sure you’ve installed an up to date provisioning profile
Remove expired
provisioning profiles
Another option ....
use https://build.phonegap.com which will build the app for you and generate your .ipa and .apk files. It is free for 1 project (just delete your project and then re-upload if you have multiple ones). Just make an account, upload your certs and then you upload your www folder.
Thumbs up if you this was helpful to you!
I got the solution on PhoneGap Google group
And the solution is to add the File plugin also. Strange that these dependencies are not mentioned but it worked. I guess we'll need to randomly try the combinations of plugins until something works.
The bug is logged here: https://issues.apache.org/jira/browse/CB-6225
And it looks like you have to add File plugin first, then Media, the order is important.
try add sudo when add cordova plugin into your project.
sudo cordova plugin add https://github.com/apache/cordova-plugin-media
I was getting an exit code 65 after adding the dialogs plugin. Tried some of the top answers here, but in the end James's advice worked: deleted the ios platform, reinstalled the platform, and then it built.

Resources