Problem with Appium Inspector

I apologize in advanced if anything I post involves noob-worthy errors/fixes, I am very new to not only appium but coding in general. If there is anything I am doing wrong in terms of how I am approaching the community for help, whether it be related to conventional practices, or online manners, I’d be so grateful to be educated on what I am doing wrong or how I can do it better.

I have Appium installed hopefully correctly, according to the online tutorial. The only aspect of my installation that may be causing the issue I am experiencing is that at the end of the process after running reset.sh, I failed to authorize with the command

sudo ‘which grunt’; authorize

because when I did I got

sudo: which grunt: command not found
-bash: authorize: command not found

and was advised to move on from it. Still, Appium Doctor checks out fine.

I give the iOS settings only three things, the App Path to the .app file which I built through Xcode Archive and extracted from its Package contents onto my desktop (with the App Path box checked), the device which I have set to iPhone 5 (with the Force Device box checked), and Platform Version which I have set to 7.1. I change nothing else.

When I launch, it seems to be working without issue. When I click Appium Inspector I get issues.

Here’s the log:

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --command-timeout “7200” --debug-log-spacing --platform-version “7.1” --platform-name “iOS” --app “/Users/chrisjang/Desktop/StarMaker.app” --device-name “iPhone 5”

info: Welcome to Appium v1.4.1 (REV ce62208)

info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {“app”:"/Users/chrisjang/Desktop/StarMaker.app",“deviceName”:“iPhone 5”,“platformName”:“iOS”,“platformVersion”:“7.1”,“defaultCommandTimeout”:7200,“debugLogSpacing”:true}
info: Console LogLevel: debug

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

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

info: <-- GET /wd/hub/status 200 8.900 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}

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

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

info: <-- GET /wd/hub/status 200 4.165 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}
info: <-- GET /wd/hub/status 200 0.996 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {“status”:0,“value”:[]}
info: <-- GET /wd/hub/sessions 200 0.955 ms - 23 {“status”:0,“value”:[]}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“platformVersion”:“7.1”,“newCommandTimeout”:“999999”,“automationName”:“Appium”,“deviceName”:“iPhone 5”}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.3.13 Darwin/14.3.0 (x86_64)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] Using local app from command line: /Users/chrisjang/Desktop/StarMaker.app
info: [debug] Creating new appium session 21260728-33e2-45fe-a09e-fa68e8f246cb

info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version

info: [debug] Xcode version set to 6.3.2

info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 8.3
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports

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

info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 5”,“platformVersion”:“7.1”}

info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (7.1 Simulator)’
info: [debug] iOS sim UDID is 4916BB67-BEA2-4756-A841-3DC4E08CFEB9
info: [debug] Auto-detecting iOS udid…
info: [debug] Not auto-detecting udid, running on sim

info: [debug] Could not parse plist file (as binary) at /Users/chrisjang/Desktop/StarMaker.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Users/chrisjang/Desktop/StarMaker.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/chrisjang/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”:“oneByOne”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js
info: [debug] Reusing dynamic bootstrap: /Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 5”,“platformVersion”:“7.1”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (7.1 Simulator)’

info: [debug] We’re on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 5”,“platformVersion”:“7.1”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (7.1 Simulator)’
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Killall iOS Simulator

info: [debug] Cleaning sim data files
info: Executing: xcrun simctl erase 4916BB67-BEA2-4756-A841-3DC4E08CFEB9 with timeout 2000

info: [debug] Cleaning app data files

warn: Applications directory /Users/chrisjang/Library/Developer/CoreSimulator/Devices/4916BB67-BEA2-4756-A841-3DC4E08CFEB9/data/Applications doesn’t exist. Have you run this simulator before?
info: Couldn’t find app directories to delete. Probably it’s not installed
info: [debug] Not setting locale

info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 8.* simulator log capture

info: [debug] Not pre-launching simulator
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 iPhone 5 (7.1 Simulator)
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 “iPhone 5 (7.1 Simulator)” /Users/chrisjang/Desktop/StarMaker.app -e UIASCRIPT “/Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [debug] [INST] Waiting for device to boot…

This opens the simulator, but the app fails to launch. I get a yellow exclamation window with the message: Exception encountered connecting to CoreSimulatorBridge: connection went invalid while waiting for a reply. When I exit the inspector function, I get an error window with the Appium icon titled “Could Not Launch Appium Inspector” with the message “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.”

Unfortunately these settings are not the only parameters I need working, I changed the device to iPhone 6 and version to 8.1.

