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
6
6
adb install android_app.apk
7
7
adb shell am start -n io.bitdrift.capture.helloworld/.MainActivity
8
8
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
10
16
sleep 1
17
+ elapsed=$(( elapsed + 1 ))
11
18
done
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class HelloWorldApp : Application() {
50
50
Log .v(" HelloWorldApp" , " Android Bitdrift app launched with session url=${Logger .sessionUrl} " )
51
51
52
52
Handler (Looper .getMainLooper()).postDelayed({
53
- Log .i(" HelloWorldApp" , " Capture Logger has been running for $kLoggerRunningDurationThreshold ms " )
53
+ Log .i(" HelloWorldApp" , getCaptureSdkInitializedMessage() )
54
54
}, kLoggerRunningDurationThreshold)
55
55
}
56
56
@@ -61,4 +61,17 @@ class HelloWorldApp : Application() {
61
61
ogHandler?.uncaughtException(thread, throwable)
62
62
}
63
63
}
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
+ }
64
77
}
You can’t perform that action at this time.
0 commit comments