# Instruments without delay questions - appium tests slow

**URL:** <https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465>\
**Category:** Support\
**Created:** [April 2, 2016, 2:03am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465 "2016-04-02T02:03:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 2, 2016, 2:03am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/1 "2016-04-02T02:03:53Z")

</div>

I am using xcode 7.3, Appium 1.5.0. When I launch appium from the command line and attempt to run my maven test Project (whether on Simulator or real device) here is what I see  
[debug] [Instruments] Attempting to launch instruments, this is try #1  
[Instruments] Launching instruments  
[debug] [Instruments] Attempting to run app on iPhone 6s Plus (9.3) [  
[Instruments] On xcode 7.0+, instruments-without-delay does not work, skipping instruments-without-delay  
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node\_modules/appium/node\_modules/appium-instruments/thirdparty/iwd7

Does this mean that my IWD is getting launched automatically every time I run a test (on Simulator or real device). I am assuming that for me its working by defaul? Or is it not?

Thanks.

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 4, 2016, 7:29pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/2 "2016-04-04T19:29:03Z")

</div>

@wreed, @afwang, @SergeyTichomirov, @RamS

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [April 4, 2016, 9:02pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/3 "2016-04-04T21:02:42Z")

</div>

I have not tried running 1.5 at all yet. I’m a committed late adopter.

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 7, 2016, 4:45pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/4 "2016-04-07T16:45:34Z")

</div>

@SrinivasanSekar can you see my comments here and then respond ?  
For Appium versions prior to 1.5.0 we may have had to do all this setup/execution to get IWD working. But I think that for Appium 1.5.0 or greater…Appium takes care of this automatically…based on my logs?  
Please let me know if that is correct or not.

Thanks.

---

<div class="post-metadata">

**Author:** ![Christopher\_Graham](https://discuss.appium.io/user_avatar/discuss.appium.io/christopher_graham/32/440_2.png) [@Christopher\_Graham](https://discuss.appium.io/u/Christopher_Graham)\
**Post date:** [April 7, 2016, 5:42pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/5 "2016-04-07T17:42:06Z")

</div>

From my experience you’ll know if Instruments is still imposing the forced 1 second delay as every… single… comand… will… have… a… 1… second… Well, you get the picture. 🙂 I had a small test suite that took 104 minutes to run, then only 44 minutes after patching with iwd.

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 7, 2016, 6:06pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/6 "2016-04-07T18:06:43Z")

</div>

Thanks @Christopher_Graham. Is that for a real device or a Simulator? Also what version of Appium are you on ?

In any case am from the link you pasted I started from Step 2…I did not do anything about Step 1 since I already have that folder in my Mac machine. That should suffice, right?

fyi…I’m currently on Appium 1.5.1, Xcode 7.3, iPhone simulator 6s Plus

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 7, 2016, 11:22pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/7 "2016-04-07T23:22:21Z")

</div>

@Aleksei @moizjv @alangithubtrader @rompic

Thought you may be able to help ? Thanks!

---

<div class="post-metadata">

