How can I export .app file

How to exprot .app file for for generated build. tried to insert $BITRISE_APP_DIR_PATH on Mailgun’s File attachments variable. Facing this issue : Failed to create request, error: &os.PathError{Op:“read”, Path:"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__archive__752518725/xyz.xcarchive/Products/Applications/xyz.app", Err:0x15}

Which step do you use to generate the .app? Is it a macOS app, or an iOS app?

Xcode Archive for iOS generates it.
want to generate iOS app

Why do you want to access the .app of the iOS app? iOS apps are usually distributed in a .ipa format.

For our inhouse automation process cycle, we need app file as it is input for ios-deploy library.

Makes sense - so, the issue is that the .app is actually a directory, not a file. It’s just presented as a file in macOS Finder, but e.g. if you check it on Windows or Linux you’ll see that .app is a directory (true for macOS apps too).

So, in order to be able to attach it to an email, you have to ZIP it (or tar, or compress it in any way) and attach the compressed file to the email.

will this work -->ZIP resource archive downloader from bitrise?

Unfortunately no, that step can only download zips, it can’t create one.

I think the best way right now is to use a Script step, and just zip it yourself.

I guess this would be a good idea for a new Step :thinking:

Created a contrib ticket https://github.com/bitrise-io/bitrise-contrib/issues/31 :wink:

Thanks … :slight_smile:

1 Like

One note for doing zip in a Script step : you should cd into the parent directory first, and only provide the directory name as an input for zip, or else the zip file will include the while directory structure from root (/)

okay…noted.

This guide seems fairly up to date and brief https://coolestguidesontheplanet.com/how-to-compress-and-uncompress-files-and-folders-in-os-x-lion-10-7-using-terminal/

@viktorbenei @zebpayraviparmar Any workflow available in bitrise to get .app ?

@appsjoynworld if you want to build for the Simulator then something like this should do the trick:

#!/usr/bin/env bash
set -ex

xcodebuild "-workspace" "$BITRISE_SOURCE_DIR/$BITRISE_PROJECT_PATH" "-scheme" "$BITRISE_SCHEME" "-configuration" "$CONFIGURATION" "CODE_SIGN_IDENTITY=" "build" "-destination" "$SIMULATOR_IDENTITY" "PROVISIONING_PROFILE_SPECIFIER=" -derivedDataPath $BITRISE_SOURCE_DIR/ddata

The .app dir should be at:

$BITRISE_SOURCE_DIR/ddata/Build/Products/Debug-iphonesimulator/$BITRISE_SCHEME.app

Of course exact location might depend on your project config, but you can run this command locally on your Mac to check the exact path (inside ddata).

Let me know if you’d need any help with the setup! :wink:

I am unable to find where this .app directory is stored. I remote into my build and I do not see a ddata.

Hey there @joshua.kinney :wave:

You can search for files in the VM via the terminal, by using the find command, as described in this thread: macos - How do I find a file by filename in Mac OSX terminal? - Super User :slight_smile: