# Existing XCUITest cases and Appium

**URL:** <https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911>\
**Category:** Support\
**Created:** [September 26, 2017, 9:11pm UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911 "2017-09-26T21:11:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhaskar\_Raj](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@Bhaskar\_Raj](https://discuss.appium.io/u/Bhaskar_Raj)\
**Post date:** [September 26, 2017, 9:11pm UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911/1 "2017-09-26T21:11:03Z")

</div>

I have a number of XCUITest cases written for my app, both in Objective-C and Swift. I want to reuse these for UI Automation with Appium, meaning I don’t want to write those using Appium, but I want Appium to run those. Can I even do that? (Sorry, I did not see any tutorial etc around.)

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Akula](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh_akula/32/7260_2.png) [@Venkatesh\_Akula](https://discuss.appium.io/u/Venkatesh_Akula)\
**Post date:** [September 27, 2017, 11:17am UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911/2 "2017-09-27T11:17:52Z")

</div>

> [@Bhaskar\_Raj](#):
>
> XCUITest

Appium v1.7.0 uses XCUITest only, so you can reuse your cases.

[https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md](https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md)

Use this in your Desired Capability:

automationName: ‘XCUITest’

---

<div class="post-metadata">

**Author:** ![Bhaskar\_Raj](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@Bhaskar\_Raj](https://discuss.appium.io/u/Bhaskar_Raj)\
**Post date:** [September 27, 2017, 6:48pm UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911/3 "2017-09-27T18:48:46Z")

</div>

Thanks, I guessed that part, but it’s still unclear to as to how to do that. Is there any link/tutorial that you can point to?

(Basically, I have created a separate target and scheme to run my XCUI test cases, written mostly in Swift and some in Objective-C). In general, I can run them using command line in the following manner-

I first create the xctestrun using the xcodebuild command and the build-for-testing option.

```
xcodebuild -project /Users/braj/ios_proj/ios.xcodeproj -scheme ui-tests build-for-testing \
-destination "platform=iOS Simulator,name=iPhone 6 Plus,OS=10.3.1" \
-derivedDataPath /Users/braj/ios_proj/DevDerivedData | xcpretty; (exit ${PIPESTATUS[0]})

```

I then call the same command, but with the test-without-build option to run the UI tests from command line-

```
xcodebuild test-without-building -xctestrun /Users/braj/ios_proj/i/DevDerivedData/Build/Products/ui-tests_iphonesimulator10.3-x86_64.xctestrun -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.3.1'

```

How do I replicate these using Appium? Sorry, I found a lot of tutorials explaining setting up Appium and stuff, but have not really found one useful tutorial explaining the scenario I need.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Venkatesh\_Akula](https://discuss.appium.io/user_avatar/discuss.appium.io/venkatesh_akula/32/7260_2.png) [@Venkatesh\_Akula](https://discuss.appium.io/u/Venkatesh_Akula)\
**Post date:** [September 27, 2017, 6:52pm UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911/4 "2017-09-27T18:52:12Z")

</div>

Sorry I’m not sure about this.

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [September 27, 2017, 7:44pm UTC](https://discuss.appium.io/t/existing-xcuitest-cases-and-appium/18911/5 "2017-09-27T19:44:00Z")

</div>

@Bhaskar_Raj you can not use same with Appium. you need build your client for simulator and get “\*.app” file. which you can use with appium tests. then you choose any language (better Java as most supported) and starting your Java project.

check examples - [https://github.com/appium/sample-code/tree/master/sample-code/examples](https://github.com/appium/sample-code/tree/master/sample-code/examples)
