How I make sure react-native is signed? - xcode

I was having an issue with react-native not working because it is not signed. There is a question about it here on SO already. The problem is I can't use that solution, I am trying to distribute a .zip file with react-native already inside the "node_modules" folder, so people can build it easily, so I need to get it signed instead, I can't go around telling people downloading my file to just disable their MacOS security...

Create an Apple development account by using your email and add it in your Xcode, Project Navigator > Signing & Capabilities > Signing (Debug), mark the Automatically manage signing:
Add the bundle identifier name as this patter:
com.[developer account name].[project name]
Then you will be able to build your application on your physical device.

Related

Getting "Failed to create IXPlaceholder for app bundle ID" after installing xcode on an external drive

After struggling with space issues I finally bought an external drive for my Mac. I deleted my existing copy of XCode that was installed on the internal drive, downloaded the latest version from the apple developer site, and installed that to the external drive. I can open & build my project just fine, but when it comes to running it in the simulator, I get the following error:
"Failed to create IXPlaceholder for app bundle ID"
I did search on that, and found some answers that boiled down to "run xcode-setup --install", which I did, but it did not fix the issue.
The simulator does come up & run, it just doesn't load my project.
I'm pretty new to Mac/Xcode development, so hoping this is something basic I'm missing.
Delete your derived data first if not work try;
Go to your project and once you are on the build phases tab you should see a section that says Embed App Extensions, click on to extend.
Now that you will see a opened Embed App Extensions you should see a checkbox that says Copy only when installing. You need to check that checkbox.

Phonegap/Cordova to ipa file without Phonegap build

I use Phonegap Build to create my Android and iOS app files. However I want to compile the files locally on my computer, and not use Phonegap Build. I have done this successfully for Android (see here: https://cordova.apache.org/docs/en/latest/guide/platforms/android/) but iOS is more complicated. I have little Apple-knowledge.
Does anybody know of any good tutorials on how to import a Phonegap plugin in to the xcode environment...ideally one for someone who's background is NOT an Apple developer.
I have managed to do this myself but I've answered my own post to help others who may be in a similar situation - Please note this is correct as of end of 2019, and I had already successfully uploaded an IPA file to the app store via Phonegap Build before. All I'm doing here is compiling my Phonegap/Cordova project IPA file directly on a Mac, rather than using Phonegap Build:
1) You will need a mac and a developer license (as expected). You will be using both a terminal window where possible and Xcode.
2) Certificates and provisioning are a messy nightmare right out of satans bumhole. But just make sure you set up an "App store distribution" profile on your developer.apple.com account. If you don't know how to handle certificates and provisions please read here https://medium.com/ios-os-x-development/ios-code-signing-provisioning-in-a-nutshell-d5b247760bef.
But remember you only need to download the certificate to your Mac, and add it to your "My Certificates" area. The provisions can be automatically downloaded/linked to via Xcode.
3) Install Xcode 11 on your Mac. Forget all the other versions.
4) Install Cordova CLI on your Mac using the terminal - open up the terminal window and type:
sudo npm install -g cordova
5) Create a FRESH cordova project - dont try to be smart by shoe-horning the one you've already used on your PC:
cordova create hello com.example.hello HelloWorld
...you might need to to add "sudo" to the front of that. Don't copy and paste any html files or plugins in to it yet!
6) If your Mac might give you read/write access problems. So locate the entire folder, ctrl+click on the project folder, choose "get info" ...in the bottom right of the popup window click the lock icon and enter your password. Now change all settings to "read and write", then click the cog icon and select "Apply to enclosed items".
7) Create the platform : sudo cordova platform add ios#5.1.0....note, DO NOT use ios5.1.1 if you are using firebase or push notifications, as it seems to break with 5.1.1.
8) Apple will (again) probably give only read access to your new platforms/ios folder, because it hates you and wants you to suffer. So repeat step 6 if necessary.
9) Open Xcode the following way... In your projectname/platforms/ios/ folder locate the .xcworkspace file. This is the file you use to open your project. DO NOT use the .xcodeproj file because this is for older Xcode versions (and it will just break your whole damn project). Also go to File->Workspace Settings and ensure Build System is set to "Legacy Build System".
10) Now piece together your config.xml file by extracting the bits you need from your previous config file to your fresh new one. Don't bother moving over any android-specific bits.
11 a) Apple bring you a fresh slice of hell with cocoapods - a dependency manager for Swift and Objective-C. You'll need to install this if your app uses certain things like push notifications (firebase for example). You can install this via the terminal window. FIRST....close down Xcode. NEXT go to projectname/ and type: sudo gem install cocoapods. FINALLY go to projectname/platforms/ios/ and type pod install.
11 b) There's a bug...a pretty major one. Your cocoapods will fail when building at this point. So you need to do some hacking here. Navigate to the directory projectname/platform/ios/Pods/TargetSupport Files/Pods-yourproject and look for
Pods-yourproject.debug.xconfig and Pods-yourproject.release.xconfig
You need to copy the content of these files into platform/ios
pods-debug-xconfig and pods-release.xconfig respectively----THANK YOU kyale-mwendwa for this tip....https://github.com/phonegap/phonegap-plugin-push/issues/1825#issuecomment-359155007
12) Now copy and paste your www folder over in to your fresh project. You are ready to build your project...
13) Re-open xcode using the .xcworkspace file. Now you need to ensure your provisioning is set up correctly for your release. Click the project name at the top of the left-hand column (right above where it says config.xml). Now in the main window click your app name under the "Targets" section. Now select "Signing and Capabilities". If you managed to set up certificates and provisions correctly you should be able to select your "team" (no I don't know either, just select whatever option you can here), and enter the correct bundle identified (com.whatever.whatever).
14) Ok, you are ready to create your IPA file. Still have hair?? Bonus points for you!
Just before this next bit, go to Xcode and towards the top of the screen you will see the project name followed by "> iPad (7th generation)" or something similar. Click this and make sure you choose "Generic iOS device".
Now back in the terminal enter sudo cordova build ios. You don't have to transport your plugin files over from your windows-built cordova folder. Cordova will detect the plugins you need from your config.xml and install them appropriately.
15) If you have no errors you can now create your IPA file and even submit it directly to the App store (this bit of Xcode is actually really good). In Xcode, from the menu at the top click "Product" and then "Archive". Follow the onscreen instructions. At this point your IPA file is created.
You can choose to automatically distribute your file to the Appstore, but I suggest clicking the "Validate App" option first, which will re-request the correct certificates/provisions and give you a summary of any issues. If no issues you can click "Distribute App" and it will upload the IPA file to your Appstore Connect (formerly iTunes Connect) area.

