Unable to launch facebook app from appium on iOS device

Hi

I am trying to automate facebook app for iOS device. I am using appium 1.3.7 and xcode 6.1.1.

When I try to launch the facebook app I encounter the following error:

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.facebook.Facebook was denied. The app must be signed with a development identity (e.g. iOS Developer).

I am also attaching the appuim logs below:

info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)

info: Appium REST http interface listener started on 127.0.0.1:4725
info: [debug] Non-default server args: {“udid”:“a1c6955f6c90ba613c0451365c915566604984e0”,“address”:“127.0.0.1”,“port”:4725,“deviceName”:“iPhone 4s”,“platformName”:“iOS”,“platformVersion”:“8.1.1”,“showIOSLog”:true,“defaultCommandTimeout”:7200}

info: Console LogLevel: debug

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: <-- GET /wd/hub/status 200 10.326 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“com.facebook.Facebook”,“platformName”:“iOS”,“deviceName”:“iPhone 4s”,“appium-version”:“1.3.7”}}

info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version

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

info: [debug] Creating new appium session 5c37fffa-5327-46c7-b7e4-4cd7a2cc0f67
info: [debug] Removing any remaining instruments sockets

info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder

info: [debug] Setting Xcode version

info: [debug] Setting iOS SDK Version

info: [debug] Getting sdk version from xcrun with a timeout

info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we’re on a real device
info: [debug] Detecting automation tracetemplate

info: [debug] Not auto-detecting udid, running on sim

info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.facebook.Facebook/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML

info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.facebook.Facebook/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Creating instruments
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
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/iostrainee/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/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”:“grouped”}

info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js

info: [debug] Reusing dynamic bootstrap: /Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js

info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.1.1”,“iOSSDKVersion”:“8.1”,“deviceName”:“iPhone 4s”,“platformVersion”:“8.1.1”}

info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 4s (8.1.1 Simulator)’
info: [debug] Not setting device type since we’re on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we’re on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator

info: [debug] Killing any other simulator daemons

info: [debug] On a real device; cannot clean device state

info: [debug] Not setting locale because we’re using a real device
info: [debug] No iOS / app preferences to set

info: [debug] Starting iOS device log capture via deviceconsole

info: [debug] Not pre-launching simulator

info: [debug] Creating iDevice object with udid a1c6955f6c90ba613c0451365c915566604984e0

info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id a1c6955f6c90ba613c0451365c915566604984e0 --bundle com.facebook.Facebook

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/Xcode2.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID a1c6955f6c90ba613c0451365c915566604984e0
info: [debug] Spawning instruments with command: /Applications/Xcode2.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w a1c6955f6c90ba613c0451365c915566604984e0 com.facebook.Facebook -e UIASCRIPT “/Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] May 19 12:23:51 Iphone backboardd[57] : ALS: SetDisplayFactor: factor=0.0500

info: [IOS_SYSLOG_ROW ] May 19 12:23:52 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] May 19 12:23:53 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22
info: [IOS_SYSLOG_ROW ] May 19 12:23:53 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument
info: [IOS_SYSLOG_ROW ] May 19 12:23:55 Iphone syslog_relay[110] : syslog_relay found the ASL prompt. Starting…
info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22
info: [IOS_SYSLOG_ROW ] May 19 12:23:55 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument
info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22
info: [IOS_SYSLOG_ROW ] May 19 12:23:55 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22
info: [IOS_SYSLOG_ROW ] May 19 12:23:55 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:23:55 Iphone mobile_installation_proxy[122] : 0x301000 handle_connection: Could not receive request from host.
info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22
info: [IOS_SYSLOG_ROW ] May 19 12:23:57 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [debug] [INST STDERR] 2015-05-19 12:23:53.785 instruments[31384:2207] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:23:58 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone backboardd[57] : ALS: SetDisplayFactor: factor=1.0000

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone kernel[0] : xpcproxy[422] Container: /private/var/mobile/Containers/Data/Application/A87CB8D7-2913-42A4-BD02-902B84C288D4 (sandbox)

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.facebook.Facebook was denied. The app must be signed with a development identity (e.g. iOS Developer).

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone DTMobileIS[280] : Unable to acquire task port after launch of pid 422 (com.facebook.Facebook)

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

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone com.apple.xpc.launchd[1] (UIKitApplication:com.facebook.Facebook[0xec7d][422]) : Service exited due to signal: Killed: 9

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone notification_proxy[105] : 0x365000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!

info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone notification_proxy[105] : 0x365000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
info: [IOS_SYSLOG_ROW ] May 19 12:23:59 Iphone SpringBoard[43] : Application ‘UIKitApplication:com.facebook.Facebook[0xec7d]’ exited abnormally via signal.

info: [IOS_SYSLOG_ROW ] May 19 12:24:00 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:00 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”},“isShuttingDown”:false},“sessionId”:“5c37fffa-5327-46c7-b7e4-4cd7a2cc0f67”}

