0

My app contains over 200 text files (all 62 MB). After build succeeds and Xcode tries to install the project on my physical device (iPhone 6), it quits suddenly when it begins to transfer the text files (I know because they appear on the Xcode top status bar). When trying to run the project with fewer files (6 text files), it does not crash.

I tried to delete the project derived data, restart xcode and macbook, and delete the app on the iPhone, but the same always happened. Also, I have more than 11 GB available in my iPhone.

However, it runs with no problems on Simulater.

Process:               Xcode [1693]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               9.1 (13532)
Build Info:            IDEFrameworks-13532000000000000~5
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [1693]
User ID:               501

Date/Time:             2018-07-18 23:27:20.164 +0300
OS Version:            Mac OS X 10.13.3 (17D47)
Report Version:        12
Anonymous UUID:        F86CE6FC-6791-13E2-08EE-2C18E129C049

Sleep/Wake UUID:       C1AA39D2-74B1-4F76-B3B5-30EA72EE611F

Time Awake Since Boot: 12000 seconds
Time Since Wake:       3800 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 9B55
UNCAUGHT EXCEPTION (NSRangeException): -[__NSCFString substringWithRange:]: Range {0, 86} out of bounds; string length 84
UserInfo: (null)
Hints: 

Backtrace:
  0   __exceptionPreprocess (in CoreFoundation)
  1   DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2   objc_exception_throw (in libobjc.A.dylib)
  3   +[NSException raise:format:] (in CoreFoundation)
  4   -[__NSCFString substringWithRange:] (in CoreFoundation)
  5   IDETruncatedStringForStringSegmentsAndMaximumWidthWithDefaultAttributes (in IDEKit)
  6   -[IDEActivityScrollingTextLayer attributedStringValueTruncatedToWidth:] (in IDEKit)
  7   -[IDEActivityScrollingTextLayer updateTextLayerWithContext:animateUpdate:] (in IDEKit)
  8   -[IDEActivityScrollingTextLayer setStringSegments:context:animateUpdate:] (in IDEKit)
  9   -[IDEActivityReportLayer _updateStringSegments:] (in IDEKit)
 10   __55-[IDEActivityReportLayer _startObservingActivityReport]_block_invoke (in IDEKit)
 11   -[DVTObservingBlockToken observeValueForKeyPath:ofObject:change:context:] (in DVTFoundation)
 12   NSKeyValueNotifyObserver (in Foundation)
 13   NSKeyValueDidChange (in Foundation)
 14   -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] (in Foundation)
 15   -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation)
 16   _NSSetObjectValueAndNotify (in Foundation)
 17   __43-[IDEDeviceOperationReport _setupObservers]_block_invoke_2.176 (in IDEKit)
 18   __DVTDispatchAsync_block_invoke (in DVTFoundation)
 19   _dispatch_call_block_and_release (in libdispatch.dylib)
 20   _dispatch_client_callout (in libdispatch.dylib)
 21   _dispatch_main_queue_callback_4CF (in libdispatch.dylib)
 22   __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation)
 23   __CFRunLoopRun (in CoreFoundation)
 24   CFRunLoopRunSpecific (in CoreFoundation)
 25   RunCurrentEventLoopInMode (in HIToolbox)
 26   ReceiveNextEventCommon (in HIToolbox)
 27   _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 28   _DPSNextEvent (in AppKit)
 29   -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
 30   -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 31   -[NSApplication run] (in AppKit)
 32   NSApplicationMain (in AppKit)
 33   start (in libdyld.dylib)

abort() called

