Run on device from xcode after making archive - xcode

I have a project in Xcode 4.5.2. I was able to run the project to a device from Xcode until I built an ad-hoc version with the "archive" function. (After changing the code signing).
Now, when the device is plugged in I get the error "CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 6.0'".
I have checked which profiles are selected under "Code Signing" in build settings, trying both the generic "*" profile, and the profile I used to build the ad-hoc release (For both debug and release builds).
What confuses me is I can build the project and install it to the device through ITunes without issue. It seems it's now running the 'release' version and not the 'debug' version when building with a device connected now. The device is in the provision profile however, so shouldn't it work either way?
I've tried
Restarting xcode,
Deleting the derived data (From finder, not through the organizer),
Deleting and reinstalling the provision profile.
Any help would be appreciated!

When you create your provisioning profile, make sure its a Distribution profile with your devices UDID on it.
I use a site called www.testflightapp.com, which will also help automate this process for you. Hope that helps

Related

Xamarin.ios Error MSB6006: “codesign” exited with code 1 When Trying to Archive for Publishing

I am having an error like Xamarin.ios Error MSB6006: "codesign" exited with code 1 except this is when I am doing "Archive for Publishing" which is a step to publish Xamarin.ios. Can you guys please assist me with this? Thank you.
About publishing to App Store :
First , need to Create and install an App Store provisioning profile .
iOS uses provisioning profiles to control how a particular application build can be deployed. These are files that contain information about the certificate used to sign an app, the App ID, and where the app can be installed. For development and ad hoc distribution, the provisioning profile also includes the list of allowed devices to which you can deploy the app. However, for App Store distribution, only certificate and App ID information are included since the only mechanism for public distribution is the App
Store.
Second, Update the Release build configuration
The last , Build and submit your app .
Note : If using Automatical Provisioning will see a Team Account there .
Or Manual Provisioning will select the provisioning file directly .

Code Signing macOS App for Testing on Travis CI

I'm trying to add automated tests to my macOS app on Travis CI, but can't quite figure out code signing.
My (private) GitHub repository is set up to trigger Travis build jobs when I push to master.
For iOS projects, Xcode builds/runs/tests the project for the Simulator platform, so no code signing is required for testing (signing with a distribution identity is necessary to deploy a build, of course. But I just want to run unit tests).
But for macOS apps there is no "Simulator": the code is built and run on the development machine itself.
This article explains how to add distribution code signing artifacts to Travis' machine, so it can build/sign a distribution binary for iOS.
I have modified the steps explained there to use macOS development artifacts instead of iOS Distribution ones. The scripts that decrypt my artifacts and install them on the Travis machine seem to work with no problem.
The Problem
However, unlike for distribution, development provisioning profiles contain a specific list of devices on which builds are allowed to run; in my case, my profile obviously only contains de device ID of my local machine. Obviously there is no way I can get the device ID of the mac that Travis uses, and even if I could, the build obviously runs on a different machine each time.
How Can I Build and Unit-Test macOS Apps on Travis CI?
TL; DR:
I solved the code-signing problem by disabling code-signing altogether (it isn't needed for running unit tests), as explained in this brilliant answer by #robmayoff.
The Details
I still need code-signing for testing my app locally (it uses entitlements to read from/write to user-selected files and folders). So I created a new configuration in Xcode by cloning Debug, named UnitTest.
I disabled code-signing and set Development Team to "none" for this configuration.
Next, I created a dedicated scheme (shared, of course) that uses the UnitTest configuration for build and test. I had to do this in both the App target and the Tests target (I gave up on the UI tests because they require Accessibility enabled to run, and the remote machine does not have those permissions). I had to do this because I couldn't get the xcbuild tool to use the UnitTests configuration.
I haven't quite got my Travis build to successfully complete yet, but I've overcome most obstacles (code-signing included).
Hope this helps someone!
Update
I finally got Travis CI to successfully build and test my app. Off-topic, but my code had the following issues:
Deployment target of macOS 10.15 (latest available image on Travis is 10.14)
The project was linking against CryptoKit.framework (available only since 10.15!); had to replace it with similar functionality in CommonCrypto.
Somehow the issues above didn't prevent building the app, only running the tests. I was getting an 'image not found' error for CryptoKit.framework.

ionic build package error for ios - code sign error

I'm struggling in getting my app ready for submission to Apple App Store...
I have valid ios development and distribution certificates and provisioning profiles.
I can successfully build my app via Xcode using development certificates and provisioning profile and works fines on test device i.e. iPhone 4s.
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the Provisioning Profile to the production profile, the app builds successfully but when Xcode tries to run the app on the iPhone, it throws an error: 'App installation failed. A valid provisioning profile for this executable was not found'.
Not sure if the above is related, when I try to build the app using ionic package CLI command; 'ionic package build ios --release --profile [PROFILE-TAG]' I get this error:
CheckCheck dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
For info, I have created the ionic security profile as suggested here: Security Profiles
I'm using:
OS X El Capitan
Xcode 7.2.1
Cordova 6.0.0
Ionic version: 1.2.4
Happy to provide more info if required. Thank you.
As you have mentioned in the question
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the
Provisioning Profile to the production profile, the app builds
successfully but when Xcode tries to run the app on the iPhone, it
throws an error: 'App installation failed. A valid provisioning
profile for this executable was not found'.
You can't directly run the build with the production profile/certificate in the device, to directly run from the xcode you have to build it with the development provision profile
If you want to test your production build before submisson you can download it with the TestFlight, it will be easier and better way of checking the build as same build will go for the submisson
If you need help with testflight you can refer doc here:
Apple Doc:Beta testing with testfligjt
Apple Doc: Distribute your app with testflight
Ray wenderlich Testflight tutorial
App which signed with an App Store provisioning profile can only be installed that downloaded from App Store, and for testing production behavior, you can generate an Ad-Hoc profile to sign your app. Ad Hoc Provisioning Profiles in Depth and How to

Google iOS SDK fails to archive (use of undeclared identifier errors)

I have attempted to archive my project for submission to App Store, however, every time I get errors "use of undeclared identifier" for everything related to google iOS SDK. The application itself runs and builds flawlessly with the discussed SDK integrated, the only thing that fails is the archive process. I have tried both cocoa pods and manual method of integration (separately, of course). Furthermore, I used the latest xCode versions (6.4 and 7 beta 4) on two different macs running OS X 10.10.4. This is the guide I have been using.
Your issue has something to do with the configuration of archiving in combination with your Release settings. If you change the scheme settings Command + < to use the Debug configuration for archiving, you may be able to successfully archive your app. This means that somewhere you are probably not matching the Debug and Release configurations.
See the following screenshot for example project Build Settings that are missing the Swift bridging header in release:
Add bridge.h to the release configuration and you will be able to build with the Release schema and you will be able to archive under release configuration.

Build an archive of Phonegap project in Xcode

I created an Phonegap app for iOS devices. It works fine on my connected device, but if I want to archive the app to get an .ipa file I get errors from the compiler.
Do I have to change something in the Build Settings?
A couple of things to try:
Go to the Build Settings, then Linking, then find Other Linker Flags. Then change $(TARGET_BUILD_DIR)/libCordova.a -----> $(BUILT_PRODUCTS_DIR)/libCordova.a
Under Build Settings in Architectures, change Build Active Architecture Only to YES.
I'd try both these methods for the Project and Target. Hope this helps!

Resources