File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ adb uninstall io.bitdrift.capture.helloworld || true
66adb install android_app.apk
77adb shell am start -n io.bitdrift.capture.helloworld/.MainActivity
88
9- while ! adb logcat -d | grep -q -e ' Capture Logger has been running for 15000 ms' ; do
9+ timeout_seconds=30
10+ elapsed=0
11+ while ! adb logcat -d | grep -q -e ' Capture SDK properly initialized' ; do
12+ if [ " $elapsed " -ge " $timeout_seconds " ]; then
13+ echo " Timeout after ${timeout_seconds} s waiting for Capture SDK init log"
14+ exit 1
15+ fi
1016 sleep 1
17+ elapsed=$(( elapsed + 1 ))
1118done
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class HelloWorldApp : Application() {
5050 Log .v(" HelloWorldApp" , " Android Bitdrift app launched with session url=${Logger .sessionUrl} " )
5151
5252 Handler (Looper .getMainLooper()).postDelayed({
53- Log .i(" HelloWorldApp" , " Capture Logger has been running for $kLoggerRunningDurationThreshold ms " )
53+ Log .i(" HelloWorldApp" , getCaptureSdkInitializedMessage() )
5454 }, kLoggerRunningDurationThreshold)
5555 }
5656
@@ -61,4 +61,17 @@ class HelloWorldApp : Application() {
6161 ogHandler?.uncaughtException(thread, throwable)
6262 }
6363 }
64+
65+ private fun getCaptureSdkInitializedMessage ():String {
66+ return if (Logger .sessionUrl != null ) {
67+ SDK_STARTED_MESSAGE
68+ } else {
69+ SDK_NOT_STARTED_MESSAGE
70+ }
71+ }
72+
73+ private companion object {
74+ private const val SDK_STARTED_MESSAGE = " Capture SDK properly initialized"
75+ private const val SDK_NOT_STARTED_MESSAGE = " Capture SDK not started yet"
76+ }
6477}
You can’t perform that action at this time.
0 commit comments