Xcode having issues with sign certificates

I was still using Xcode 7.X, so I updated it to 8.2.1 by downloading the latest version from the App Store.
Now Xcode seems unable to load certificates. When I open my project (Mac app), in the MyApp.Xcodeproj viewer, in the Signing segment, there is the loader (spinner), and it won't go away.
When preparing the package for App Store distribution the validation process fails as it says that sandboxing is not configured. However I am sure it is, as this very app is in the Store.
EDIT I've completely removed Xcode (inclusing com.apple.dt.** files) and reinstalled it, the problem persists, but only with this particular app. Creating a new app does load the signing section.
Try to reset the the certificates and profiles in the XCode Account manager like:
XCode > Preferences > Accounts > The Apple Id > Double Clic the Team Name > Reset all and Download all
Also can be useful to check if unchecked the "Automatically manage signing" in the General Tab of the Application and make sure you have the correct Apple ID selected.
Remove your Apple ID from your Accounts list and then add your Apple ID back to the Accounts list.
Xcode > Preferences > Accounts > Select Account > Click the minus symbol
Xcode > Preferences > Accounts > Click the plus symbol
The solution was unexpected: out of options, I simply created a new project (with a different name). The idea was to copy all code and working settings to start fresh.
As I begun the process the "new" app was working, so I renamed the project as my actual app and then I opened the old project to copy some xcode settings. With my surprise, now the Signing section was working again also in the old app.
So I figured that I could delete the "new" app. However, after deleting the new app, the old one stopped working again (spinner in signing section), this time also mentioning that it was unable to locate certain files that were in the new app folder.
I recovered from the bin the new app, and finished the transition of all settings. Now everything is working again.
My assumption (not verified) is that some config files deep in the OS were conflicting with signing setting for this particular project (as identified by its name), so when I renamed the new app with the same name of the broken project I must have overwritten such broken setting.

Cannot export developer ID signed Mac app

I am trying to build an update to my Mac app. As usual, I clicked Product>Archive then, in the Organiser, I clicked Distribute...>Export Developer ID-signed Application. Xcode finds my Developer ID, but it fails with the error "Code signing operation failed - Check that the identity you selected is valid."
This has never happened before, so I'm at a bit of a loss - I most recently exported a version of my App last week.
The only things that have changed are:
I have changed my Apple ID password
I added Cocoapods to my project and I'm now using the .xcworkspace file, rather than the .xcodeproj file.
I've tried refreshing the Teams list in the Xcode organiser, deleting all my Mac development and distribution certificates, restarting Xcode, and asking very nicely, but I'm still getting the same error.
You've done the right part in xcode, the only place that might be the problem is the Dev portal. Check your Dev certs in there if needs be you may have to remove those and request them again then sync them with xcode. That has worked for me before and might work out for you.
In case anyone ends up here, but still has the problem after checking everything in the dev center,
try removing extraneous files form the project. For me these were:
Gruntfile.js, karma-e2e.conf.js, karma.conf.js, and the entire node_modules directory.
see: How to build IPA for distribution with TestFlight with XCode 5?

Adding an unattached UDID to existing project in XCode

Sorry, I'm sure this question is quite basic, but from what I've read I'm doing it correctly and still not having any luck.
I have a project in XCode. It compiles correctly and I can install it ad-hoc on all the devices that were originally part of the provisioning profile I created when I first started the project.
I now have another UDID that I need to add so they can test. They live on the other side of the country, so I can't attach the device and add it through XCode.
So from my understanding, these are the steps I have taken:
Over at developer.apple.com, add the UDID to the device list.
Update the provisioning profile on the developer website to include the added UDID.
In XCode, open organizer, select provisioning profile and hit refresh.
Recompile.
Am I missing a step in there? It recompiles fine but apparently won't install on the added device.
EDIT: I found This Post, which sounds like what I want, but I can't find the checkbox for "Automatic Device Provisioning". Where is that located?
It seems that the "Automatic Device Provisioning" checkbox has been removed from later Xcode versions, check this question: The Automatic Device Provisioning options have gone since upgrading to Xcode 4.3.1?.
The steps you listed seem good. You could check if the new profile has been effectively inserted into the ipa file:
- rename the .ipa in .zip;
- navigate into Payload and then contents of the .app package;
- open the embedded.mobileprovision file with a text editor;
- search for the new UDID string inside the file.

Resources