INSTSERVER] Instruments exited with code 253

Hi I am receiving this error and I am running on device. and Developer option - UI Automation is enabled. I have verified that the app name does not contain spaces or non-alphanumeric characters.

Here are my details. Thanks in advance

am trying to do a simple launch application on a real device to no avail. My settings are as follows: iphone 6, iOS 8.0, Mac OSX 10.9.5, Xcode 6.1, Appium 1.3.1 (I have also tried running from the node appium 1.3.3 (same error)). Appium settings - I have tried running from 127.0.0.1/4723 and 0.0.0.0/4723. any assistance would be greatly appreciated. Have tried numerous troubleshooting tips from online…including clearing the Device console in Xcode…clearing cache using node command. adding permissions…

info: [debug] Starting instruments

info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID 3#####
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 3########af3e com.abcd.mpbasic
-e UIASCRIPT “/Users/user/Library/Application Support/appium/bootstrap/bootstrap-9280a4dc9be20ec9.js”
-e UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [debug] [INSTSERVER] Instruments exited with code 253

info: [debug] Killall instruments

info: [debug] Instruments crashed on startup

info: [debug] Attempting to retry launching instruments, this is retry #1 info: [debug] Killall iOS Simulator

Eclipse code: DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability("deviceName", "iPhone");
capabilities.setCapability("platformName", "ios");      
capabilities.setCapability("udid", "3##########");
capabilities.setCapability("bundleId", "com.ssssss.mptest");
capabilities.setCapability("ipa", "/Users/user/Desktop/Mptest.ipa");



try
{
    System.out.println("before app is launched");
    driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);

    System.out.println("connected1");
}
catch (MalformedURLException e)
{
    e.printStackTrace();
    System.out.println(e.getMessage());
}

Appium settings:
app path is set…and checked…bundleID is checked and set

Device settings: Tried with Force device checked and unchecked - iphone 6 platform version 8.0
UDID…checked and set…Tried with Full Reset checked and unchecked…
If I check full reset…then the app is deleted and then readded to the device successfully…just won’t launch. I also tried launching a different app…same error.

I have also verified provisioning and developer profiles exist on device.

3 Likes

Just reran test …and view xcode logs…I see error 0x100484000 - MNPLockdownConnection receiveMessage: lockdown_receive_message error!

I have the same issue with iPhone 5s (iOS 8.1.1). My setup:

Host:
OS X 10.10.1
xCode 6.1.1
Appium 1.3.4-beta (built from sources)

Devices:
iPhone 5s (iOS 8.1.1) - I get the same error
info: [debug] [INSTSERVER] Instruments exited with code 253

iPad Air (iOS 8.1.1) - it works without any major issues. It is really perplexing that it works on the iPad and does not work on the iPhone.

For both devices i can see lockdown_receive_message error! in device console in xCode. It does not stop appium from running on the iPad.

1 Like

I have resolved the problem with my brand new iPhone 5S.

Here is what I did:

  1. connected the iPhone 5S the machinse
  2. launched “Instruments” application from XCode (note: the GUI one, not the command line one!)
  3. chose my failing device (the iPhone 5s) and SafariLauncher as target for profiling template
  4. chose “automation” project
  5. clicked “choose”.

Either now, or after clicking “record” button a pop up appeared that asked me if I want to open XCode enable this device for development. Theoretically this makes little sense, as I did that already, I saw the “developer” menu in phone’s settings, I had the “Enable UI Automation” checked, provisioning profile uploaded… nonetheless I clicked “Yes”.

Xcode devices view opened and I did nothing there, although I saw some settings change in the device console’s output. I switched back to Instruments GUI, clicked “record” and SafariLauncher started on the device.

After that the phone started to work with the command line of the instruments too and I am able to run my tests on the device.

Seems that the device entered a state where “developer” options were halfway enabled, visible in the IOS GUI, toggable, etc but actually not working. Instruments GUI somehow detected and fixed it.

Hope that helps.

5 Likes

Thanks Scypio! what you wrote makes sense…that the issue is something with the new UI Automation option. I have not tried launching directly from XCode yet. So I will try the steps you listed…and post back my results.

Unfortunately my app will not launch from Instruments either. Getting “Target failed to run: Permission to debug was denied”. Double checking my profiles associated with the app and the device. I did initially see the message you stated…asking if i want to open XCode enable this device for development.

@lurita_eady,
Did you try to use extract your Mptest.app from the Mptest.ipa & point to it instead?

capabilities.setCapability(“app”, “/Users/user/Desktop/Mptest.app”);

1 Like

No. I have not. How do I extract to an .app file…is this done through xcode as well? A developer created the app and I am testing it…I will email them and ask for an .app file. Thanks!

Actually its very simple, just right click is & extract it.
then look in the extracted folder for your .app application.

Ok. Thx! I went back to look at it in instruments…and actually it was already showing as .app. So xcode must automatically extract the app file…which is great

Saved me here, @scypio ! Thanks:)

2 Likes

I am trying this on Appium.app and getting the same error.

info: [debug] App is installed.

info: [debug] fullReset not requested. No need to install.
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments

info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 058625d85bac3ac57401423cb04c9bef3b6b6106
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 058625d85bac3ac57401423cb04c9bef3b6b6106 com.goodreads.Goodreads -e UIASCRIPT “/Users/mesharma/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [debug] [INSTSERVER] Instruments exited with code 253

info: [debug] Killall instruments

info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #1

1 Like

Saved me as well, @scypio ! Thanks :slight_smile:

Seems there are two reasons for this to happen:

  • on the iDevice -> Settings -> Developer - Enable UI Automation is disabled.
  • on Xcode -> Devices -> “use for development” wasn’t selected.
2 Likes

Hi, can you please explain me…how to extract .app file in to desktop. where i can find the location of extracted .app file.

I have installed app in my iPhone… now i want to get the .app file for that on my desktop.

Thanks,
Sri

I am also facing the same problem??
anybody please help me in deaing with it

HI Neha,

Please upload error log.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Thanks.
It helped me going one step further

that totally worked for me :open_mouth:
I would like why this step is necessary though, does anyone know?

Hello Srinivas,

Here are the steps:

If you have installed the .ipa file from itunes, follow the below step’s.

  1. Right click on the .ipa file and open in a Folder.
  2. Now extract the .ipa file
  3. you will get two item’s (1. Payload, 2.plist)
  4. Now click on payload

it’s your .app file.

I hope it will help you out…i am gonna figure out the second way where the .ipa is not in the itunes(available only in the device)