fastlane: [pilot] Uploading an IPA to TestFlight fails under Linux
🔑
New Issue Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
Issue Description
When running fastlane on Gitlab-CI on a Linux Host (I think any Linux host will have the same issue), fastlane fails to upload an IPA to the iTunes store.
Command executed
$ fastlane pilot upload --username "$FASTLANE_APPLE_LOGIN" --ipa "myapp.ipa"
Complete output when running fastlane, including the stack trace and command used
[11:58:48]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile [11:58:48]: Sending anonymous analytics information [11:58:48]: Learn more at https://docs.fastlane.tools/#metrics [11:58:48]: No personal or sensitive data is sent. [11:58:48]: You can disable this by adding `opt_out_usage` at the top of your Fastfile [11:58:48]: Login to App Store Connect (****@example.com) [11:58:52]: Login successful [11:58:52]: Ready to upload new build to TestFlight (App: ******)... [11:58:53]: Going to upload updated app to App Store Connect [11:58:53]: This might take a few minutes. Please don't interrupt the script.[11:58:53]: Error accessing file, this might be due to fastlane’s directory handling [11:58:53]: Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details
/usr/local/lib/ruby/2.6.0/fileutils.rb:128:in
chdir': No such file or directory @ dir_chdir - (Errno::ENOENT) from /usr/local/lib/ruby/2.6.0/fileutils.rb:128:in
cd’ from /usr/local/bundle/gems/fastlane-2.116.0/fastlane_core/lib/fastlane_core/itunes_transporter.rb:293:inexecute' from /usr/local/bundle/gems/fastlane-2.116.0/fastlane_core/lib/fastlane_core/itunes_transporter.rb:387:in
upload’ from /usr/local/bundle/gems/fastlane-2.116.0/pilot/lib/pilot/build_manager.rb:38:inupload' from /usr/local/bundle/gems/fastlane-2.116.0/pilot/lib/pilot/commands_generator.rb:66:in
block (2 levels) in run’ from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:incall' from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in
run’ from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:inrun_active_command' from /usr/local/bundle/gems/fastlane-2.116.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in
run!’ from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:inrun!' from /usr/local/bundle/gems/fastlane-2.116.0/pilot/lib/pilot/commands_generator.rb:166:in
run’ from /usr/local/bundle/gems/fastlane-2.116.0/pilot/lib/pilot/commands_generator.rb:18:instart' from /usr/local/bundle/gems/fastlane-2.116.0/fastlane/lib/fastlane/cli_tools_distributor.rb:105:in
take_off’ from /usr/local/bundle/gems/fastlane-2.116.0/bin/fastlane:23:in<top (required)>' from /usr/local/bundle/bin/fastlane:23:in
load’ from /usr/local/bundle/bin/fastlane:23:in `<main>’
Environment
Running under Gitlab-ci with the lastest ruby image.
Here is the relevant .gitlab-ci.yml
section:
testflight:
stage: deploy
image: ruby:latest
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
before_script:
- gem install fastlane -NV
script:
- fastlane pilot upload --username "$FASTLANE_APPLE_LOGIN" --ipa "app.ipa"
(app.ipa is an artifact provided by a previous stage, it is present as confirmed by running ls -la
before).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 29 (10 by maintainers)
Thanks to all the directions in this and other issues, I managed to upload a .ipa using this dockerfile: https://github.com/ineentho/fastlane-docker/blob/master/Dockerfile
And then running it using
This issue will be auto-closed because there hasn’t been any activity for a few months. Feel free to open a new one if you still experience this problem 👍
The latest fastlane build does not fix this issue. Please do not close this issue 🙏
Yup, generating the
AppStoreInfo.plist
file on the external CI could be an other solution. In that case, we need to be able to pass it to FastLane, and FastLane should pass it to iTMStransporter. This requires the addition of another option to thedeliver
andpilot
commands.I tried @ineentho 's image and -to my surprise- it worked and managed to deliver the app to TestFlight! Looks like using the Windows Installer instead of the OSX bundle does the trick. I added a few suggestions here.
Using the
FASTLANE_ITUNES_TRANSPORTER_PATH
enables us to tell fastlane where itms is, andFASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT
tells fastlane to use the shell script instead of trying to call the transporter directly. I think fastlane should use the script in all cases (even on OSX), which would simplify the code and make it crossplatform. Also, clarifiying the error messages if itms cannot be found on Windows and Linux could make it easier to use Fastlane to deliver apps on these platforms.Anyway, we got it to work! 🎉