Application Specific Signatures:
NSRangeException

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff516cc33b __exceptionPreprocess + 171
1   DVTFoundation                       0x000000010708baa8 DVTFailureHintExceptionPreprocessor + 274
2   libobjc.A.dylib                     0x00007fff78424942 objc_exception_throw + 48
3   CoreFoundation                      0x00007fff5175c5a5 +[NSException raise:format:] + 197
4   CoreFoundation                      0x00007fff51621153 -[__NSCFString substringWithRange:] + 163
5   IDEKit                              0x0000000108d07cf5 IDETruncatedStringForStringSegmentsAndMaximumWidthWithDefaultAttributes + 969
6   IDEKit                              0x0000000108ad4b8f -[IDEActivityScrollingTextLayer attributedStringValueTruncatedToWidth:] + 81
7   IDEKit                              0x0000000108ad47ec -[IDEActivityScrollingTextLayer updateTextLayerWithContext:animateUpdate:] + 68
8   IDEKit                              0x0000000108ad4fd0 -[IDEActivityScrollingTextLayer setStringSegments:context:animateUpdate:] + 150
9   IDEKit                              0x0000000108ce77aa -[IDEActivityReportLayer _updateStringSegments:] + 221
10  IDEKit                              0x0000000108ce88cc __55-[IDEActivityReportLayer _startObservingActivityReport]_block_invoke + 238
11  DVTFoundation                       0x00000001070a0e36 -[DVTObservingBlockToken observeValueForKeyPath:ofObject:change:context:] + 610
12  Foundation                          0x00007fff5374e769 NSKeyValueNotifyObserver + 350
13  Foundation                          0x00007fff5374e01d NSKeyValueDidChange + 475
14  Foundation                          0x00007fff5388b076 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 769
15  Foundation                          0x00007fff537197c5 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 61
16  Foundation                          0x00007fff53778d81 _NSSetObjectValueAndNotify + 262
17  IDEKit                              0x0000000108af2220 __43-[IDEDeviceOperationReport _setupObservers]_block_invoke_2.176 + 287
18  DVTFoundation                       0x00000001070e1742 __DVTDispatchAsync_block_invoke + 97
19  libdispatch.dylib                   0x00007fff78fdf591 _dispatch_call_block_and_release + 12
20  libdispatch.dylib                   0x00007fff78fd7d50 _dispatch_client_callout + 8
21  libdispatch.dylib                   0x00007fff78fe332d _dispatch_main_queue_callback_4CF + 1148
22  CoreFoundation                      0x00007fff51685b49 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
23  CoreFoundation                      0x00007fff5164843a __CFRunLoopRun + 2586
24  CoreFoundation                      0x00007fff51647787 CFRunLoopRunSpecific + 487
25  HIToolbox                           0x00007fff50954e26 RunCurrentEventLoopInMode + 286
26  HIToolbox                           0x00007fff50954b96 ReceiveNextEventCommon + 613
27  HIToolbox                           0x00007fff50954914 _BlockUntilNextEventMatchingListInModeWithFilter + 64
28  AppKit                              0x00007fff4ec1ff5f _DPSNextEvent + 2085
29  AppKit                              0x00007fff4f3b5b4c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
30  DVTKit                              0x000000010769798e -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 390
31  AppKit                              0x00007fff4ec14d6d -[NSApplication run] + 764
32  AppKit                              0x00007fff4ebe3f1a NSApplicationMain + 804
33  libdyld.dylib                       0x00007fff79011115 start + 1

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff79160e3e __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff7929f150 pthread_kill + 333
2   libsystem_c.dylib               0x00007fff790bd312 abort + 127
3   com.apple.dt.IDEKit             0x00000001089f617e +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 1370
4   com.apple.dt.IDEKit             0x00000001089f798a -[IDEAssertionHandler handleUncaughtException:] + 1099
5   com.apple.dt.IDEKit             0x00000001089f7a5c IDEHandleUncaughtException + 94
6   com.apple.CoreFoundation        0x00007fff5175c992 __handleUncaughtException + 770
7   libobjc.A.dylib                 0x00007fff78426a41 _objc_terminate() + 91
8   libc++abi.dylib                 0x00007fff770b77c9 std::__terminate(void (*)()) + 8
9   libc++abi.dylib                 0x00007fff770b7843 std::terminate() + 51
10  libdispatch.dylib               0x00007fff78fd7d64 _dispatch_client_callout + 28
11  libdispatch.dylib               0x00007fff78fe332d _dispatch_main_queue_callback_4CF + 1148
12  com.apple.CoreFoundation        0x00007fff51685b49 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13  com.apple.CoreFoundation        0x00007fff5164843a __CFRunLoopRun + 2586
14  com.apple.CoreFoundation        0x00007fff51647787 CFRunLoopRunSpecific + 487
15  com.apple.HIToolbox             0x00007fff50954e26 RunCurrentEventLoopInMode + 286
16  com.apple.HIToolbox             0x00007fff50954b96 ReceiveNextEventCommon + 613
17  com.apple.HIToolbox             0x00007fff50954914 _BlockUntilNextEventMatchingListInModeWithFilter + 64
18  com.apple.AppKit                0x00007fff4ec1ff5f _DPSNextEvent + 2085
19  com.apple.AppKit                0x00007fff4f3b5b4c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
20  com.apple.dt.DVTKit             0x000000010769798e -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 390
21  com.apple.AppKit                0x00007fff4ec14d6d -[NSApplication run] + 764
22  com.apple.AppKit                0x00007fff4ebe3f1a NSApplicationMain + 804
23  libdyld.dylib                   0x00007fff79011115 start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff791577c2 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff79156cdc mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff51648dc5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation        0x00007fff51648117 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation        0x00007fff51647787 CFRunLoopRunSpecific + 487
5   com.apple.Foundation            0x00007fff53733c16 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
6   com.apple.DTDeviceKitBase       0x00000001143aa7c8 +[DTDKRemoteDeviceConnection startServiceBrowsers] + 217
7   com.apple.Foundation            0x00007fff53741ee8 __NSThread__start__ + 1197
8   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
9   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
10  libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 2:
0   libsystem_kernel.dylib          0x00007fff791577c2 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff79156cdc mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff51648dc5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation        0x00007fff51648117 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation        0x00007fff51647787 CFRunLoopRunSpecific + 487
5   com.apple.Foundation            0x00007fff53733c16 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
6   com.apple.DTDeviceKitBase       0x00000001143b8c72 -[DTDKRemoteDeviceDataListener listenerThreadImplementation] + 1524
7   com.apple.Foundation            0x00007fff53741ee8 __NSThread__start__ + 1197
8   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
9   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
10  libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 3:: com.apple.CFSocket.private
0   libsystem_kernel.dylib          0x00007fff79160fca __select + 10
1   com.apple.CoreFoundation        0x00007fff5168278b __CFSocketManager + 635
2   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
3   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
4   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff79160cee __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff7929d662 _pthread_cond_wait + 732
2   libc++.1.dylib                  0x00007fff77049cb0 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
3   com.apple.JavaScriptCore        0x00007fff551a5b16 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 86
4   com.apple.JavaScriptCore        0x00007fff551a5a4b bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 139
5   com.apple.JavaScriptCore        0x00007fff551a5d78 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 40
6   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
7   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
8   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff791577c2 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff79156cdc mach_msg + 60
2   com.apple.spotlight.index       0x00007fff73b8ac67 _handleExceptions + 111
3   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
4   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
5   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 6:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff791577c2 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff79156cdc mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff51648dc5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation        0x00007fff51648117 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation        0x00007fff51647787 CFRunLoopRunSpecific + 487
5   com.apple.AppKit                0x00007fff4ed5d3c8 _NSEventThread + 184
6   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
7   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
8   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 7:: DYMobileDeviceManager
0   libsystem_kernel.dylib          0x00007fff791577c2 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff79156cdc mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff51648dc5 __CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation        0x00007fff51648117 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation        0x00007fff51647787 CFRunLoopRunSpecific + 487
5   com.apple.Foundation            0x00007fff53733c16 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
6   com.apple.Foundation            0x00007fff53733aee -[NSRunLoop(NSRunLoop) run] + 76
7   com.apple.GPUToolsMobileFoundation  0x000000011d82f28a -[DYMobileDeviceManager _deviceNotificationThread:] + 134
8   com.apple.Foundation            0x00007fff53741ee8 __NSThread__start__ + 1197
9   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
10  libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
11  libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff79160cee __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff7929d662 _pthread_cond_wait + 732
2   com.apple.Xcode.DevToolsCore    0x0000000113dd5d25 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 596
3   com.apple.Foundation            0x00007fff53741ee8 __NSThread__start__ + 1197
4   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
5   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
6   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 9:
0   libsystem_kernel.dylib          0x00007fff79160cee __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff7929d662 _pthread_cond_wait + 732
2   com.apple.Xcode.DevToolsCore    0x0000000113dd5d25 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 596
3   com.apple.Foundation            0x00007fff53741ee8 __NSThread__start__ + 1197
4   libsystem_pthread.dylib         0x00007fff7929c6c1 _pthread_body + 340
5   libsystem_pthread.dylib         0x00007fff7929c56d _pthread_start + 377
6   libsystem_pthread.dylib         0x00007fff7929bc5d thread_start + 13