Here’s the log for this change:

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --command-timeout “7200” --debug-log-spacing --platform-version “8.1” --platform-name “iOS” --app “/Users/chrisjang/Desktop/StarMaker.app” --device-name “iPhone 6”

info: Welcome to Appium v1.4.1 (REV ce62208)

info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {“app”:"/Users/chrisjang/Desktop/StarMaker.app",“deviceName”:“iPhone 6”,“platformName”:“iOS”,“platformVersion”:“8.1”,“defaultCommandTimeout”:7200,“debugLogSpacing”:true}
info: Console LogLevel: debug

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

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

info: <-- GET /wd/hub/status 200 9.757 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}
info: <-- GET /wd/hub/status 200 3.706 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {“status”:0,“value”:[]}
info: <-- GET /wd/hub/sessions 200 1.060 ms - 23 {“status”:0,“value”:[]}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“platformVersion”:“8.1”,“newCommandTimeout”:“999999”,“automationName”:“Appium”,“deviceName”:“iPhone 6”}}

info: Client User-Agent string: Appium (unknown version) CFNetwork/720.3.13 Darwin/14.3.0 (x86_64)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] Using local app from command line: /Users/chrisjang/Desktop/StarMaker.app
info: [debug] Creating new appium session 48a06fe4-225c-49d1-95c2-939cdaffb614
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version

info: [debug] Xcode version set to 6.3.2

info: [debug] Setting iOS SDK Version

info: [debug] iOS SDK Version set to 8.3
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.1”}

info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.1 Simulator)’
info: [debug] iOS sim UDID is 2E127FC0-3EA1-46F6-B51E-0043CDA9CC7B
info: [debug] Auto-detecting iOS udid…
info: [debug] Not auto-detecting udid, running on sim

info: [debug] Could not parse plist file (as binary) at /Users/chrisjang/Desktop/StarMaker.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Users/chrisjang/Desktop/StarMaker.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/chrisjang/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”:“oneByOne”}

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

info: [debug] Dynamic bootstrap path: /Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js
info: [debug] Reusing dynamic bootstrap: /Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.1”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.1 Simulator)’
info: [debug] We’re on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.3.2”,“iOSSDKVersion”:“8.3”,“deviceName”:“iPhone 6”,“platformVersion”:“8.1”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.1 Simulator)’
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Killall iOS Simulator

info: [debug] Cleaning sim data files

info: Executing: xcrun simctl erase 2E127FC0-3EA1-46F6-B51E-0043CDA9CC7B with timeout 2000

info: [debug] Cleaning app data files

warn: Applications directory /Users/chrisjang/Library/Developer/CoreSimulator/Devices/2E127FC0-3EA1-46F6-B51E-0043CDA9CC7B/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?
warn: Applications directory /Users/chrisjang/Library/Developer/CoreSimulator/Devices/2E127FC0-3EA1-46F6-B51E-0043CDA9CC7B/data/Containers/Bundle/Application doesn’t exist. Have you run this simulator before?
info: Couldn’t find app directories to delete. Probably it’s not installed
info: [debug] Not setting locale
info: [debug] No iOS / app preferences to set

info: [debug] Starting iOS 8.* simulator log capture

info: [debug] Not pre-launching simulator
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 iPhone 6 (8.1 Simulator)
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 “iPhone 6 (8.1 Simulator)” /Users/chrisjang/Desktop/StarMaker.app -e UIASCRIPT “/Users/chrisjang/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [debug] [INST] Waiting for device to boot…

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”},“isShuttingDown”:false},“sessionId”:“48a06fe4-225c-49d1-95c2-939cdaffb614”}
info: <-- GET /wd/hub/status 200 1.342 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”},“isShuttingDown”:false},“sessionId”:“48a06fe4-225c-49d1-95c2-939cdaffb614”}

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

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

In this case, the simulator opens, and the app again fails to run, but instead of an error window I get sent into a loop in which the simulator tries to open the app but fails after 1-2 seconds before it tries again. I need to stop the inspector function, and I get the same window titled “Could Not Launch Appium Inspector”.

These all seem to be relatively generic errors, but again I am very new to this and have bad trouble shooting skills. I have copypasted the numerous warning and error messages I have gotten from this process (some that I didn’t even post here) into google, and the issues and fixes discussed that I was able to find had little to do with my situation. Any sort of assistance, advice, or suggestions for a beginner is beyond appreciated and not taken for granted, just trying to learn as much as I can.

I am all ears, thank you all in advanced.