**Author:** ![alangithubtrader](https://discuss.appium.io/user_avatar/discuss.appium.io/alangithubtrader/32/1135_2.png) [@alangithubtrader](https://discuss.appium.io/u/alangithubtrader)\
**Post date:** [April 7, 2016, 11:57pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/8 "2016-04-07T23:57:53Z")

</div>

> [@Xcode 6 + iOS 7.1 sim slowness?](https://discuss.appium.io/t/xcode-6-ios-7-1-sim-slowness/1242/9):
>
> Folks, looks like there’s an active pull request for the fix for this, but fb is disowning instruments-without-delay and recommending that someone just forks the project. I have tried the fix and it works, but it’s a bit hairy since new permissions issues in Xcode 7 require some plist editing to work. Source: I took notes of my steps to implement it the fix: cd ~ git clone https://github.com/lawrencelomax/instruments-without-delay.git cd instruments-without-delay/ git checkout xcode7-qui…

did you try following this post?

I am not using appium 1.5 yet and I am still on xcode 7.2.1. But I think it’s safe to assume that iwd is still not integrated with 1.5.0 if I were to guess.

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 8, 2016, 1:02am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/9 "2016-04-08T01:02:57Z")

</div>

thanks @alangithubtrader

If that is the case then why am I getting this in the logs when I launch Appium?  
[Instruments] On xcode 7.0+, instruments-without-delay does not work, skipping instruments-without-delay  
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node\_modules/appium/node\_modules/appium-instruments/thirdparty/iwd7

---

<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:** [April 8, 2016, 5:47am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/10 "2016-04-08T05:47:10Z")

</div>

we have:

- appium 1.5.1
- xCode 7.3
- maven tests
- CI with Jenkins where tests are starting

and this solves speed problem with Simulator: [https://github.com/appium/appium/blob/9dcc6459da668ab5c2d0dfed9d89a08a4ab4db58/docs/en/advanced-concepts/iwd\_xcode7.md](https://github.com/appium/appium/blob/9dcc6459da668ab5c2d0dfed9d89a08a4ab4db58/docs/en/advanced-concepts/iwd_xcode7.md)

---

<div class="post-metadata">

**Author:** ![Christopher\_Graham](https://discuss.appium.io/user_avatar/discuss.appium.io/christopher_graham/32/440_2.png) [@Christopher\_Graham](https://discuss.appium.io/u/Christopher_Graham)\
**Post date:** [April 8, 2016, 1:46pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/11 "2016-04-08T13:46:28Z")

</div>

I’m currently using Xcode 7.2.1 Appium 1.5.1 here are the instructions I whipped up for my team, let me know if they help you. Note we have npm installed in our user directory to negate need for sudo.

```
Fix Instruments 1 Second Delay (negatively affects iOS simulator test speed):

1. Uninstall old version of appium-instruments with:

npm uninstall appium-instruments (use sudo if you happened to install it with sudo previously)

2. Install the latest version of appium-instruments with:

npm install appium-instruments (should not require sudo)

3. Install worked correctly if no errors were logged, and you have a folder ~/node_modules/appium-instruments/bin with xcode-iwd.sh in it.

4. Change to your appium-instruments directory, not your appium directory.

5. Run script per instructions here: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd_xcode7.md

My script was: sh ./bin/xcode-iwd.sh /Applications/Xcode.app /Users/your_username/node_modules/appium-instruments/

6. To verify your .plist was updated, run the following command in terminal:

/usr/libexec/PlistBuddy -c print /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Developer/Library/LaunchDaemons/com.apple.instruments.deviceservice.plist

It should include the following lines pointing to your appium-instruments directory, not your appium directory. These are what negate the 1 second instruments command delay. Make sure the path:

      EnvironmentVariables = Dict {
        LIB_PATH = /Users/your_username/node_modules/appium-instruments//thirdparty/iwd7/
        DYLD_INSERT_LIBRARIES = /Users/your_username/node_modules/appium-instruments//thirdparty/iwd7/DTMobileISShim.dylib
    }
```

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 8, 2016, 6:27pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/12 "2016-04-08T18:27:53Z")

</div>

@Aleksei @Christopher_Graham I get all that I guess the gist of all that is that I have to run that shell command:  
eg. sh ./bin/xcode\_iwd.sh /Applications/Xcode.app /Users/xyz/appium-instruments/

However I am not sure why my point keeps getting lost in translation…maybe because I am not emphasizing it clearly =). What I was saying that even without doing all that if I just run appium this is what I see in the Appium log:  
[Instruments] On xcode 7.0+, instruments-without-delay does not work, skipping instruments-without-delay  
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node\_modules/appium/node\_modules/appium-instruments/thirdparty/iwd7

So does that mean that with Appium 1.5.1 we are getting to run fwd by default? without having to run that shell script command?

---

<div class="post-metadata">

**Author:** ![Christopher\_Graham](https://discuss.appium.io/user_avatar/discuss.appium.io/christopher_graham/32/440_2.png) [@Christopher\_Graham](https://discuss.appium.io/u/Christopher_Graham)\
**Post date:** [April 8, 2016, 6:45pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/13 "2016-04-08T18:45:44Z")

</div>

I see the same, and even after running the iwd script my logs look like yours.

```
[Instruments] On xcode 7.0+, instruments-without-delay does not work, skipping instruments-without-delay
[debug] [Instruments] Found Insruments-Without-Delay: /Users/chrigrah/npm/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-instruments/thirdparty/iwd7

```

However, until you run the iwd script and see the correct paths in your .plist like I’ve described you should observe your tests have a forced 1 second delay between every command. At least I did, even when seeing those lines in my Appium logs.

Run the script and successfully add the correct paths to your .plist, you’ll STILL see the exact same Appium logging (with the old Appium paths to .iwd) but your tests will run much faster since there’s no 1 second forced delay.

---

<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:** [April 8, 2016, 6:48pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/14 "2016-04-08T18:48:59Z")

</div>

> [@Styris](#):
>
> sh ./bin/xcode\_iwd.sh /Applications/Xcode.app /Users/xyz/appium-instruments/

it is not correct! there is a bug in doc 🙂  
correct should be like: sh ./bin/xcode-iwd.sh /Applications/Xcode.app /Users/xyz/appium-instruments/

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 8, 2016, 7:38pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/15 "2016-04-08T19:38:41Z")

</div>

Thanks @Christopher_Graham I will try it out and see where I get with it

Thanks @Aleksei. Great catch and I noticed that too. If I am running with a CI tool though…would I need to give that command in the execute section? just so that it is run before the actual command to launch appium/run maven test ?

---

<div class="post-metadata">

**Author:** ![Christopher\_Graham](https://discuss.appium.io/user_avatar/discuss.appium.io/christopher_graham/32/440_2.png) [@Christopher\_Graham](https://discuss.appium.io/u/Christopher_Graham)\
**Post date:** [April 8, 2016, 7:39pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/16 "2016-04-08T19:39:21Z")

</div>

The original instructions here: [https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd\_xcode7.md](https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd_xcode7.md) as well as the instructions I provided are correct. Looks like @Styris made a typo in his comment. Copy-and-paste is your friend. 🙂

---

<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:** [April 8, 2016, 7:54pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/17 "2016-04-08T19:54:57Z")

</div>

> [@Styris](#):
>
> If I am running with a CI tool though…would I need to give that command in the execute section?

only once and reboot machine. after xCode update repeat the same again.

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 8, 2016, 9:00pm UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/18 "2016-04-08T21:00:40Z")

</div>

@Aleksei  
Yeah…but I think with Travis-CI you have to do it every time?

---

<div class="post-metadata">

**Author:** ![Styris](https://discuss.appium.io/user_avatar/discuss.appium.io/styris/32/5458_2.png) [@Styris](https://discuss.appium.io/u/Styris)\
**Post date:** [April 9, 2016, 2:49am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/19 "2016-04-09T02:49:23Z")

</div>

@Christopher_Graham @Aleksei I tried your steps (already had 1-2 prior to that). In step 4 I did a cd to the appium-instruments/bin folder. After that I typed this command:  
sh ./xcode-iwd.sh /Applications/Xcode.app /Users/xyz/appium-instruments/  
Then I ran the plist command you posted  
I got this as output:  
Dict {  
JetsamProperties = Dict {  
JetsamMemoryLimit = 0  
}  
Program = /Developer/Library/PrivateFrameworks/DVTInstrumentsFoundation.framework/DTServiceHub  
Label = com.apple.instruments.deviceservice  
POSIXSpawnType = Adaptive  
MachServices = Dict {  
com.apple.instruments.deviceservice.xpc = true  
com.apple.instruments.deviceservice.lockdown = true  
}  
EnableTransactions = true  
}

I guess something is amiss? (Fyi my file is at: /usr/local/lib/node\_modules/appium/node\_modules/appium-ios-driver/node\_modules/appium-instruments/bin/xcode-iwd.sh)

---

<div class="post-metadata">

**Author:** ![Christopher\_Graham](https://discuss.appium.io/user_avatar/discuss.appium.io/christopher_graham/32/440_2.png) [@Christopher\_Graham](https://discuss.appium.io/u/Christopher_Graham)\
**Post date:** [April 9, 2016, 3:10am UTC](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465/20 "2016-04-09T03:10:14Z")

</div>

Latest version of appium-instruments doesn’t install into the appium directory, that’s where the old version installed. For you, based on your current paths, the new version should install into /usr/local/lib/node\_modules/appium-instruments

That’s why I included the uninstall and fresh install as step 1 and step 2, those were the key to success for me.

I believe the old version in the appium subdirectory are for older versions of Xcode. At least I was stuck with the delay until working through all of the steps as I described and getting the .plist updated with the latest paths.

[Next page](https://discuss.appium.io/t/instruments-without-delay-questions-appium-tests-slow/9465.md?page=2)
