Appium error while connecting to real iOS device

247 views
Skip to first unread message

Imon

unread,
Apr 30, 2014, 1:08:56 PM4/30/14
to appium-...@googlegroups.com
Hi,

I am running my tests on a physical device (the app has been pre-loaded from a Jenkins link) and receiving a app not set error even when i am passing the bundle id in the capabilities and in the server args. Is there any additional setup that is required? I went through the https://github.com/appium/appium/blob/master/docs/en/real-devices.md link but most of it probably is not applicable since the app is already installed on the device.

Passing the following as desired capabilities:


public static void setup(){

        DesiredCapabilities capabilities = new DesiredCapabilities();

        capabilities.setCapability(CapabilityType.BROWSER_NAME, "");

        capabilities.setCapability("udid", <UDID Number>);

        capabilities.setCapability("bundleId", <BundleID>);

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

        capabilities.setCapability(CapabilityType.VERSION, "7.0.4");

        capabilities.setCapability(CapabilityType.PLATFORM, "Mac");

        capabilities.setCapability("newCommandTimeout", "360");

        capabilities.setCapability("launch", "true");

        //capabilities.setCapability("app", app.getAbsolutePath());

       

        try{

        driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), capabilities);

        }catch (Exception e){

        System.out.println (e);

        }

        System.out.println ("Launch Successful");

}


and the following as server args - 


appium -m --app <Bundle Id> --udid <UDID>


The following is the output from the appium logs:



info: Welcome to Appium v0.16.0 (REV 292d265edd9c7aaf96f165009285c814b218363d)

info: Appium REST http interface listener started on 0.0.0.0:4723

   info  - socket.io started

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

debug: Request received with params: {"desiredCapabilities":{"newCommandTimeout":"360","platform":"Mac","browserName":"","bundleId":"<BundleID>","device":"iPhone","launch":"true","udid":"<UDID>","version":"7.0.4"}}

info: App is an iOS bundle, will attempt to run as pre-existing

info: Creating new appium session 82bec7cd-739b-4c73-84f6-9bde370cd6a7

info: Removing any remaining instruments sockets

info: Cleaned up instruments socket /tmp/instruments_sock

info: Cleaning up any tracedirs

info: No tracedirs to clean up

info: Localizable.strings is not currently supported when using real devices.

info: Not setting locale because we're using a real device

info: Not setting iOS and app preferences since we're on a real device

info: Starting iOS device log capture via idevicesyslog

POST /wd/hub/session 200 599996ms

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

debug: Request received with params: {"desiredCapabilities":{"newCommandTimeout":"360","platform":"Mac","browserName":"","bundleId":"<BundleID>","device":"iPhone","launch":"true","udid":"<UDID>","version":"7.0.4"}}

info: Got configuration error, not starting session

info: Cleaning up appium session

error: Failed to start an Appium session, err was: No app set; either start appium with --app or pass in an 'app' value in desired capabilities

info: undefined

info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created.","origValue":"No app set; either start appium with --app or pass in an 'app' value in desired capabilities"},"sessionId":null}

POST /wd/hub/session 500 33ms - 223b


Imon

unread,
Apr 30, 2014, 1:26:44 PM4/30/14
to appium-...@googlegroups.com
Ok..its solved ...careless mistake on my part.

        capabilities.setCapability("bundleId", <BundleID>);

should be 

        capabilities.setCapability("app", <BundleID>);


Its connecting fine now and driving the app.

Imon

unread,
Apr 30, 2014, 4:42:30 PM4/30/14
to appium-...@googlegroups.com
All was running fine and i could connect to the device and bring up the app until suddenly i started receiving the Instruments crashed on startup error message when running the script against a real device. I am using the same capabilities as mentioned below. Please advise.

info: [INSTSERVER] Instruments exited with code null

error: Instruments crashed on startup

info: Killall instruments

info: Stopping iOS log capture

info: Killing the simulator process

info: Instruments launched. Starting poll loop for new commands.

info: Setting bootstrap config keys/values

info: Pushing command to appium work queue: "setBootstrapConfig: autoAcceptAlerts=false"

debug: Sending command to instruments: setBootstrapConfig: autoAcceptAlerts=false

info: Killing any other simulator daemons

info: Cleaning app state.

info: No folders found to remove

info: Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

info: Error: Instruments crashed on startup

    at Instruments.onInstrumentsExit (/usr/local/lib/node_modules/appium/lib/devices/ios/instruments.js:339:31)

    at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/ios/instruments.js:290:12)

    at ChildProcess.EventEmitter.emit (events.js:98:17)

    at Process.ChildProcess._handle.onexit (child_process.js:797:12)

info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}

POST /wd/hub/session 500 4305ms - 210b


On Wednesday, April 30, 2014 1:08:56 PM UTC-4, Imon wrote:
Reply all
Reply to author
Forward
0 new messages