Integrate with https://appetize.io/

Note: the Appetize.io deploy step was published into the step lib, so you can add it from there - just search for Appetize.io deploy in the step lib / step list.

The step only works for android. iOS transfer succeeds but the app itself fails to launch on Appetize.
Reason being Appetize expects zipped Simulator build instead of device build.

Whereas manual upload of simulator build works without any issues

@mxpbitrise To create a ZIP of a iOS simulator build / .app you can use this Script:

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

# generate the `.app` into a specified "derived data" dir (xcodebuild does not allow specifying the exact .app path, only a "working dir" called derived data, it'll generate the build files into this directory, including the built `.app`)
xcodebuild build -project ./ios-xcode-8.0.xcodeproj -scheme ios-xcode-8.0 -configuration Debug -sdk iphonesimulator11.2 -derivedDataPath ./ddata

# change dir into the derived data dir -> Build -> Products -> Debug-iphonesimulator
# the .app is generated into this with the above configs (-configuration Debug -sdk iphonesimulatorX.Y -derivedDataPath ./ddata)
cd ./ddata/Build/Products/Debug-iphonesimulator/

# now zip it up!
zip -r ios-xcode-8.0.app.zip ios-xcode-8.0.app

# finally, move it into e.g. the bitrise deploy dir
mv ios-xcode-8.0.app.zip "$BITRISE_DEPLOY_DIR/ios-xcode-8.0.app.zip"

This will create a ios-xcode-8.0.app.zip zipped .app file into the bitrise deploy dir, so it can be accessed by any subsequent step at the path $BITRISE_DEPLOY_DIR/ios-xcode-8.0.app.zip

Note: this example used https://github.com/bitrise-samples/ios-xcode-8.0 - change the params according to your own project.

If youā€™d have any questions just let us know! :slight_smile:

There is a Fastlane Action for that : https://docs.fastlane.tools/actions/appetize/
Iā€™m thinking to deprecate the step given that there is the Fastlane alternative now

In addition to what @viktorbenei provided, here is a lane that I used on Fastlane to handle all of this (including sending a message on JIRA) : https://gist.github.com/dagio/6d12b4c075b52f15823fdb96a2b73373

1 Like

This script can only be used to build xcode based projects. It doesnā€™t apply to Xamarin cross-platform projects.

I would not recommend deprecating the step. Somehow, if we manage to create simulator builds for xamarin projects using script approach, this step can be still prove to be handy. (And, of course, for other projects that havenā€™t adopted fastlane yet)

1 Like

Comment from RolfBjarneKvinge in following discussion seems promising:
mdtool command line build for xamarin

Creating simulator builds using mdtool seems possible.
@viktorbenei, do you think we can incorporate it into script?

@mxpbitrise I might be wrong, but isnā€™t mdtool deprecated now?

Did you try to do an iPhone Simulator build with the Xamarin Archive step @mxpbitrise? That should generate an appropriate .app I think.

Hi guys, I have just tried to integrate Appetize with our Android and iOS apps. While Android was working without any issues, I tried fixing the issues on iOS with the tips from this thread. But itā€™s not working, neither on the Bitrise CI nor when I run it locally on my Mac (thatā€™s what the support asked me to do).

Hereā€™s the CI output:

[Exception]
  Invalid file provided "/var/folders/2l/3tqwt0g91x18hql0jwsz0y280000gn/T/deploy149227386/MyApp.app.zip"

Funny thing is, when I upload the exact same .app.zip file manually through the Appetize web interface, itā€™s all working just fine. Also note that the error message is coming right away, so I doubt itā€™s trying any uploading.

Here are my two steps from the workflow:

    - script:
        title: Prepare .app.zip for Appetize
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -ex

            # generate the `.app` into a specified "derived data" dir
            xcodebuild build -project ./$BITRISE_PROJECT_PATH -scheme $BITRISE_SCHEME -configuration Debug -sdk iphonesimulator11.2 -derivedDataPath ./ddata

            # change dir into the derived data dir -> Build -> Products -> Debug-iphonesimulator
            # the .app is generated into this with the above configs (-configuration Debug -sdk iphonesimulatorX.Y -derivedDataPath ./ddata)
            cd ./ddata/Build/Products/Debug-iphonesimulator/

            # now zip it up!
            zip -r $BITRISE_SCHEME.app.zip $BITRISE_SCHEME.app

            # finally, move it into e.g. the bitrise deploy dir
            mv $BITRISE_SCHEME.app.zip "$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.app.zip"
    - appetize-deploy:
        run_if: "true"
        inputs:
        - appetize_token: tok_abcdefghijklmnopqrstuvw1234567890
        - app_path: $BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.app.zip

Do you have any ideas why itā€™s failing?

@jamitlabs this seems to be an issue in the Step. Iā€™d suggest you to report it on the stepā€™s issue tracker, as this step is not developed or maintained by us. You can find the support/issue tracker URL in the build log, in the footer of the stepā€™s log, in this case itā€™s: GitHub - bitrise-io/appetize-deploy-step

Please let us know if youā€™d have any questions! :slight_smile:

Thanks for the info. Since the step doesnā€™t seem to work, I have switched to the Fastlane method, which now works correctly. Hereā€™s the full step that you can copy and paste to your bitrise.yml file:

    - script:
        title: Deploy to Appetize.io
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -ex

            # generate the `.app` into a specified "derived data" dir
            xcodebuild build -project ./$BITRISE_PROJECT_PATH -scheme $BITRISE_SCHEME -configuration Debug -sdk iphonesimulator11.2 -derivedDataPath ./ddata

            # change dir into the derived data dir -> Build -> Products -> Debug-iphonesimulator
            # the .app is generated into this with the above configs (-configuration Debug -sdk iphonesimulatorX.Y -derivedDataPath ./ddata)
            cd ./ddata/Build/Products/Debug-iphonesimulator/

            # now zip it up!
            zip -r $BITRISE_SCHEME.app.zip $BITRISE_SCHEME.app

            # finally, move it into e.g. the bitrise deploy dir
            mv $BITRISE_SCHEME.app.zip "$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.app.zip"

            # deploy to Appetize.io using fastlane tools
            fastlane run appetize path:$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.app.zip platform:ios api_token:$APPETIZE_API_TOKEN public_key:$APPETIZE_PUBLIC_KEY

Note that on first push, you might want to remove the public_key:$APPETIZE_PUBLIC_KEY at the very end of the step since you might not have a public_key yet. But to not create a new app on Appetize with every subsequent build, you should set public_key after first successful deployment to Appetize.io.

1 Like

Thanks for sharing @jamitlabs!

Just a note: we did take over of the maintenance of the steps created by @dag-io and weā€™ll try to schedule some time to update them in the upcoming weeks.

I have just tried this step and you were right, it doesnā€™t work with a zip. But if you use .app it works like charm. It is a little confusing because the Appetize.io ask for a .zip or a .tar.gz on the webpage. But for this step, you donā€™t need to compress the .app bundle.

1 Like