Thread 10:: Dispatch queue: -[IDEExecutionEnvironment initWithWorkspaceArena:] (QOS: UNSPECIFIED)
0   libsystem_kernel.dylib          0x00007fff79160cee __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff7929d662 _pthread_cond_wait + 732
2   com.apple.Foundation            0x00007fff537fcd98 -[__NSOperationInternal _waitUntilFinished:] + 896
3   com.apple.Foundation            0x00007fff537cd805 -[NSOperationQueue waitUntilAllOperationsAreFinished] + 296
4   com.apple.dt.DVTFoundation      0x0000000106f747d4 -[DVTOperationGroup main] + 66
5   com.apple.Foundation            0x00007fff5374d5de -[__NSOperationInternal _start:] + 778
6   com.apple.dt.DVTFoundation      0x0000000106f74787 -[DVTOperationGroup start] + 110
7   com.apple.Foundation            0x00007fff53749607 __NSOQSchedule_f + 369
8   libdispatch.dylib               0x00007fff78fd7d50 _dispatch_client_callout + 8
9   libdispatch.dylib               0x00007fff78feae76 _dispatch_continuation_pop + 472
10  libdispatch.dylib               0x00007fff78fe26cb _dispatch_async_redirect_invoke + 703
11  libdispatch.dylib               0x00007fff78fd9941 _dispatch_root_queue_drain + 515
12  libdispatch.dylib               0x00007fff78fd96ed _dispatch_worker_thread3 + 101
13  libsystem_pthread.dylib         0x00007fff7929c1ca _pthread_wqthread + 1387
14  libsystem_pthread.dylib         0x00007fff7929bc4d start_wqthread + 13

