2

My app runs all fine when it is connected to Xcode. (I am using Xcode 10.1) But as soon as i disconnect the device and launch the app again (by tapping on icon) splash screen appears and the app closes. This is not an actual crash because the app works fine when connected with wire. I also have Crashlytics integrated in my app and there are no crashes on it's dashboard too.

Things I have tried:

  1. Clean and build the code.
  2. Restart the device.
  3. Go to window -> devices and simulators and tried to check device logs (as App crash when cable disconnected from Mac suggests) but I did not find anything there.

Here are the logs:

Date/Time: 2018-12-07 12:36:24 +0500 End time: 2018-12-07 12:36:26 +0500 OS Version: iPhone OS 12.0.1 (Build 16A404) Architecture: arm64 Report Version: 27 Incident Identifier: 4DAE256F-7C3C-4CF5-A670-BD0FA2498CA5

Data Source: Microstackshots Shared Cache: 0x8fe0000 5D8B6846-4668-3CAC-9CC4-4A762D54BE9E

Command: Cuufy Path:
/private/var/containers/Bundle/Application/EDAA1D65-BB6F-4722-8619-FDFED10DC045/Cuufy.app/Cuufy Identifier: com.cuufyLLC.cuufy Version: 1.3 (1) Beta Identifier: A032A60E-406C-442D-836A-80540F61ADCA PID: 2478

Event: wakeups Action taken: none Wakeups: 45001 wakeups over the last 141 seconds (318 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds Wakeups limit: 45000 Limit duration: 300s Wakeups caused: 45001 Duration: 1.99s Steps: 3

Hardware model: iPhone9,1 Active cpus: 2 Boot args:

Heaviest stack for the target process: 3 ??? (libsystem_pthread.dylib + 49392) [0x189ad20f0] 3 ??? (libdispatch.dylib + 73472) [0x1898a0f00] 3 ??? (libdispatch.dylib + 38752) [0x189898760] 3 ??? (libdispatch.dylib + 35864) [0x189897c18] 3 ??? (libdispatch.dylib + 398468) [0x1898f0484] 3 ??? (libdispatch.dylib + 394952) [0x1898ef6c8] 3 ??? (<38F5549F-536E-3252-B54B-8CA43AD79EB0> + 59736) [0x101a6e958] 2 ??? (<38F5549F-536E-3252-B54B-8CA43AD79EB0> + 61980) [0x101a6f21c] 2 ??? (libsystem_c.dylib + 480420) [0x1899c24a4] 1 ??? (libsystem_kernel.dylib + 144424) [0x189a4d428]

Powerstats for: Cuufy [2478] UUID:
907E938F-A407-382A-BFE9-BB62948993A1 Path:
/private/var/containers/Bundle/Application/EDAA1D65-BB6F-4722-8619-FDFED10DC045/Cuufy.app/Cuufy Architecture: arm64 Parent: UNKNOWN [1] UID:
501 Footprint: 202.73 MB Start time: 2018-12-07 12:36:24 +0500 End time: 2018-12-07 12:36:26 +0500 Num samples: 3 (100%) CPU Time: 1.501s Primary state: 2 samples Frontmost App, Non-Suppressed, User mode, Effective Thread QoS User Initiated, Requested Thread QoS User Initiated, Override Thread QoS Unspecified User Activity: 0 samples Idle, 0 samples Active, 3 samples Unknown Power Source: 0 samples on Battery, 0 samples on AC, 3 samples Unknown 3 _pthread_wqthread + 311 (libsystem_pthread.dylib + 49392) [0x189ad20f0] 3 _dispatch_workloop_worker_thread + 599 (libdispatch.dylib + 73472) [0x1898a0f00] 3 _dispatch_lane_invoke$VARIANT$mp + 431 (libdispatch.dylib + 38752) [0x189898760] 3 _dispatch_lane_serial_drain$VARIANT$mp + 591 (libdispatch.dylib + 35864) [0x189897c18] 3 _dispatch_client_callout + 15 (libdispatch.dylib + 398468) [0x1898f0484] 3 _dispatch_call_block_and_release + 23 (libdispatch.dylib + 394952) [0x1898ef6c8] 3 thunk for @escaping @callee_guaranteed -> () (WebSocket.swift:0) (WebSocket.swift:0 in Starscream + 59736) [0x101a6e958] 2 closure #1 in FoundationStream.connect (WebSocket.swift:209) (WebSocket.swift:209 in Starscream + 61980) [0x101a6f21c] 2 usleep + 63 (libsystem_c.dylib + 480420) [0x1899c24a4] 1 __semwait_signal + 8 (libsystem_kernel.dylib + 144424) [0x189a4d428] 1 1 nanosleep + 211 (libsystem_c.dylib + 480720) [0x1899c25d0] 1 __semwait_signal + 23 (libsystem_kernel.dylib + 144440) [0x189a4d438] 1 _pthread_exit_if_canceled + 0 (libsystem_pthread.dylib + 52556) [0x189ad2d4c] 1 closure #1 in FoundationStream.connect (WebSocket.swift:216) (WebSocket.swift:216 in Starscream + 62020) [0x101a6f244] 1 CFWriteStreamCopyError + 0 (CoreFoundation + 772364) [0x189e5690c]

Binary Images: 0x100524000 - ??? Cuufy <907E938F-A407-382A-BFE9-BB62948993A1> /private/var/containers/Bundle/Application/EDAA1D65-BB6F-4722-8619-FDFED10DC045/Cuufy.app/Cuufy 0x101a60000 - ??? ??? <38F5549F-536E-3252-B54B-8CA43AD79EB0> Starscream 0x18988f000 - 0x1898fffff libdispatch.dylib /usr/lib/system/libdispatch.dylib 0x18994d000 - 0x1899cbfff libsystem_c.dylib <40DD5C3B-586A-38EB-9F52-74D994ECD9D2> /usr/lib/system/libsystem_c.dylib 0x189a2a000 - 0x189a54fff libsystem_kernel.dylib <982CCBAD-717D-3A28-946E-BA07918897A3> /usr/lib/system/libsystem_kernel.dylib 0x189ac6000 - 0x189ad6fff libsystem_pthread.dylib /usr/lib/system/libsystem_pthread.dylib 0x189d9a000 - 0x18a0fffff CoreFoundation /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

kinza
  • 415
  • 6
  • 28

2 Answers2

0

I think this has something to do with the usage of the Starscream Websocket library and/or the network connectivity of the device.

While the device is running in the simulator, it uses the network connection of your Mac(Book/Pro/etc.); when it is running on it's own, it uses the wifi/cellular connection of the device.

Therefore, I think you'll just face some high latancy due to the devices connectivity.

  • Check the network connectivity
  • Try to disable (comment) the Starscrem usages and check if the application is starting
  • Check if the UI is waiting for network data before displaying anything
Andreas Oetjen
  • 8,386
  • 1
  • 18
  • 30
0

In my code in splash screen I was trying to access environment variable of the scheme set on the basis of which I was setting some views. Those variables were accessible when the device was connected with wire but returning nil when device was not connected (I would appreciate if anyone clears the reason for this) So to solve this I deleted the schemes and created targets instead, set custom flags (to base the work i was previously doing with environment variables) and then accessed them as described in second answer of this question.

kinza
  • 415
  • 6
  • 28