info: <-- GET /wd/hub/status 200 8.363 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.3.7”,“revision”:“72fbfaa116d3d9f6a862600ee99cf02f6d0e2182”},“isShuttingDown”:false},“sessionId”:“5c37fffa-5327-46c7-b7e4-4cd7a2cc0f67”}

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID a1c6955f6c90ba613c0451365c915566604984e0

info: [debug] Spawning instruments with command: /Applications/Xcode2.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w a1c6955f6c90ba613c0451365c915566604984e0 com.facebook.Facebook -e UIASCRIPT “/Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [debug] [INST STDERR] 2015-05-19 12:24:01.073 instruments[31389:1003] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:05 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone kernel[0] : xpcproxy[424] Container: /private/var/mobile/Containers/Data/Application/A87CB8D7-2913-42A4-BD02-902B84C288D4 (sandbox)

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone DTMobileIS[280] : Unable to acquire task port after launch of pid 424 (com.facebook.Facebook)

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.facebook.Facebook was denied. The app must be signed with a development identity (e.g. iOS Developer).

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone com.apple.xpc.launchd[1] (UIKitApplication:com.facebook.Facebook[0xe627][424]) : Service exited due to signal: Killed: 9

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 #2
info: [debug] Killall iOS Simulator

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone notification_proxy[105] : 0x2dd000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone notification_proxy[105] : 0x3ed000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone SpringBoard[43] : Application ‘UIKitApplication:com.facebook.Facebook[0xe627]’ exited abnormally via signal.

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: [IOS_SYSLOG_ROW ] May 19 12:24:06 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:07 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID a1c6955f6c90ba613c0451365c915566604984e0
info: [debug] Spawning instruments with command: /Applications/Xcode2.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w a1c6955f6c90ba613c0451365c915566604984e0 com.facebook.Facebook -e UIASCRIPT “/Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:11 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [debug] [INST STDERR] 2015-05-19 12:24:07.512 instruments[31394:1307] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone kernel[0] : xpcproxy[426] Container: /private/var/mobile/Containers/Data/Application/A87CB8D7-2913-42A4-BD02-902B84C288D4 (sandbox)

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone DTMobileIS[280] : Unable to acquire task port after launch of pid 426 (com.facebook.Facebook)

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.facebook.Facebook was denied. The app must be signed with a development identity (e.g. iOS Developer).

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone com.apple.xpc.launchd[1] (UIKitApplication:com.facebook.Facebook[0x78be][426]) : Service exited due to signal: Killed: 9

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 #3
info: [debug] Killall iOS Simulator

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone DTMobileIS[280] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone notification_proxy[105] : 0x2dd000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone notification_proxy[105] : 0x2dd000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!

info: [IOS_SYSLOG_ROW ] May 19 12:24:12 Iphone SpringBoard[43] : Application ‘UIKitApplication:com.facebook.Facebook[0x78be]’ exited abnormally via signal.

info: [IOS_SYSLOG_ROW ] May 19 12:24:13 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:13 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: [IOS_SYSLOG_ROW ] May 19 12:24:13 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID a1c6955f6c90ba613c0451365c915566604984e0
info: [debug] Spawning instruments with command: /Applications/Xcode2.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w a1c6955f6c90ba613c0451365c915566604984e0 com.facebook.Facebook -e UIASCRIPT “/Users/iostrainee/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [debug] [INST STDERR] 2015-05-19 12:24:13.866 instruments[31398:4a47] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone kernel[0] : flow_divert_token_set (0): Failed to get the key unit from the token: 22

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone lockdownd[25] : Could not set socket option SO_OPPORTUNISTIC: Invalid argument

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone locationd[64] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone SpringBoard[43] : Entitlement com.apple.multitasking.termination required to kill applications.

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone kernel[0] : xpcproxy[428] Container: /private/var/mobile/Containers/Data/Application/A87CB8D7-2913-42A4-BD02-902B84C288D4 (sandbox)

info: [IOS_SYSLOG_ROW ] May 19 12:24:18 Iphone DTMobileIS[280] : Unable to acquire task port after launch of pid 428 (com.facebook.Facebook)

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.facebook.Facebook was denied. The app must be signed with a development identity (e.g. iOS Developer).

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

info: [debug] Killall instruments

info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture

info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons

info: [debug] On a real device; cannot clean device state

info: [debug] Cleaning up appium session

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

info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:389:31)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1067:12)

info: [debug] 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}
info: <-- POST /wd/hub/session 500 26268.601 ms - 182

Build the app with a developer certificate instead of the distribution one. Instruments will not run on an app that is signed with a distribution certificate.

If you don’t work for Facebook you may not be able to do this.

Is there a possibility that if I have the source code of facebook ios app, I could use that in any manner?