EzDev.org

fastlane

fastlane - ?? The easiest way to automate building and releasing your iOS and Android apps fastlane - iOS and Android Automation for Continuous Delivery


XCTests failing to launch app in simulator intermittently

Has anyone experienced and fixed:

XCtests failing intermittently to launch app in the simulator for UI testing (XCUI). I am running through fastlane, different tests appear to fail each test run.

OSX: 10.12.3 iOS simulator: 10.0 XCode 8.2.1 Fastlane 2.11.0

Attempted to fix it by adding a 3 second sleep between setup and launch in my tests, but it still appears, maybe not as often but still...

UI Testing Failure - Failure attempting to launch : Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "no.something.bb.debug" failed." UserInfo={NSLocalizedDescription=The request to open "no.something.bb.debug" failed., NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace) for reason: Busy ("Application "no.something.bb.debug" is installing or uninstalling, and cannot be launched")., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x6080002598f0 {Error Domain=FBSOpenApplicationErrorDomain Code=6 "Application "no.something.bb.debug" is installing or uninstalling, and cannot be launched." UserInfo={BSErrorCodeDescription=Busy, NSLocalizedFailureReason=Application "no.something.bb.debug" is installing or uninstalling, and cannot be launched.}}}


Source: (StackOverflow)

How to create app file with fastlane for simulator

I need to create with fastlane .app file (or .ipa file if it works to) which I could next drag and drop to simulator on another computer. I tried do it with gym or with xcodebuild parameters but I don't know how to do it.

For now I do it in this way:

  • In XCode I build application for simulator

  • Next I am searching app file in DerivedData (~/Library/Developer/XCode/DerivedData/Build/Products/Debug-iphonesimulator/)

  • I copy this file somewhere else

But I need do it with fastlane.


Source: (StackOverflow)

How to get iTunes connect Team ID and Team name?

I'm writing down an Appfile for fastlane, my problem is I already have the team_name and team_id in Apple Dev Center but I can't get the iTunes Connect ID/itc_team_id. I'm working with different team. How do I get it? Any guide would be great. Thanks


Source: (StackOverflow)

Unable to run fastlane sigh. "Couldn't download certificate"

For some reason I'm getting Couldn't download certificate, got this instead: HTTP 405 Method Not Allowed whenever I run sigh or fastlane. I tried skipping skip_certificate_verification or skip_fetch_profiles but it still doesn't work. It was working yesterday. Has Apple Developer Portal been changed or updated today?

Is anyone also getting this?

Here's the exact error I got:

