Appium Crashes randomly

My app will randomly crash and report this issue:

info: [debug] [INST STDERR] 2016-06-08 15:24:43.779 instruments[983:16188] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFString hasPrefix:]: nil argument’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9af3bae2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8dcf2f7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff9af3b98d +[NSException raise:format:] + 205
3 CoreFoundation 0x00007fff9ae33df0 -[__NSCFString hasPrefix:] + 96
4 InstrumentsPlugIn 0x00000001021e9800 __bestDeviceMatchblock_invoke + 502
5 libdispatch.dylib 0x00007fff960dc33f dispatchclient_callout + 8
6 libdispatch.dylib 0x00007fff960eaa9b dispatchbarrier_sync_f_slow + 856
7 InstrumentsPlugIn 0x00000001021e95c4 _bestDeviceMatch + 233
8 InstrumentsPlugIn 0x00000001021e9a16 +[XRDeviceDiscovery devicesMatching:] + 57
9 instruments 0x0000000101e9e735 instruments + 10037
10 instruments 0x0000000101ea29ef instruments + 27119
11 libdyld.dylib 0x00007fff90f8b5ad start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I am using Appium 1.4.13 and am using OS 10.11.3.

Any help would be appreciated, as this problem has been a very big issue for a while!

1 Like

You’ve found a bug in the app you are testing. You should file a bug on it.

I know this is an old one, but I figured that someone would run in to the same issue as me.

Make sure that all the connected devices is “trusted” to the computer. Even if you don’t use them as the current test device it will be causing issues if they are connected and “untrusted”.