Deploying app to testers using Travis CI and TestFairy - xcode

I want to deploy an app to beta testers via email. I am using Travis CI and TestFairy but I'm having trouble understanding what to put in the .travis.yml file:
deploy:
provider: testfairy // easy enough
api-key: "TESTFAIRY API KEY" // easy enough
app-file: Path to the app file (APK/IPA) // what to put here?
What should I put under app-file? I have a basic Xcode workspace (using CocoaPods) and I'm not exactly sure about where my IPA is. Any hints?

Disclaimer: I work for TestFairy.
You can always define in your xcode project where you want xcode to output the IPA by editing either the xcode preferences or the project preferences (Xcode Menu-> Preferences-> Locations or Xcode Menu-> File-> Project Settings).
Then use the path defined by those parameters to give the path to the IPA

Related

How I make sure react-native is signed?

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.

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.

install mobileprovision file - Xcode 6

I know this is simple, but I've read through all the questions and there doesn't seem to be a simple answer to this.
I've created an appID. I've created a mobileprovision file, downloaded it and double clicked it and that all seems fine. (I have xcode 6)
I wan't to select my distribution profile in Code Signing Identity in the build. But all my certificates are grayed out:
(No cretificate found)[check profile]. - check profile is the name of my mobileprovision file.
How do I get this profile though to show up in XCode? and where would it show up?
Full description is here:
Set the project level code signing build settings to their defaults:
Navigate to the Project > Build Settings tab.
Set the Provisioning Profile build setting to Automatic for all build configurations.
Set the Code Signing Identity build setting:
Set to iOS Developer for all build configurations in iOS projects.
Set to Mac Developer or Developer ID, as appropriate, for all build configurations in OS X projects.
https://developer.apple.com/library/mac/qa/qa1814/_index.html

How to distinguish between "Ad Hoc" and "App Store" Code Signing Identities in xcconfig files?

I'm trying to set up a Unity iOS project to run automated builds through Jenkins. So far, I've got Jenkins triggering a Unity build, which generates an XCode project. Then, using xcodebuild with XCode 4.5.2, I'm trying to generate an Ad-Hoc IPA file for distribution on Testflight.
In order to specify the code signing identity in the XCode project, I'm passing a very simple xcconfig file to xcodebuild. The xcconfig file looks like this:
//:configuration = Release
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: Company Name
//:completeSettings = none
The problem I have is that "iPhone Distribution: Company Name" is ambiguous; it refers to both the "Ad Hoc" and "App Store" code signing identities. And, of course, when I run the build, XCode chooses the App Store identity over Ad-Hoc, which is the opposite of what I'd like in this case.
Is there any way to specify that I'd like to use the Ad-Hoc identity through the xcconfig file? It seems really odd that I wouldn't be able to explicitly specify the identity in this way.
I didn't use Unity nor TestFlight yet.
But the general solution would be to use two different AppIds for AdHoc and AppStore. This way xCode can automatically select the right one.

How to make an IPA on XCode 4.3?

I have a Mac OS X Lion setup with XCode 4.3. I am not a registered Apple developer.
I told, via the plist files: /Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist and
/Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist, XCode not to require codesigning.
I then compiled my project, just a basic iPhone app project, it ran well in simulator. I could build and archive it, then sign it using a self-created certificate and the archive appeared in the Organizer.
Nothing strange for the moment, but there comes the problem: I have no "Share" button in the organizer. I absolutely need to make an IPA file out of my project if I want it to work under an iPhone as it won't accept xcarchive files. I only get the "Validate" and "Distribute" buttons which both require to be a registered Apple developer. But, no "Share" button which enables building an IPA... for free.
I have gone through XCode settings but nothing seemed to help me there. Even the documentation says a Share button is available in XCode 4.3, so my question is: Why don't I get the possibility to make an IPA? IS there any workaround to get this Share button or make an IPA out of the xcarchive via any command line or whatever?
Here's how you can make an IPA in XCode 4.3:
To Disable Code Signing:
Go to /Applications.
Right click on XCode and select 'Show Package Contents'.
Copy Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist to your desktop. (Make sure to actually copy and paste. No drag and drop)
Open it and under DefaultProperties set CODE_SIGNING_REQUIRED to NO.
Copy it back and replace the original file.
Restart XCode.
Open your project.
In Project Navigator select your project and open Build Settings section of your porject (and not any particular target)
Under Code Signing find Code Signing Identity and for both Debug and Release modes set Any iOS SKD to Don't Code Sign.
Now you should be able to build your project without any errors.
To make an IPA:
In 'Project Navigator' select Products
Right click on [NameOfYourProject].app and select 'Show in Finder'.
Create a folder and name it Payload
Move [NameOfYourProject].app to Payload.
Compress Payload and rename it to [NameOfYourProject].ipa
You should be able to get an IPA by clicking 'Distribute...' in Organizer->Archives, and choosing to 'Save for Enterprise or Ad-Hoc Deployment'.
Beginning iOs 5.1 Apple moved their files from /Developer/... to XCode->Show Package Content
In order to export codesign_allocate correctly run this line on your Mac terminal :
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate

Resources