[Help] Cannot start Launch Appium Inspector with Appium on iOS

939 views
Skip to first unread message

Appium Selenium

unread,
Jul 15, 2014, 4:38:59 PM7/15/14
to appium-...@googlegroups.com
Hi there,

I am trying to do Launch Appium Inspector but I am not able to..

I am seeing the following messages:

"Could not start a new session

Be sure the Appium Server is running with an application opened by using the “App Path” parameter in Appium.app (along with package and activity for Android) or by connecting with selenium client and supplying this in the desired capabilities object."


Settings I have under iOS settings,

App Path:

BundleID:

Force Device [Checked]

Platform Version 7.1 (The iOS version on real device is 7.1.2)

UDID


General Settings:

[Checked] Check for Updates

[Checked] Kill Processes Using Server Port Before Launch

[Checked] New Command Timeout 7200

[Checked] Use Colors (Under Logging section)



I tried to reboot the laptop and still seeing the same error message...



Any advice is greatly appreciate !! :)

Isaac Murchie

unread,
Jul 15, 2014, 4:41:13 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Have you filled in the path to the app in "App Path"? That seems to be what it is complaining about.



--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

Appium Selenium

unread,
Jul 15, 2014, 4:49:27 PM7/15/14
to appium-...@googlegroups.com, learnin...@gmail.com
Thank you for the quick respond,  I forgot to state that, I do have the app patch configured and the app does exist under the path.  Both App Path and BundleID are correct.  The app itself is with "drwxrwxrwx"

I dunno what happened but it is now not working... 

Isaac Murchie

unread,
Jul 15, 2014, 4:54:52 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Can you paste the entire server log here?

Appium Selenium

unread,
Jul 15, 2014, 5:07:26 PM7/15/14
to appium-...@googlegroups.com, learnin...@gmail.com
Thank you Issac:

I think it failed to start the Instruments damon.


*** logs ***

de

bug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_service_agent: Could not look up service in the map

debug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_and_handle_checkin: Could not spawn the com.apple.instruments.server service agent:InvalidService

debug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_service_agent: Could not look up service in the map

debug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_and_handle_checkin: Could not spawn the com.apple.instruments.remoteserver service agent:InvalidService

debug: [INST STDERR] 2014-07-15 17:01:46.171 instruments[1719:1a03] Failed to start Instruments daemon for 'iOS' on 'Husky's iPhone 5S Golden (v7.1)' (The service is invalid.)


debug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_service_agent: Could not look up service in the map

debug: [IOS_SYSLOG_ROW ] Jul 15 17:01:47 Husky-iPhone-5S-Golden lockdownd[25] <Notice>: 01c5c000 spawn_and_handle_checkin: Could not spawn the com.apple.instruments.server service agent:InvalidService

debug: [INSTSERVER] Instruments exited with code 253

debug: Killall instruments

debug: Instruments crashed on startup

debug: Appium request initiated at /wd/hub/status

debug: Request received with params: {}

debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}

debug: [IOS_SYSLOG_ROW ] Jul 15 17:02:34 Husky-iPhone-5S-Golden timed[37] <Notice>: (Note ) CoreTime: Received timezone "America/New_York" from "Location"

debug: [IOS_SYSLOG_ROW ] Jul 15 17:02:34 Husky-iPhone-5S-Golden timed[37] <Notice>: (Note ) CoreTime: Current mcc: '311' simulated:'0'.

debug: [IOS_SYSLOG_ROW ] Jul 15 17:02:34 Husky-iPhone-5S-Golden timed[37] <Notice>: (Note ) CoreTime: Not setting time zone to America/New_York from LocationAndNetwork

debug: Appium request initiated at /wd/hub/status

debug: Request received with params: {}

debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


****

Isaac Murchie

unread,
Jul 15, 2014, 5:11:22 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Have you done all the things that need to be done to automate apps on a real device?

Isaac Murchie

unread,
Jul 15, 2014, 5:47:52 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Please keep things on the Appium-Discuss list.

What changed that made it not work? Did you upgrade? 

What is in the server log when running the tests as a Java application?


On Tue, Jul 15, 2014 at 2:45 PM, Appium Selenium <learnin...@gmail.com> wrote:
When I try to run my test case as "Java Application", it will throw an exception with "UnreachableBrowserException:"


*** Error message***

Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'

System info: host: ‘Husky-MacBook-Air.local', ip: '10.131.32.73', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.8.0_05'

Driver info: driver.version: RemoteWebDriver

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)

at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)

at com.Husky.take2.Appium_take1.main(Appium_take2.java:35)

Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1, localhost/fe80:0:0:0:0:0:0:1%1] failed: Connection refused

at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138)

at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)

at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)

at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)

at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)

at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85)

at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)

at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)

at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:204)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:173)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)

... 4 more

Caused by: java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)

at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:118)

... 16 more



On Tue, Jul 15, 2014 at 5:42 PM, Appium Selenium <learnin...@gmail.com> wrote:
Hi Isaac,

Yes I have done that.... I used to be able to launch the inspector and open my apps, gather all the xpath of each button.  Now the inspector does not work at all..  I cant even try to run my test case as Java Project...

Appium Selenium

unread,
Jul 15, 2014, 5:54:28 PM7/15/14
to Isaac Murchie, appium-...@googlegroups.com
Hi Isaac,

I have not done any changes to Appium.  It is and has been running Appium 1.2.0 (Cygnus), 

When I run the Java Application, there is nothing much shown on the server side:
***

info: <-- GET /wd/hub/status 200 1.313 ms - 155 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


debug: Request received with params: {}

debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


info: --> GET /wd/hub/status {}


debug: Appium request initiated at /wd/hub/status