/Library/Ruby/Gems/2.0.0/gems/spaceship-0.21.1/lib/spaceship/portal/portal_client.rb:311:in `download_certificate': [!] Couldn't download certificate, got this instead: HTTP 405 Method Not Allowed (Spaceship::Client::UnexpectedResponse)

Thanks


Source: (StackOverflow)

How to use Espresso UI Testing for React Native?

I'm trying to make some UI Testing with Espresso on my React Native Android application to use Screengrab by Fastlane.

I have followed this tutorial to integrate React Native in an existing app to be able to write a test. But when I started writing my UI Test I was unable to find what to write and how to target a component and perform a click on it for example.

I found this post where someone give an example on how to write Espresso Test for React Native but it doesn't work for me ... None of my component have resource-id set so I don't know how to perform some action on my application.

If someone could help me to write a UI Test with Espresso on a React Native app or give me another solution to take automated screenshot of my Android application that'll be awesome.

If you have any question let me know.


Source: (StackOverflow)

Fastlane/release automation for Android

Does anyone know a tool/project, like fastlane, for Android release automation? With upload to the playstore... I know there is some task in fastlane for the Android-part, but it isn't read yet. Fastlane Android Issue

I hope you guy's can help me out :)


Source: (StackOverflow)

How to build and deploy a react-native app from command line?

I'd like to automate the build + deploy of my React-Native app, for example to submit a TestFlight build.

Before submitting the app, I usually do the following:

  1. I run react-native bundle
  2. I switch the build configuration to Release in the schema
  3. I comment out the code relative to jsCodeLocation in AppDelegate.m

Is it possible to write a single command from the Terminal for doing those steps, so that I can then deploy it with an automatization tool, e.g. with fastlane?

So far, I'd just need to automatize the 2nd and the 3rd step.

To change jsCodeLocation I could add a condition, e.g.

#if "<build configuration is release>"
    jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
#else 
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#end

but i don't know how to reach the build configuration setting.


Source: (StackOverflow)

Where is the screenshot file from Xcode UI Test?

I'm interested how to find the location of a screenshot which is created during UI Tests of my app. I would like to understand how Fastlane Snapshot grabs this screenshot. After couple of hours of research I can't find location of those screenshots.


Source: (StackOverflow)

Instruments wants permission to analyze other processes Jenkins

So my problem is that on pure swift project (almost :-) ) with test written also in Swift I got this every build. Build is started via Fastlane 1.63. :

▸ DTServiceHub: Instruments wants permission to analyze other processes. Please enter an administrator username and password to allow this.
▸ Username (jenkins): Password:
▸ Failed to authorize rights (0x1) with status: -60007.

Problem occurs when new command-line-tools and Xcode 7.3 was installed on MacPro with OSX Server. Objective-C project works every time. I've done what was suggested in those threads, didn't work: Remove the authorization prompt from command line instruments (Under mavericks) Is there a way to remove the authorization prompt from command-line instances of Instruments (XCode)? and in all other places that I could find. I have no idea how to fix it.


Source: (StackOverflow)

How to configure build types vs. product flavors?

Based on this answer https://stackoverflow.com/a/27908019/5156317 I have a follow up question: What makes an app different that speaks for product flavours? I am trying to compare this with my XCode setup which is as follows:

  • Dev App that uses test backend
  • Dev App that uses production backend
  • Test App that uses test backend (enterprise distribution)
  • Test App that uses production backend (enterprise distribution
  • Live App that uses production backend (app store distribution)

My thoughts for the android setup:

buildTypes: debug_test debug_production // no need of enterprise apps since it is possible unsigned apps on any device release

flavors: myApp

Thanks for your support!


Source: (StackOverflow)

How to make deliver (fastlane) download metadata for multiple targets?

I have an Xcode project with six targets, each target is made to build a separate app. I'm trying to setup fastlane to assist me in publication of these apps.

Fastlane docs suggest using .env files in order to handle multiple targets (you can specify app_identifier, team_name, etc. in different .env files, and then, for instance, call fastlane appstore --env ENV_NAME_HERE). However I can't figure out how to set up deliver properly.

deliver init downloads metadata for one target only by default. I need to download metadata for all my targets to different directories (and then use those directories to upload data, obviously). deliver download_metadata doesn't accept the --env parameter (my Deliverfile depends on env files). I've tried fastlane deliver --env, but it seems to be just a shorthand for deliver, so it doesn't work either.

I guess I could just manually run deliver with different --metadata_path parameters (and all the other parameters since my Deliverfile is invalid, because it depends on env files), and then later specify directories using Deliverfile + .env files. But since I have Deliverfile and .env files already set up (now I use deliver to upload the binary only), I hoped that there is a better way. Is there?

P.S. This is a large legacy project, so splitting it into six different projects would be great, but it's not an option, unfortunately.


Source: (StackOverflow)

Improving Fastlane's runtime for Scan -> Gym -> Deploy

I've been trying to include Fastlane in a CI environment where the following should happen:

  • any commit to the master branch should trigger a test run and then a build into Testflight.
  • any commit to the development branch should trigger a test run and then a build into Fabric Beta.
  • any other commit or pull request should trigger a test run.

The lanes are working with all the code signing through match.

In order to avoid building twice I'm building through Gym and then Scan with skip_build: true and clean: false, as mentioned in #3353.

Although this does seem to help with the build time, due to the amount of cocoapods dependencies, it goes over the 50 minute limit in travis-ci.org. (Feel free to check the build logs)

How can this be improved in terms of running time? (Aside from fixing the slow compiling Swift functions mentioned in #3)

For reference, here's my Fastfile.


Source: (StackOverflow)

"App failed to quiesce within 60s"in React-Native project

So I'm attempting to run an XCode UI Test on my React Native project. My goal is to use fastlane/snapshot to grab screenshots of my app.

I finally figured out how to script my app to do what I want. Unfortunately, the app gets stuck with an App failed to quiesce within 60s message after calling app.otherElements["mainButton"].tap().

As far as I can tell as a human, my app appears to be static and not updating or animating anything. But I'm not clear what the UI Test is using for its detection heuristic, so it might be using some internal state or checking threads.

I suspect there's some React Native behavior that's keeping the UI Test from seeing things as finished. Unfortunately, without any real ability to see what UI Tests are doing, I'm not even sure where I need to dig into React Native to fix it. :(

Any help would be appreciated!


Source: (StackOverflow)

Fastlane provision profile madness

Sorry to file an issue if I'm missing something.

I'm using a lane looking like this:

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    ...
    # download certificate
    cert
    # download provisioning profile
    sigh
    # set profile uiid
    # https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md
    ENV["PROFILE_UUID"] = lane_context[SharedValues::SIGH_UDID]
    # build
    gym(
      scheme: "Release"
    )
    pilot
  end

I'm keeping having the process failing after the gym step with the following error:

❌  Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “8bd6dafb-2596-41d9-8907-8c012d23a5ac”, however, no such provisioning profile was found.

[19:27:21]: Exit status: 65
[19:27:21]: Invalid code signing settings
[19:27:21]: Your project defines a provisioning profile which doesn't exist on your local machine
[19:27:21]: You can use sigh (https://github.com/KrauseFx/sigh) to download and install the provisioning profile
[19:27:21]: Follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md

However I can see the right profile being downloaded in my app directory. I also can find this profile in ~/Library/MobileDevice/Provisioning Profiles and finally my Xcode project is configure to use the uuid downloaded by sigh using:

PROVISIONING_PROFILE = "$(PROFILE_UUID)";

variable dump:

{
    :DEFAULT_PLATFORM=>:ios, 
    :PLATFORM_NAME=>:ios, 
    :LANE_NAME=>"ios beta", 
    :GIT_REPO_WAS_CLEAN_ON_START=>true, 
    :BUILD_NUMBER=>"55", 
    :VERSION_NUMBER=>"1.0", 
    :CERT_FILE_PATH=>"/Users/xxx/Developer/xxx/56HRT5HYC6.cer", 
    :CERT_CERTIFICATE_ID=>"56HRT5HYC6", 
    :SIGH_PROFILE_PATH=>"/Users/xx/Developer/xx/AppStore_com.xx.xx.mobileprovision", 
    :SIGH_PROFILE_PATHS=>["/Users/xxx/Developer/WiredResearch/AppStore_com.xx.xx.mobileprovision"], 
    :SIGH_UDID=>"8bd6dafb-2596-41d9-8907-8c012d23a5ac", 
    :SIGH_PROFILE_TYPE=>"app-store"
 }

EDIT: 2015/12/04 - Adding Cert & Sigh output

[09:46:47]: ------------------
[09:46:47]: --- Step: cert ---
[09:46:47]: ------------------

+-------------+----------------------------------+
|             Summary for cert 1.2.6             |
+-------------+----------------------------------+
| development | false                            |
| force       | false                            |
| username    | xx@xx.com |
| output_path | .                                |
+-------------+----------------------------------+

[09:46:49]: Starting login with user 'xx@xx.com'
[09:46:53]: Successfully logged in
[09:46:56]: Found the certificate 56HRT5HYC6 (WB Technologies) which is installed on the local machine. Using this one.
[09:46:56]: Use signing certificate '56HRT5HYC6' from now on!


[09:46:57]: ------------------
[09:46:57]: --- Step: sigh ---
[09:46:57]: ------------------
+-------------------------------+----------------------------------+
|                      Summary for sigh 1.1.4                      |
+-------------------------------+----------------------------------+
| adhoc                         | false                            |
| skip_install                  | false                            |
| development                   | false                            |
| force                         | false                            |
| app_identifier                | com.xx.xx   |
| username                      | xx@xx.com |
| output_path                   | .                                |
| cert_id                       | 56HRT5HYC6                       |
| skip_fetch_profiles           | false                            |
| skip_certificate_verification | false                            |
+-------------------------------+----------------------------------+

[09:46:57]: Starting login with user 'xx@xx.com'
[09:46:58]: Successfully logged in
[09:46:58]: Fetching profiles...
[09:47:01]: Found 1 matching profile(s)
[09:47:01]: Downloading provisioning profile...
[09:47:02]: Successfully downloaded provisioning profile...
[09:47:02]: Installing provisioning profile...
/Users/hugues/Developer/xx/AppStore_com.xx.xx.mobileprovision
[09:47:02]: Setting 

Provisioning Profile type to 'app-store'

Source: (StackOverflow)

fastlane: Deploy to local iOS device

I am using fastlane to manage provisioning profiles, push builds to TestFlight etc. but now I was wondering if it is possible to deploy on my local (USB) iOS device by any fastlane command or pipeline?

Especially deploying a React Native app to the local device via fastlane would be awesome?


Source: (StackOverflow)