Appium failing to work with Launchd

Hi,

Not exactly an issue with Appium but I’ve encountered a compatibility issue between Appium and Launchd, specifically when the --default-capabilites flag is used. Previously when using Appium 1.4, my Launchd plist file contained the following Appium flags

    <string>/usr/local/bin/appium</string>
    <string>--port</string>
    <string>4724</string>
    <string>--full-reset</string>
    <string>--bootstrap-port</string>
    <string>2251</string>
    <string>--avd</string>
    <string>AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22</string>
    <string>--avd-args</string>
    <string>-wipe-data -port 5554</string>
    <string>--log-timestamp</string>
    <string>--local-timezone</string>
    <string>--log</string>
    <string>/Users/tcagent/Selenium/Selenium-Node/AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22/logs/appium.log</string>
    <string>--nodeconfig</string>
    <string>/Users/tcagent/Selenium/Selenium-Node/AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22/conf/nodeconfig.json</string>
    <string>--suppress-adb-kill-server</string>
    <string>--device-ready-timeout</string>
    <string>30</string>

Which worked fine. However when I updated to Appium 1.5.3 and changed the Appium flags to include --default-capabilities, it no longer launched. When launching the process via Launchd, the process would appear for a brief moment however would quickly be removed again. If I grabbed the Launchd command before it disappeared and manually ran it, it would launch fine.

After a little poking around I found that Launchd has an issue with the curly braces of --default-capabilities. My Launchd plist file for Appium 1.5.3 is below:

    <string>/usr/local/bin/appium</string>
    <string>--default-capabilities</string>
    <string>'{"fullReset": "true", "avd": "AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22", "avdArgs": "-wipe-data -port 5554", "deviceReadyTimeout": "30"}'</string>
    <string>--port</string>
    <string>4724</string>
    <string>--bootstrap-port</string>
    <string>2251</string>
    <string>--log-timestamp</string>
    <string>--local-timezone</string>
    <string>--log</string>
    <string>/Users/tcagent/Selenium/Selenium-Node/AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22/logs/appium.log</string>
    <string>--nodeconfig</string>
    <string>/Users/tcagent/Selenium/Selenium-Node/AVD_for_Samsung_Galaxy_S6-Google_APIs_API_Level_22/conf/nodeconfig.json</string>
    <string>--suppress-adb-kill-server</string>

Thought I’d raise this here even though its a Launchd issue; just in case someone is facing the same issue. Google-ing my problem yielded in no results :frowning:

Why did you use this port for Appium? Any specific reason?

I suggest to use another port, pls.