info: <-- GET /wd/hub/status 200 0.996 ms - 155 {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


debug: Request received with params: {}

debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


debug: Appium request initiated at /wd/hub/session/fb73bf0c-8de4-4b9d-b7f7-578b23deeceb/source


info: --> GET /wd/hub/session/fb73bf0c-8de4-4b9d-b7f7-578b23deeceb/source {}


debug: Request received with params: {}

debug: Pushing command to appium work queue: "au.mainApp().getTreeForXML()"


debug: Appium request initiated at /wd/hub/status


info: --> GET /wd/hub/status {}


debug: Request received with params: {}

debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"fb73bf0c-8de4-4b9d-b7f7-578b23deeceb"}


**

Isaac Murchie

unread,
Jul 15, 2014, 6:06:41 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
If nothing has changed but it stopped working suddenly, I don't know what the problem might be.

Can you make a minimal test that just connects to the server and then ends? Does that work? Just to isolate what is causing the error? I don't know what commands you're running so I can't really tell from here.

Isaac Murchie

unread,
Jul 15, 2014, 6:26:35 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Im not sure if it will make a difference, but "device" and "version" don't do anything. "deviceName" and "platformVersion" are the caps.


On Tue, Jul 15, 2014 at 3:23 PM, Appium Selenium <learnin...@gmail.com> wrote:
Sure I will give it a try, is the following code good enough?

***


public class Appium_take1 {

    public static void main(String... args){

        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();

        desiredCapabilities.setCapability("device", "iPhone");

        desiredCapabilities.setCapability("version", "7.1");

        desiredCapabilities.setCapability("app", "/Users/Husky/Downloads/Payload2/test.app");

        desiredCapabilities.setCapability("platformName", "iOS");

        desiredCapabilities.setCapability("deviceName", "iPhone");

       


     

        remoteWebDriver.quit();

    }

}

***

Isaac Murchie

unread,
Jul 15, 2014, 6:35:51 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Seems reasonable capability-wise. But is this the code you are actually using? Or have you removed the actual URL for privacy/other sake? 


On Tue, Jul 15, 2014 at 3:31 PM, Appium Selenium <learnin...@gmail.com> wrote:
Arg okay, is this better?

***

public class Appium_take1 {

    public static void main(String... args){

        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();

        desiredCapabilities.setCapability("app", "/Users/Husky/Downloads/Payload2/Test.app");

        desiredCapabilities.setCapability("PLATFORMVERSION", "iOS");

        desiredCapabilities.setCapability("DEVICENAME", "iPhone");

        URL url = null;

        WebDriver remoteWebDriver = new RemoteWebDriver(url,desiredCapabilities);

        remoteWebDriver.quit();

    }

}

***

Isaac Murchie

unread,
Jul 15, 2014, 6:54:46 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Again, please keep things on the Appium-Discuss list. Others may have input to give.

Is the app you are testing a hybrid app? The line "remoteWebDriver.get('http://www.google.com')" line should not work until you are in a web view context.

At what line are you getting the error?


On Tue, Jul 15, 2014 at 3:46 PM, Appium Selenium <learnin...@gmail.com> wrote:
Hi Isaac,

This is the actual code, I am just following an example from a book, the code is shown below:

***

public class Appium_take1 {

    public static void main(String... args){

        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();

        desiredCapabilities.setCapability("device", "iPhone");

        desiredCapabilities.setCapability("version", "7.1");

        desiredCapabilities.setCapability("app", "/Users/Husky/Downloads/Payload2/Test.app");

        desiredCapabilities.setCapability("platformName", "iOS");

        desiredCapabilities.setCapability("deviceName", "iPhone");

        URL url = null;

        try {

            url = new URL("http://127.0.0.1:4723/wd/hub");

        } catch (MalformedURLException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();

        }

        WebDriver remoteWebDriver = new RemoteWebDriver(url,desiredCapabilities);

        remoteWebDriver.get("http://www.google.com");

       

       

        WebElement ele = remoteWebDriver.findElement(By.name("q"));

        ele.click();

        ele.sendKeys("Appium Automation on iOS");

        WebElement searchButton = remoteWebDriver.findElement(By.name("btnG"));

        System.out.println(searchButton.getSize());

        searchButton.click();

        //remoteWebDriver.quit();

    }

}


***


I am a newbie to programming, all I am looking to do with Appium at this point is to launch my test app under "/Users/Husky/Downloads/Payload2/test.app", find a button base on its xpath (UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[5]/UIAStaticText[1]) and click on it.


Thats all I am looking to accomplish at the moment....:)


What do you think??


Thanks alot Issac!

Isaac Murchie

unread,
Jul 15, 2014, 7:01:56 PM7/15/14
to Appium Selenium, appium-...@googlegroups.com
Yes, the discussion list.


Otherwise you need to switch contexts, from the native app to the web view. The general overview is here: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/hybrid.md


On Tue, Jul 15, 2014 at 3:59 PM, Appium Selenium <learnin...@gmail.com> wrote:
Arg, I am just replying to you directly.  "Appium-Discuss" list is referring to the discussion group right?

You are correct, I am getting an error with that on real device, it works fine with Simulator, which can launch the Safari browser to open the google page, and click on the search field, enter text and click on the search button. :)


Appium Selenium

unread,
Jul 15, 2014, 7:03:58 PM7/15/14
to Isaac Murchie, appium-...@googlegroups.com
Thank you for the links, I will go through them now.

Btw, I tried with the code you suggested and I am still getting the "org.openqa.selenium.remote.UnreachableBrowserException:"... : (

stephan

unread,
Jul 16, 2014, 7:02:10 AM7/16/14
to appium-...@googlegroups.com
 i had the same issue. My solution was to set the server url in Appium.app:
Click Settings and change the server url from 0.0.0.0 to localhost or something. 
Reply all
Reply to author
Forward
0 new messages