# Starting Appium server programmatically on MAC

**URL:** <https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615>\
**Category:** Support\
**Created:** [November 23, 2014, 11:31am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615 "2014-11-23T11:31:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![joybetsy](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/3be4f8/32.png) [@joybetsy](https://discuss.appium.io/u/joybetsy)\
**Post date:** [November 23, 2014, 11:31am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/1 "2014-11-23T11:31:40Z")

</div>

Using the below string for Windows.

cmd /c “C:/Program Files (x86)/Appium/node.exe” “C:/Program Files (x86)/Appium/node\_modules/appium/bin/Appium.js” --address 127.0.0.1 --chromedriver-port 9516 --bootstrap-port 4725 --selendroid-port 8082 --no-reset --local-timezone

> [@Launching and stopping appium server programmtically](https://discuss.appium.io/t/launching-and-stopping-appium-server-programmtically/700):
>
> Hi, Is there a way to launch/stop the appium server programmatically? Also is there way where can capture all the logs of appium server in a log file? Thanks and regards, M.Karthik

Can anyone let me know the equivalent for Mac?

---

<div class="post-metadata">

**Author:** ![joybetsy](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/3be4f8/32.png) [@joybetsy](https://discuss.appium.io/u/joybetsy)\
**Post date:** [November 23, 2014, 12:06pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/2 "2014-11-23T12:06:17Z")

</div>

Got the Solution:-

/Applications/Appium.app/Contents/Resources/node\_modules/appium/bin/appium.js --address 127.0.0.1 --chromedriver-port 9516 --bootstrap-port 4725 --selendroid-port 8082 --no-reset --local-timezone

copy the appium app to Applications folder first

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [November 23, 2014, 12:27pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/3 "2014-11-23T12:27:00Z")

</div>

It should be something like this:

> /bin/sh /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/bin/appium.js --address 127.0.0.1 --chromedriver-port 9516 --bootstrap-port 4725 --no-reset --local-timezone

---

<div class="post-metadata">

**Author:** ![jagadeeshkotha](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@jagadeeshkotha](https://discuss.appium.io/u/jagadeeshkotha)\
**Post date:** [November 24, 2014, 10:22am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/4 "2014-11-24T10:22:33Z")

</div>

Hi,

The best way to launch appium is

create a bash file with “/usr/local/bin/appuim” (ignore quotation) command

name it as Appium.command, Whenever you required to launch the appium call the bash file

Thx

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [November 24, 2014, 10:30am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/5 "2014-11-24T10:30:24Z")

</div>

I think this will launch the Appium UI app… how are you going to automate the process of setting the server configurations??

We are taking about starting the Appium server programmatically with server configurations, not starting the UI app…

---

<div class="post-metadata">

**Author:** ![dgtlife](https://discuss.appium.io/user_avatar/discuss.appium.io/dgtlife/32/5243_2.png) [@dgtlife](https://discuss.appium.io/u/dgtlife)\
**Post date:** [January 3, 2015, 5:38am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/6 "2015-01-03T05:38:09Z")

</div>

On OS X, I just install appium using npm:

```
$ npm install -g appium

```

I have `/usr/local/bin` in my $PATH (if you don’t you will need to add it), so I can then just start appium from the command line and issue any options I need. I leave the window open so that I can see the appium console messages.

```
$ appium --port 4723 --safari

```

Obviously, in this case you are not fiddling with Appium.app and its GUI, but running a ‘different’ appium installed as a node module.

Have fun …

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 19, 2015, 2:09pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/7 "2015-04-19T14:09:47Z")

</div>

Hey Hassan, I tried this and I am getting the following message:  
/Applications/Appium.app/Contents/Resources/node/bin/node: cannot execute binary file.  
Is there something I am missing?  
Thanks!  
Pavel

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [April 19, 2015, 2:46pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/8 "2015-04-19T14:46:10Z")

</div>

Can you please elaborate more?? Did you do this from the command line? or programmatically?? can you provide your code??

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 19, 2015, 3:01pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/9 "2015-04-19T15:01:19Z")

</div>

I haven’t written the code yet. Just tried to run this remotely via SSH:  
open /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/bin/appium.js --args --address 127.0.0.1 --port 4723 --full-reset  
The document “appium.js” could not be opened. iOS Simulator cannot open files in the “JavaScript script” format.

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [April 19, 2015, 4:58pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/10 "2015-04-19T16:58:22Z")

</div>

I tried it on Mac OS 10.9 and it is working correctly as the following screenshot shows:

> Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/bin/appium.js

![](https://discuss.appium.io/uploads/default/907/7cd6ce8f9ef8a06f.PNG)

I am not sure why it is showing _ **“iOS Simulator”** _ in your error message!!! Can you try locally without SSH??

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 20, 2015, 7:32am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/11 "2015-04-20T07:32:09Z")

</div>

Happens the same…  
Perhaps I need to restart or something…  
Thanks for the reply!

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [April 20, 2015, 8:50am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/12 "2015-04-20T08:50:12Z")

</div>

please try to restart and maybe execute it programmatically and see what happens 😄

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 20, 2015, 2:02pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/13 "2015-04-20T14:02:40Z")

</div>

Alright, looks like the Reset indeed helped here. But, I see that I still need to launch it somehow as I am getting: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it  
Is there an additional parameter I need to pass to launch it automatically?  
Thanks!

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 20, 2015, 2:21pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/14 "2015-04-20T14:21:28Z")

</div>

Alright. Found it! Here’s the syntax for future reference:

node /Applications/Appium.app/Contents/Resources/node\_modules/appium/bin/appium.js --address 127.0.0.1 --port 4723 --full-reset  
–device-name “iPhone 6”  
–platform-name iOS  
–platform-version “8.3”  
–app “/My.app”  
–browser-name iOS -l

Cheers, Pavel

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [April 20, 2015, 4:02pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/15 "2015-04-20T16:02:31Z")

</div>

This means that node executable is added to your system variables… Glad it worked 😄

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 21, 2015, 10:59am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/16 "2015-04-21T10:59:27Z")

