File tree Expand file tree Collapse file tree
src/main/java/com/heroiclabs/nakamatest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ android {
6666 " -DANDROID_STL=c++_shared" ,
6767 " -DINSIDE_GRADLE=ON" , // this is picked up by our CMake to interpose VCPKG toolchain
6868 " -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" ,
69+ " -DCMAKE_TOOLCHAIN_FILE=${project.rootDir} /../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake" ,
6970 )
7071 targets(" nakama-sdk" )
7172 }
@@ -94,7 +95,7 @@ android {
9495 // This is a prefab-only AAR, remove all jniLibs , which are just stripped version
9596 // of what we already include in prefab
9697 packaging {
97- jniLibs.excludes + = (" **/*.so" )
98+ // jniLibs.excludes += ("**/*.so")
9899 }
99100
100101 buildToolsVersion = " 36.0.0"
Original file line number Diff line number Diff line change 77public class MainActivity extends Activity {
88 @ Override
99 protected void onCreate (final Bundle savedInstanceState ) {
10- // load sdk first so that it may initialize before the test application
11- Log .i ("libnakama-test MainActivity" , "Loading libnakama..." );
12- System .loadLibrary ("nakama-sdk" );
13- Log .i ("libnakama-test MainActivity" , "Loading libnakama-test..." );
14- System .loadLibrary ("nakama-test" );
10+ super .onCreate (savedInstanceState );
11+
12+ Log .i ("libnakama-test MainActivity" , "Starting tests in background thread..." );
13+
14+ new Thread (new Runnable () {
15+ @ Override
16+ public void run () {
17+ try {
18+ Log .i ("libnakama-test MainActivity" , "Loading libnakama..." );
19+ System .loadLibrary ("nakama-sdk" );
20+ Log .i ("libnakama-test MainActivity" , "Loading libnakama-test..." );
21+ System .loadLibrary ("nakama-test" );
22+ } catch (Exception e ) {
23+ Log .e ("libnakama-test MainActivity" , "Failed to load libraries: " + e .getMessage ());
24+ }
25+ }
26+ }).start ();
1527 }
1628}
Original file line number Diff line number Diff line change @@ -123,16 +123,16 @@ PACKAGE="com.heroiclabs.nakamatest"
123123
124124 # --- Clear logcat and launch ---
125125 adb_cmd logcat -c
126- echo " Launching $ACTIVITY ..."
127- adb_cmd shell am start -n " $ACTIVITY "
126+ echo " Launching $PACKAGE via monkey ..."
127+ adb_cmd shell monkey -p " $PACKAGE " -c android.intent.category.LAUNCHER 1
128128
129129 # --- Monitor logcat for test results ---
130130 echo " Waiting for test results (timeout: ${TIMEOUT} s)..."
131131 echo " ---"
132132
133133 logfile=" logcat-output.tmp"
134134 > " $logfile "
135- " $ADB " -s " $serial " logcat " nakama:V" " AndroidRuntime:E" " ActivityManager:E" " *:S" -v raw > " $logfile " 2> /dev/null &
135+ " $ADB " -s " $serial " logcat " libnakama-test:V " " nakama:V" " AndroidRuntime:E" " ActivityManager:E" " *:S" -v raw > " $logfile " 2> /dev/null &
136136 logcat_pid=$!
137137 trap ' rm -f "$logfile"; kill $logcat_pid 2>/dev/null || true' EXIT
138138
You can’t perform that action at this time.
0 commit comments