Thread 11:: Dispatch queue: com.apple.root.default-qos
0   libsystem_kernel.dylib          0x00007fff79160f0a __recvfrom + 10
1   com.apple.mobiledevice          0x00007fff6cbcc75d AMDServiceConnectionReceive + 156
2   com.apple.mobiledevice          0x00007fff6cbcc9c3 AMDServiceConnectionReceiveMessage + 123
3   com.apple.mobiledevice          0x00007fff6cb10907 _MonitorResultDispatchFunction + 266
4   libdispatch.dylib               0x00007fff78fd7d50 _dispatch_client_callout + 8
5   libdispatch.dylib               0x00007fff78fd9ac4 _dispatch_root_queue_drain + 902
6   libdispatch.dylib               0x00007fff78fd96ed _dispatch_worker_thread3 + 101
7   libsystem_pthread.dylib         0x00007fff7929c1ca _pthread_wqthread + 1387
8   libsystem_pthread.dylib         0x00007fff7929bc4d start_wqthread + 13

Thread 12:: Dispatch queue: ConcurrentQueue: -[IDEInstalliPhoneLauncher performWorkerAction]_block_invoke
0   libsystem_kernel.dylib          0x00007fff791577fe semaphore_wait_trap + 10
1   libdispatch.dylib               0x00007fff78fe782e _dispatch_sema4_wait + 16
2   libdispatch.dylib               0x00007fff78fdce01 _dispatch_group_wait_slow + 151
3   com.apple.dt.IDE.IDEiOSSupportCore  0x00000001142a6461 -[DVTiOSDevice(DVTiPhoneApplicationInstallation) installApplicationsSync:options:] + 274
4   com.apple.dt.IDE.IDEiOSSupportCore  0x00000001142a66c7 -[DVTiOSDevice(DVTiPhoneApplicationInstallation) installApplicationSync:options:] + 137
5   com.apple.dt.IDE.IDEiOSSupportCore  0x0000000114296a37 -[DVTiOSDevice(Connect) installForMobileInstallWithSession:error:] + 3695
6   com.apple.dt.IDE.IDEiOSSupportCore  0x000000011429d197 -[DVTiOSDevice(Connect) installApplicationWithLaunchSession:error:] + 2004
7   com.apple.dt.IDE.IDEiOSSupportCore  0x00000001142b8c11 __47-[IDEInstalliPhoneLauncher performWorkerAction]_block_invoke + 79
8   com.apple.dt.DVTFoundation      0x00000001070e1a07 __DVTDispatchAsync_block_invoke + 806
9   libdispatch.dylib               0x00007fff78fdf591 _dispatch_call_block_and_release + 12
10  libdispatch.dylib               0x00007fff78fd7d50 _dispatch_client_callout + 8
11  libdispatch.dylib               0x00007fff78feae76 _dispatch_continuation_pop + 472
12  libdispatch.dylib               0x00007fff78fe26cb _dispatch_async_redirect_invoke + 703
13  libdispatch.dylib               0x00007fff78fd9941 _dispatch_root_queue_drain + 515
14  libdispatch.dylib               0x00007fff78fd96ed _dispatch_worker_thread3 + 101
15  libsystem_pthread.dylib         0x00007fff7929c1ca _pthread_wqthread + 1387
16  libsystem_pthread.dylib         0x00007fff7929bc4d start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007fffb1d26340  rcx: 0x00007ffee8df4128  rdx: 0x0000000000000000
  rdi: 0x0000000000000307  rsi: 0x0000000000000006  rbp: 0x00007ffee8df4160  rsp: 0x00007ffee8df4128
   r8: 0x00007fffab73a278   r9: 0x00007fffab740750  r10: 0x0000000000000000  r11: 0x0000000000000206
  r12: 0x0000000000000307  r13: 0x0000000000000000  r14: 0x0000000000000006  r15: 0x000000000000002d
  rip: 0x00007fff79160e3e  rfl: 0x0000000000000206  cr2: 0x00007fffb1d04148

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133