</div>

Hey, it’s me, bugging again 😄  
After I managed to launch Appium via terminal I am trying to do so programmatically using [SSH.NET](http://SSH.NET) library (my tests being written in .Net)  
This is how I initiate the test:

```
            SshClient ssh = new SshClient(myURL, 22, myUser, myPass);
        string unixCommand = "node /Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js --address 127.0.0.1 --port 4723 --full-reset --device-name \"iPhone 6\" --platform-name iOS --platform-version \"8.3\" --app \"myApp.app\" --browser-name iOS -l --log /Users/QA/Library/Logs/Appium/1.log";
        {
            ssh.Connect();
            ssh.RunCommand(unixCommand);
            ssh.Disconnect();

```

Now for some reason, Appium is initiated successfully with my tested app in the emulator and all. But then, I get stuck in the RunCommand part until the session times out.  
I expect to move on to ssh.Disconnect but I just get stuck there in the initiation.  
Any idea?  
Thanks, Pavel

---

<div class="post-metadata">

**Author:** ![pavelzagalsky](https://discuss.appium.io/user_avatar/discuss.appium.io/pavelzagalsky/32/1220_2.png) [@pavelzagalsky](https://discuss.appium.io/u/pavelzagalsky)\
**Post date:** [April 21, 2015, 12:06pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/17 "2015-04-21T12:06:04Z")

</div>

Here’s what I see when debugging:  
2015-04-21 12:03:32:982 - info: [debug] Starting Appium in pre-launch mode  
2015-04-21 12:03:32:985 - info: Pre-launching app  
2015-04-21 12:03:32:987 - info: [debug] Using local app from command line: /Users/pavelzagalsky/Google Drive/Clarizen/1.1.1.7/Clarizen.app  
2015-04-21 12:03:33:006 - info: [debug] Setting Xcode version  
2015-04-21 12:03:33:062 - info: [debug] Setting iOS SDK Version  
2015-04-21 12:03:33:117 - info: [debug] Getting sdk version from xcrun with a timeout  
2015-04-21 12:03:33:124 - info: [debug] iOS SDK Version set to 8.3  
2015-04-21 12:03:33:124 - info: [debug] Checking whether instruments supports our device string  
2015-04-21 12:03:33:124 - info: [debug] Getting list of devices instruments supports  
2015-04-21 12:03:33:130 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments  
2015-04-21 12:03:33:593 - info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}  
2015-04-21 12:03:33:594 - info: [debug] fixDevice is on  
2015-04-21 12:03:33:594 - info: [debug] Final device string is: ‘iPhone 6 (8.3 Simulator)’  
2015-04-21 12:03:33:594 - info: [debug] iOS sim UDID is 3BC16EF3-1ED3-4658-8363-FF290597CAF4  
2015-04-21 12:03:33:595 - info: [debug] Detecting automation tracetemplate  
2015-04-21 12:03:33:603 - info: [debug] Not auto-detecting udid, running on sim  
2015-04-21 12:03:33:605 - info: [debug] Could not parse plist file (as binary) at /Users/QA/Google Drive/Clarizen/1.1.1.7/Clarizen.app/en.lproj/Localizable.strings  
2015-04-21 12:03:33:605 - info: Will try to parse the plist file as XML  
2015-04-21 12:03:33:605 - info: [debug] Could not parse plist file (as XML) at /Users/QA/Google Drive/Clarizen/1.1.1.7/Clarizen.app/en.lproj/Localizable.strings  
2015-04-21 12:03:33:605 - warn: Could not parse app Localizable.strings assuming it doesn’t exist  
2015-04-21 12:03:33:606 - info: [debug] Getting bundle ID from app  
2015-04-21 12:03:33:609 - info: [debug] Parsed app Info.plist (as binary)  
2015-04-21 12:03:33:610 - info: [debug] Creating instruments  
2015-04-21 12:03:33:611 - info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag  
2015-04-21 12:03:33:612 - info: [debug] Preparing uiauto bootstrap  
2015-04-21 12:03:33:612 - info: [debug] Dynamic bootstrap dir: /Users/pavelzagalsky/Library/Application Support/appium/bootstrap  
2015-04-21 12:03:33:613 - info: [debug] Dynamic env: {“nodePath”:"/usr/local/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments\_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“oneByOne”}  
2015-04-21 12:03:33:629 - info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!  
…  
2015-04-21 12:03:33:629 - info: [debug] Dynamic bootstrap path: /Users/QA/Library/Application Support/appium/bootstrap/bootstrap-20805c3827813407.js  
2015-04-21 12:03:33:633 - info: [debug] Reusing dynamic bootstrap: /Users/QA/Library/Application Support/appium/bootstrap/bootstrap-20805c3827813407.js  
2015-04-21 12:03:33:633 - info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}  
2015-04-21 12:03:33:633 - info: [debug] fixDevice is on  
2015-04-21 12:03:33:634 - info: [debug] Final device string is: ‘iPhone 6 (8.3 Simulator)’  
2015-04-21 12:03:33:635 - info: [debug] We’re on iOS7.1+ so forcing defaultDevice on  
2015-04-21 12:03:33:635 - info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}  
2015-04-21 12:03:33:636 - info: [debug] fixDevice is on  
2015-04-21 12:03:33:636 - info: [debug] Final device string is: ‘iPhone 6 (8.3 Simulator)’  
2015-04-21 12:03:33:638 - info: [debug] Parsed app Info.plist (as binary)  
2015-04-21 12:03:33:643 - info: [debug] Wrote new app Info.plist with device type  
2015-04-21 12:03:33:644 - info: [debug] Checking whether we need to set app preferences  
2015-04-21 12:03:33:644 - info: [debug] Running ios sim reset flow  
2015-04-21 12:03:33:644 - info: [debug] Killing the simulator process  
2015-04-21 12:03:33:645 - info: [debug] Killall iOS Simulator  
2015-04-21 12:03:33:647 - info: [debug] Killing any other simulator daemons  
2015-04-21 12:03:33:724 - info: [debug] Cleaning sim data files  
2015-04-21 12:03:33:727 - info: Executing: xcrun simctl erase 3BC16EF3-1ED3-4658-8363-FF290597CAF4 with timeout 2000  
2015-04-21 12:03:33:946 - info: [debug] Cleaning app data files  
2015-04-21 12:03:33:947 - warn: Applications directory /Users/QA/Library/Developer/CoreSimulator/Devices/3BC16EF3-1ED3-4658-8363-FF290597CAF4/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?  
2015-04-21 12:03:33:947 - warn: Applications directory /Users/pavelzagalsky/Library/Developer/CoreSimulator/Devices/3BC16EF3-1ED3-4658-8363-FF290597CAF4/data/Containers/Bundle/Application doesn’t exist. Have you run this simulator before?  
2015-04-21 12:03:33:947 - info: Couldn’t find app directories to delete. Probably it’s not installed  
2015-04-21 12:03:33:948 - info: [debug] Not setting locale  
2015-04-21 12:03:33:948 - info: [debug] No iOS / app preferences to set  
2015-04-21 12:03:33:949 - info: [debug] Starting iOS 8.\* simulator log capture  
2015-04-21 12:03:33:966 - info: [debug] Not pre-launching simulator  
2015-04-21 12:03:33:967 - info: [debug] No device id or app, not installing to real device.  
2015-04-21 12:03:33:967 - info: [debug] Starting command proxy.  
2015-04-21 12:03:33:972 - info: [debug] Instruments socket server started at /tmp/instruments\_sock  
2015-04-21 12:03:33:972 - info: [debug] Starting instruments  
2015-04-21 12:03:33:978 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments  
2015-04-21 12:03:33:979 - info: Launching instruments  
2015-04-21 12:03:33:987 - info: [debug] Attempting to run app on iPhone 6 (8.3 Simulator)  
2015-04-21 12:03:33:989 - info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 6 (8.3 Simulator)” “/Users/pavelzagalsky/Google Drive/Clarizen/1.1.1.7/Clarizen.app” -e UIASCRIPT “/Users/pavelzagalsky/Library/Application Support/appium/bootstrap/bootstrap-20805c3827813407.js” -e UIARESULTSPATH /tmp/appium-instruments  
2015-04-21 12:03:33:990 - info: [debug] And extra without-delay env: {“DYLD\_INSERT\_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB\_PATH”:"/Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-instruments/thirdparty/iwd6"}  
2015-04-21 12:03:33:990 - info: [debug] And launch timeouts (in ms): {“global”:90000}  
2015-04-21 12:03:34:503 - info: [debug] [INST] Waiting for device to boot…  
2015-04-21 12:03:34:556 - info: [debug] [INST STDERR] 2015-04-21 15:03:34.555 instruments[2456:46374] WebKit Threading Violation - initial use of WebKit from a secondary thread.  
2015-04-21 12:03:39:237 - info: Instruments is ready to receive commands  
2015-04-21 12:03:39:238 - info: [debug] Instruments launched. Starting poll loop for new commands.  
2015-04-21 12:03:39:238 - info: [debug] Setting bootstrap config keys/values  
2015-04-21 12:03:39:238 - info: [debug] Pushing command to appium work queue: “target = $.target();\nau = $;\n$.isVerbose = true;\n”  
2015-04-21 12:03:39:240 - info: [debug] Socket data received (2 bytes)  
2015-04-21 12:03:39:243 - info: [debug] Socket data being routed.  
2015-04-21 12:03:39:243 - info: [debug] Sending command to instruments: target = $.target();  
au = $;  
$.isVerbose = true;

