Fastlane upload_to_testflight lane is looking for target selection manually - ios

Im trying to build and upload an ipa file to testflight using Fastfile, but when i start fastlane command to run, there is pop is coming and that is looking for target selection. Hence it still needs a manual intervention however i aimed to automate the deployment process.
Here it is the screenshot which im telling the actual issue.
I tried using SCHEME to pass TARGET of Xcode workspace , however it still requires to provide target selection manually.
Is there any way to automate the target selection for upload ipa file to Testflight?

Looks like you are missing the target from the parameters on the call:
version = get_version_number(
xcodeproj: "Project.xcodeproj",
target: "App"
)
The docs note the properties here.

Related

Xcode Is it possible to create a UITest project only for a given received IPA file?

I would like to hire a UITester for a iOS app. I would like that he write automated tests with Xcode but I don't want to share my project with him. So my idea is to send him an app file.
I have tested my idea with Xcode but I am blocked by an error "No target application path specified via test configuration: <XCTestConfiguration: 0x6000019ec000>"
My test project has only a UITest target so that means I can't select a host app. I have the app file but I don't know how to make it selectable in Target Application on General tab of the target.
Any ideas?

Firebase TestLab on IOS - the .xctestrun file didn't specify any test targets

I'm trying to use firebase TestLab on iOS using this guide:
https://firebase.google.com/docs/test-lab/ios/firebase-console#build_xctests_for_your_app
but after I upload the zip file including the xctestrun file I'm getting the following error:
Upload invalid: the .xctestrun file didn't specify any test targets.
I have two targets in my app and a Tests target and a UI tests target,
On both test target, I set the Target I want to test as the host application.
Any ideas?
In my case the following order of actions helped:
open your app's .xcworkspace file
go to File -> New -> Target
choose iOS Unit Testing Bundle and press the button Next
check the credentials like Product Name, Team, Bundle Identifier, etc. and then press the button Finish
Now you need to make a new attempt to build for testing (Product -> Build For -> Testing) and follow the Firebase instruction regarding creating an archive
This probably happened because you testing targets are not part of the scheme when building.
Take a look at the .xctestrun and see if it is an empty .plist file. If it's empty then add the testing targets when building.

How to handle framework with dev and release versions in iOS?

In my project I am using a framework which contain simulator,dev and release version.How can I test the release sdk?What are the particulars that I have to check?
As far as I know ,I can change the scheme and create a release build.I want to know if it will automatically choose the release sdk or not?
Or do I have to create an archive and install as ipa file?If I can install the app via xcode do I have to remove the cable and launch the app manually?
If it helps someone :
If you have separate release sdk and dev sdk, you can select either of them as required by editing the scheme setting (Product->Scheme->edit scheme).
As you can see in the image below,You can set the build configuration separately for running,testing,profiling,archiving etc.
For testing the release sdk,you can select the build configuration to release and properly setting the framework search path,header search path etc in the buildsettings and run the code.
By changing the archive scheme setting to release,we can choose the dev/debug sdk to generate the ipa file for development deployment(Check out the following link for more details).You may have to use the development provisioning profile to do so.
Link 1
Link 2
Link 3
It's very straightforward with Xcode:
For me it builds dylib release version this way. If you just do build, Xcode builds debug version.
David

Xcode project scheme is not currently configured for the test action

I am trying to run an Xcode unit test for my iOS application. I am willing to do it on an iPad connected via USB to a Mac. I am trying to run the test from the command line in order to trigger it from Jenkins later on.
Below is what I'm currently typing into the command line and the error I'm getting. Please help.
The code:
xcodebuild test -scheme MyApplication -destination "platform=iOS,name=iPad"
The error:
Scheme MyApplication is not currently configured for the test action
For me the problem was that no tests were added to my scheme:
By adding test bundles to my scheme via the '+' button then the scheme could be built by Xcode and xcodebuild.
For everyone struggling with this problem.
My solution was to:
Select Test Target
Manage Scheme
Select Run in the left menu
Select Info in the tab
Choose Executable Target from the dropdown menu
Hit Close.
Fixed this up by removing duplicate schemes from Xcode. The schemes can be added/removed/shared/edited in Xcode via Product -> Scheme -> Manage Schemes.
Please follow following steps to resolve this error.
Select your project scheme at the top.
Click on Manage Schemes.
Select your test target in the popup.
Make sure to click on Edit button at the bottom left of popup.
Select Build.
Click the checkbox below "Run"
Close the popup.
You should check your workspace data on Jenkins and see which *.xctest is already uploaded. Then you have to rename your UI/Unit test target to that *.xctest data in your xcode project like what you
have on Jenkins and then push again.
OR wipe out your workspace from Jenkins and push all data again with new UI/Unit test target again.
(Of course you have to ensure that you have already made a scheme for project.)
In my case I had no test file...
Here is a tutorial to perform UI Tests and create screenshots :
https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line
My problem was that the Tests.swift file was importing a module that no longer existed (I renamed the Targets for the project). Check to make sure all test files are importing currently existing modules.
I was getting this similar error, but none of the other solutions helped. Since the error was first noticed while running via Fastlane, I next ran xcodebuild manually using this command to mimic the same.
xcodebuild -workspace Noname.xcworkspace -scheme Noname -enableCodeCoverage YES build-for-testing
I then saw errors regarding: Signing for "Noname-Dependency" requires a development team.
I also so reference to a macosx signing error, which I cannot sadly reproduce having since fixed the issue.
To fix the issue, under Signing & Capabilities for the Target I selected None and then under General I unchecked Mac, as we are not needing/using that but it was selected by default when creating this new project (CocoaPod).
Oddly enough, I added back Mac and things still kept working. I think that there is a oddity with the Xcode project file and/or scheme file(s) such that when you tinker enough with it -- things get reset/fixed.
I had a test plan set up (xctestplan).
I needed a separate configuration for the tests (the test plan) in addition to "Shared Settings".
Please also make sure that the test plan (under Xcode scheme settings) includes a test target AND a configuration.
Screenshots attached:
In my case, it was failing intermittently with this error, turns out I had two schemes with the same name and Xcode sometimes picked the wrong one, so make sure you do xcodebuild -workspace "MyWorkspace.xcworkspace" -list to see all your schemes and find out if you have repeating names.
Your test plan should have at least one custom configuration.
Go to Manage Schemes.
Delete all schemes and click on Autocreate Schemes.

Xcode Scheme with multiple targets creates Generic Xcode Archive

Ok, I am almost certain that this thing worked before but I am stuck now...
I have a workspace with multiple targets which I want to archive and submit to appstore simultaneously.
I have created a new scheme, I have all targets selected in there for Archive and I try to execute Archive in order to make all targets to IPAs
I always end up getting an Xcode Generic Archive. The only case I am getting an IPA is to select Skip Install = YES for all targets but one each time, which I suppose it actually means to build just one target so there is no meaning to multi target scheme.
Any clues about that? I checked the size of this Generic Archive and it looks like all apps combined in one file.
Indeed Apple confirmed that this is "impossible because archiving step in a scheme is designed to produce only one archive" and they asked me to build every target separately. I wonder if I can archive every scheme in a workspace automatically from command line to produce the desired result.
In order to create an IPA file using Xcode, we can use commands too. One can follow these steps:
1. Navigate to the App folder in Terminal
2. Run Cordova build command using "cordova build iOS" command
3. Open your iOS Project in Xcode.
4. Choose Product -> Clean. Then Archive.
More detailed screenshots are available here.

Resources