The exception thrown is RangeException, though it builds successfully and begin to install it on the connected device, during which the crash took place.

Any Idea to prevent this?

Specs: Xcode 9 - iPhone 6 - ios 11 - MacBook Mid 2010 - macOS High Sierra

Ali_Habeeb
  • 205
  • 2
  • 9
  • Report it to Apple: https://bugreport.apple.com/web/ This is an excellent use case and you should have no trouble sending Apple a reproducible example. – matt Jul 18 '18 at 21:37
  • @matt Thanks. I did as you told, but I don't think they will response or react soon. – Ali_Habeeb Jul 21 '18 at 15:30
  • They probably won't, but the point is, this is not a question we can answer, it's an issue in Xcode itself. For now, the only solution is, don't do that. I can think of various experiments you might try as workarounds, but so can you, and none of them would be an answer because I'd just be guessing something to try. – matt Jul 21 '18 at 15:36
  • First thing I'd try is updating to Xcode 10 beta. Does the problem still exist there? – matt Jul 21 '18 at 15:37
  • Second thing I'd try is arranging the text files in some other way. You have not said how they are arranged now, so it's impossible for me to specific (in fact, your question gave basically no info about your project: "contains over 200 text files" is very vague). For example, are they at the base level of your app bundle? If so, don't do that; put them in a folder reference so that only _one_ thing needs to be copied (the folder). Here's how to make a folder reference: https://stackoverflow.com/a/48758433/341994 – matt Jul 21 '18 at 15:39
  • @matt I have updated Xcode to 9.4.1 yesterday, and the problem still persists. In fact, It seems to be slower! Regarding the text files, I was just thinking of the way they are stored that this might be the problem. They are basically data files (Arabic text, each ranging from few KB to nearly 2 MB in size) from which I can retrieve information to put in a tableView. I put them in a blue folder instead of yellow one (I thought it might be easier to loop through them this way, and add more similar files manually). – Ali_Habeeb Jul 21 '18 at 17:55
  • I still think that number of the files matters, because the app runs peacefully when they are less than 10 files. My account is free, so maybe the other paid accounts have more advantages over the free ones (allow for more files, for example)? – Ali_Habeeb Jul 21 '18 at 17:59

1 Answers1

0

It turns out that the filenames of the text files were too long (most have more than 80 characters). I changed the filenames to shorter ones, and everything was OK. I got the clue from the Exception thrown from the report (RangeException).

Still do not know why it is installed without problems on simulator. (device-related bug?)

I still think that it is a bug in Xcode, little bug that cost me more than a month to figure out the problem.

Ali_Habeeb
  • 205
  • 2
  • 9