fastlane-old / gym

Building your iOS apps has never been easier
https://fastlane.tools
645 stars 54 forks source link

gym builds for App Store distribution by default, not development? #227

Closed cbowns closed 8 years ago

cbowns commented 8 years ago

Sometime in the last few days (and I'm still trying to narrow it down), my fastlane lane for an ad-hoc build to Crashlytics is outputting apps built for App Store distribution.

screen shot 2016-02-25 at 4 29 26 pm

I'm aware of the export_options flags for gym, but I've never had to use them, and have several lanes whose ad-hoc distributions were as simple as:

  lane :crashlytics do |options|
    # Fetch the latest ad-hoc profile:
    match(type: "adhoc") # more information: https://codesigning.guide

    # use the UDID of the newly created provisioning profile
    ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]

    # bump the build number.
    increment_build_number

    # commit the build number bump.
    commit_and_push_build_version_bump(options)

    # build the app.
    gym(
      scheme: "BOLD",
      use_legacy_build_api: true
    )

    crashlytics(…)
  end

Just now, I did a standalone invocation of gym and it produces the same thing: the exported app bundle is signed for App Store distribution. What changed? What happened? (I've tried rolling back my Gemfile.lock and bundle execing an older version of gym, but to no avail.)

vpolouchkine commented 8 years ago

Just to confirm, does it work if you pass "ad-hoc" in export_options?

cbowns commented 8 years ago

It doesn't seem to, unless I got this flag wrong:

# gym --scheme BOLD -j "ad-hoc" --verbose --use_legacy_build_api
…
+----------------------+----------------------+
|            Summary for gym 1.6.1            |
+----------------------+----------------------+
| workspace            | ./BOLD.xcworkspace   |
| scheme               | BOLD                 |
| clean                | true                 |
| output_directory     | ./fastlane/builds    |
| output_name          | BOLD                 |
| silent               | false                |
| use_legacy_build_api | true                 |
| export_method        | ad-hoc               |
| buildlog_path        | ~/Library/Logs/gym   |
| sdk                  | iphoneos             |
| destination          | generic/platform=iOS |
+----------------------+----------------------+
…

The .ipa is still signed for the store:

screen shot 2016-02-26 at 10 29 34 am

(or from codesign:

# unzip gym-with-options.ipa

# codesign -d -vvv Payload/BOLD.app/                                                                                                                                                

Executable=/Users/cbowns/Desktop/test-builds/Payload/BOLD.app/BOLD
Identifier=org.nationalcrittenton.BOLD
Format=bundle with Mach-O universal (armv7 arm64)
CodeDirectory v=20200 size=93651 flags=0x0(none) hashes=4673+5 location=embedded
Hash type=sha1 size=20
CDHash=83d730e529eaf2c273e5c086d84a192e7e8afea3
Signature size=4408
Authority=iPhone Distribution: The National Florence Crittenton Mission (6USR9TK7AT)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Feb 26, 2016, 10:25:15 AM
Info.plist entries=32
TeamIdentifier=6USR9TK7AT
Sealed Resources version=2 rules=12 files=159
Internal requirements count=1 size=220
vpolouchkine commented 8 years ago

What happens if you run this lane?

  lane :foo do
    match(type: "adhoc")
    gym(export_method: "ad-hoc")
  end
cbowns commented 8 years ago

Weirdly, I still get an App Store build. And when I produce a build in the same lane in another project (I have my Fastfiles very nearly in sync), I get an ad-hoc build under all of the above cases.

What other parts of the gym/fastlane toolchain might be affecting this?

vpolouchkine commented 8 years ago

What happens if you just build it from Xcode or xcodebuild?

cbowns commented 8 years ago

Hmm, I think I still get a distribution-signed build from Xcode's Archive action.

screen shot 2016-02-29 at 10 28 50 am

I'm comparing this to another project, one sec.

cbowns commented 8 years ago

Yeah, this must be in the project somewhere. My other project builds for Development by default.

screen shot 2016-02-29 at 10 32 48 am

cbowns commented 8 years ago

I think this is #231

fastlanebot commented 8 years ago

This issue was migrated to https://github.com/fastlane/fastlane/issues/3135. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket: