Building and deploying iOS app for Appium tests (CI)

Hi there,

My regular Appium testing pattern is: build the app to the real device via Xcode and run tests. In this case all works good, no probs. But…

Now I want to move the build process to Jenkins and run tests on CI server. What I have now: Jenkins is building the app and I’m able to deploy it to device but I got “No access to debug” while running tests. I know that it’s because of code signing and provisioning profile but I can’t figure out what I’m doing wrong.

What certiciate and provisioning profile I should use? Currently I’m using “iPhone Developer” cert and Ad Hod provisioning profile. I tried Company Development prov. profile witn no luck.

Please share your thoughts/solutions/success stories if you’re able to build your app with tools like xcodebuild, deploy via command line tools like fruitstrap or ios-deploy and get tests work.

Thanks!

1 Like

It should be an enterprise distribution version and should be signed as a debug .ipa.

you can do this in you xcode. “change the version from release to debug”

It should work!

Thanks for the reply. I was building in debug of course and finally could find a solution. It might be kinda dump, but it works :slight_smile:

  1. My Code singing setting in Xcode (Build settings): http://note.io/1abBm8S

  2. Set Archive to Debug in scheme settings (Manage schemes): http://note.io/1abC4mw (nut sure if this step is necessary)

  3. Navigate to your project path and archive the project with xcodebuild (sorry, I work with workspace):
    xcodebuild -sdk iphoneos -scheme {SCHEME_NAME} -workspace {WORKSPACE_NAME} clean archive -archivePath build/{ARCHIVE_NAME}

  4. Create *.ipa from created archive:
    xcodebuild -exportArchive -exportFormat ipa -archivePath "build/{ARCHIVE_NAME}.xcarchive" -exportPath "/Users/{YOUR_USERNAME}/Desktop/{IPA_FILE_NAME}.ipa" -exportProvisioningProfile "{DEVELOP_PROVISIONING_PROFILE}"

  5. Deploy to device with any tool you use (fruitstrap in my case):
    /usr/local/lib/node_modules/fruitstrap/fruitstrap install --id {DEVICE_UDID} --bundle /Users/{YOUR_USERNAME}/Desktop/{IPA_FILE_NAME}.ipa

Thats great!. Now i have a doubt here, basically when we try to install a .ipa via appium. It throws “fruitstrap error”/

Is their anyway to deploy builds parallel in four devices,using command line or something,without intervening appium

Yes -> https://github.com/libimobiledevice/ideviceinstaller