2015-04-21 12:03:39:285 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: evaluation finished  
2015-04-21 12:03:39:286 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: responding with:  
2015-04-21 12:03:39:287 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: Running system command #1: /usr/local/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments\_sock 2,{“status”:0,“value”:true}…  
2015-04-21 12:03:39:373 - info: [debug] Socket data received (27 bytes)  
2015-04-21 12:03:39:373 - info: [debug] Socket data being routed.  
2015-04-21 12:03:39:374 - info: [debug] Got result from instruments: {“status”:0,“value”:true}  
2015-04-21 12:03:39:374 - info: [debug] Setting initial orientation to PORTRAIT  
2015-04-21 12:03:39:374 - info: [debug] Pushing command to appium work queue: “au.setScreenOrientation(‘PORTRAIT’)”  
2015-04-21 12:03:39:375 - info: [debug] Sending command to instruments: au.setScreenOrientation(‘PORTRAIT’)  
2015-04-21 12:03:39:475 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation(‘PORTRAIT’)  
2015-04-21 12:03:39:475 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: evaluating au.setScreenOrientation(‘PORTRAIT’)  
2015-04-21 12:03:39:476 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: target.setDeviceOrientation(“1”)  
2015-04-21 12:03:39:493 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: evaluation finished  
2015-04-21 12:03:39:494 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: responding with:  
2015-04-21 12:03:39:495 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: Running system command #2: /usr/local/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments\_sock 2,{“status”:0,“value”:“PORTRAIT”}…  
2015-04-21 12:03:39:588 - info: [debug] Socket data received (33 bytes)  
2015-04-21 12:03:39:589 - info: [debug] Socket data being routed.  
2015-04-21 12:03:39:589 - info: [debug] Got result from instruments: {“status”:0,“value”:“PORTRAIT”}  
2015-04-21 12:03:39:590 - info: [debug] Waiting for app source to contain elements  
2015-04-21 12:03:39:590 - info: [debug] Pushing command to appium work queue: “au.mainApp().getTreeForXML()”  
2015-04-21 12:03:39:590 - info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()  
2015-04-21 12:03:39:617 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()  
2015-04-21 12:03:39:618 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: evaluating au.mainApp().getTreeForXML()  
2015-04-21 12:03:39:753 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: evaluation finished  
2015-04-21 12:03:39:755 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: responding with:valid":true,“visible”:true,“hint”:null,“path”:"/0/0",“x”:0,“y”:0,“width”:375,“height”:667},"\>":[{“UIAImage”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/0",“x”:8,“y”:31,“width”:28,“height”:28},"\>":[]}},{“UIAStaticText”:{"@":{“name”:“Label”,“label”:“Label”,“value”:“Label”,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/1",“x”:44,“y”:32,“width”:51.5,“height”:26},"\>":[]}},{“UIATableView”:{"@":{“name”:“Empty list”,“label”:“Empty list”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/2",“x”:0,“y”:65,“width”:335,“height”:602},"\>":[]}},{“UIAActivityIndicator”:{"@":{“name”:“In progress”,“label”:“In progress”,“value”:“1”,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/3",“x”:149,“y”:315,“width”:37,“height”:37},"\>":[]}},{“UIAImage”:{"@":{“name”:“wallpaper\_login-1-1080x1920”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/4",“x”:0,“y”:0,“width”:375,“height”:667},"\>":[]}},{“UIAImage”:{"@":{“name”:“logo-clarizen\_white”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/5",“x”:93.5,“y”:102,“width”:188,“height”:45},"\>":[]}},{“UIAImage”:{"@":{“name”:“icon\_field-user”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/6",“x”:75.5,“y”:255,“width”:24,“height”:24},"\>":[]}},{“UIATextField”:{"@":{“name”:null,“label”:null,“value”:“Username”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/7",“x”:107.5,“y”:250,“width”:200,“height”:34},"\>":[{“UIATextField”:{"@":{“name”:null,“label”:null,“value”:“Username”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/7/0",“x”:107.5,“y”:250,“width”:200,“height”:34},"\>":[]}}]}},{“UIAImage”:{"@":{“name”:“icon\_field-password”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/8",“x”:75.5,“y”:299,“width”:24,“height”:24},"\>":[]}},{“UIASecureTextField”:{"@":{“name”:null,“label”:null,“value”:“Password”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/9",“x”:107.5,“y”:294,“width”:200,“height”:34},"\>":[{“UIASecureTextField”:{"@":{“name”:null,“label”:null,“value”:“Password”,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/9/0",“x”:107.5,“y”:294,“width”:200,“height”:34},"\>":[]}}]}},{“UIAButton”:{"@":{“name”:“Log in”,“label”:“Log in”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/10",“x”:67.5,“y”:338,“width”:240,“height”:35},"\>":[]}},{“UIAButton”:{"@":{“name”:“Forgot your password?”,“label”:“Forgot your password?”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/11",“x”:114.5,“y”:554,“width”:146,“height”:29},"\>":[{“UIAStaticText”:{"@":{“name”:“Forgot your password?”,“label”:“Forgot your password?”,“value”:“Forgot your password?”,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/11/0",“x”:115,“y”:560.5,“width”:145.5,“height”:16.5},"\>":[]}}]}},{“UIAButton”:{"@":{“name”:“Change Server”,“label”:“Change Server”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/0/12",“x”:140.5,“y”:608,“width”:94,“height”:29},"\>":[]}},{“UIAActivityIndicator”:{"@":{“name”:“Progress halted”,“label”:“Progress halted”,“value”:“0”,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/13",“x”:169,“y”:315,“width”:37,“height”:37},"\>":[{“UIAImage”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/0/13/0",“x”:169,“y”:315,“width”:37,“height”:37},"\>":[]}}]}}]}},{“UIAWindow”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:false,“hint”:null,“path”:"/0/1",“x”:0,“y”:0,“width”:375,“height”:667},"\>":[]}},{“UIAWindow”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/2",“x”:0,“y”:0,“width”:375,“height”:667},"\>":[{“UIAStatusBar”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0/2/0",“x”:0,“y”:0,“width”:375,“height”:20},"\>":[{“UIAElement”:{"@":{“name”:“Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top”,“label”:null,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:“Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top”,“path”:"/0/2/0/0",“x”:6,“y”:0,“width”:38,“height”:20},"\>":[]}},{“UIAElement”:{"@":{“name”:“3 of 3 Wi-Fi bars”,“label”:“3 of 3 Wi-Fi bars”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:“Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top”,“path”:"/0/2/0/1",“x”:49,“y”:0,“width”:13,“height”:20},"\>":[]}},{“UIAElement”:{"@":{“name”:“3:03 PM”,“label”:“3:03 PM”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:“Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top”,“path”:"/0/2/0/2",“x”:164,“y”:0,“width”:47,“height”:20},"\>":[]}},{“UIAElement”:{"@":{“name”:“100% battery power”,“label”:“100% battery power”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:“Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top”,“path”:"/0/2/0/3",“x”:345,“y”:0,“width”:25,“height”:20},"\>":[]}}]}}]}}]}}}  
2015-04-21 12:03:39:756 - info: [debug] [INST] 2015-04-21 12:03:39 +0000 Debug: Running system command #3: /usr/local/bin/node /Applications/Appium.app/Contents/Resources/node\_modules/appium/node\_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments\_sock 2,{“status”:0,“value”:{“UIAApplication”:{"@":{“name”:“Clarizen”,“label”:“Clarizen”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“vis…  
2015-04-21 12:03:39:786 - info: [debug] Socket data received (6294 bytes)  
2015-04-21 12:03:39:786 - info: [debug] Socket data being routed.  
2015-04-21 12:03:39:787 - info: [debug] Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{”@":{“name”:“Clarizen”,“label”:“Clarizen”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0",“x”:0,“y”:20,“width”:375,“height”:647},"\>":[{“UIAWindow”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,"  
2015-04-21 12:03:39:788 - info: [debug] Device launched! Ready for commands  
2015-04-21 12:03:39:788 - info: [debug] Setting command timeout to the default of 60 secs  
2015-04-21 12:03:39:789 - info: Welcome to Appium v1.3.6 (REV 004f52f249d3513809e7d0734d9205d1fec19f8e)  
2015-04-21 12:03:39:789 - info: Appium REST http interface listener started on 127.0.0.1:4739  
2015-04-21 12:03:39:792 - info: [debug] Non-default server args: {“app”:"/Users/pavelzagalsky/Google Drive/Clarizen/1.1.1.7/Clarizen.app",“address”:“127.0.0.1”,“port”:4739,“launch”:true,“log”:"/Users/QA/Library/Logs/Appium/1.log",“deviceName”:“iPhone 6”,“platformName”:“iOS”,“platformVersion”:“8.3”,“browserName”:“iOS”}  
2015-04-21 12:03:39:793 - info: Console LogLevel: debug  
2015-04-21 12:03:39:793 - info: File LogLevel: debug  
2015-04-21 12:04:39:794 - info: [debug] Didn’t get a new command in 60 secs, shutting down…  
2015-04-21 12:04:39:795 - info: Shutting down appium session  
2015-04-21 12:04:39:795 - info: [debug] Stopping ios  
2015-04-21 12:04:39:797 - info: [debug] Destroying instruments client socket.  
2015-04-21 12:04:39:798 - info: [debug] Closing socket server.  
2015-04-21 12:04:39:798 - info: [debug] Instruments socket server was closed  
2015-04-21 12:04:39:799 - info: [debug] Sending sigterm to instruments  
2015-04-21 12:04:39:802 - info: [debug] [INST] 2015-04-21 12:04:39 +0000 Stopped: Script was stopped by the user  
2015-04-21 12:04:39:855 - info: [debug] [INST] 2015-04-21 12:04:39 +0000 Error: Script threw an uncaught JavaScript error: JSON Parse error: Unexpected EOF on line 2589 of bootstrap-20805c3827813407.js  
2015-04-21 12:04:39:913 - info: [debug] [INST STDERR] 2015-04-21 15:04:39.912 instruments[2456:46376] Attempting to set event horizon when core is not engaged, request ignored  
2015-04-21 12:04:39:914 - info: [debug] [INST STDERR] 2015-04-21 15:04:39.912 instruments[2456:46370] Attempting to set event horizon when core is not engaged, request ignored  
2015-04-21 12:04:39:964 - info: [debug] [INST STDERR] 2015-04-21 15:04:39.963 instruments[2456:46372] Attempting to set event horizon when core is not engaged, request ignored  
2015-04-21 15:04:39.964 instruments[2456:46372] Attempting to set event horizon when core is not engaged, request ignored  
2015-04-21 12:04:40:439 - info: [debug] [INST] Instruments Trace Complete (Duration : 63.576191s; Output : /tmp/appium-instruments/instrumentscli0.trace)  
2015-04-21 12:04:40:461 - info: [debug] [INSTSERVER] Instruments exited with code 0  
2015-04-21 12:04:40:462 - info: [debug] Cleaning up after instruments exit  
2015-04-21 12:04:40:463 - info: [debug] Stopping iOS log capture  
2015-04-21 12:04:40:463 - info: [debug] Running ios sim reset flow  
2015-04-21 12:04:40:463 - info: [debug] Killing the simulator process  
2015-04-21 12:04:40:464 - info: [debug] Killall iOS Simulator  
2015-04-21 12:04:40:467 - info: [debug] Killing any other simulator daemons  
2015-04-21 12:04:40:540 - info: [debug] Cleaning sim data files  
2015-04-21 12:04:40:543 - info: Executing: xcrun simctl erase 3BC16EF3-1ED3-4658-8363-FF290597CAF4 with timeout 2000  
2015-04-21 12:04:40:756 - info: [debug] Cleaning app data files  
2015-04-21 12:04:40:756 - warn: Applications directory /Users/QA/Library/Developer/CoreSimulator/Devices/3BC16EF3-1ED3-4658-8363-FF290597CAF4/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?  
2015-04-21 12:04:40:757 - warn: Applications directory /Users/QA/Library/Developer/CoreSimulator/Devices/3BC16EF3-1ED3-4658-8363-FF290597CAF4/data/Containers/Bundle/Application doesn’t exist. Have you run this simulator before?  
2015-04-21 12:04:40:757 - info: Couldn’t find app directories to delete. Probably it’s not installed  
2015-04-21 12:04:40:757 - info: [debug] Cleaning up appium session  
2015-04-21 12:04:40:758 - info: [debug] We shut down because no new commands came in

---

<div class="post-metadata">

**Author:** ![AjitJ](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@AjitJ](https://discuss.appium.io/u/AjitJ)\
**Post date:** [April 23, 2015, 6:03am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/18 "2015-04-23T06:03:16Z")

</div>

Please let me know Steps for MAC.  
Thanks,  
AJ.

---

<div class="post-metadata">

**Author:** ![Hassan\_Radi](https://discuss.appium.io/user_avatar/discuss.appium.io/hassan_radi/32/4077_2.png) [@Hassan\_Radi](https://discuss.appium.io/u/Hassan_Radi)\
**Post date:** [April 23, 2015, 8:29am UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/19 "2015-04-23T08:29:32Z")

</div>

> [@pavelzagalsky](#):
>
> ssh.Connect();  
> ssh.RunCommand(unixCommand);  
> ssh.Disconnect();

The execution is blocked until the connection that you have started with the _ **RunCommand** _ terminates. You can use Threads to overcome this. Or a simpler solution would be to use the solution I proposed [here](https://discuss.appium.io/t/launching-and-stopping-appium-server-programmtically/700/2).

---

<div class="post-metadata">

**Author:** ![ildi](https://discuss.appium.io/letter_avatar_proxy/v4/letter/i/53a042/32.png) [@ildi](https://discuss.appium.io/u/ildi)\
**Post date:** [April 30, 2015, 8:29pm UTC](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615/20 "2015-04-30T20:29:57Z")

</div>

Hi, how do you call this Appium.command file from Eclipse? Got a kind of stuck…

[Next page](https://discuss.appium.io/t/starting-appium-server-programmatically-on-mac/1615.md?page=2)
