Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
TestToolChainDemo
Commits
b939ff27
Commit
b939ff27
authored
Apr 08, 2026
by
qq_38816927
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除测试卡死的按钮
parent
153d2a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
11 deletions
+46
-11
App.kt
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
+11
-11
runOhosApp-Mac-auto.sh
runOhosApp-Mac-auto.sh
+35
-0
No files found.
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
View file @
b939ff27
...
...
@@ -110,17 +110,17 @@ internal fun HomeScreen(
// ) {
// Text("测试debug调试时应用退出")
// }
Button
(
onClick
=
{
// 触发卡死
val
testInfinite
:
Boolean
=
true
;
fun
infinite
():
Int
=
infinite
()
+
1
infinite
()
// 触发 StackOverflowError
},
modifier
=
Modifier
.
fillMaxWidth
()
)
{
Text
(
"测试debug调试时应用卡死"
)
}
//
Button(
//
onClick = {
//
// 触发卡死
//
val testInfinite: Boolean = true;
//
fun infinite(): Int = infinite() + 1
//
infinite() // 触发 StackOverflowError
//
},
//
modifier = Modifier.fillMaxWidth()
//
) {
//
Text("测试debug调试时应用卡死")
//
}
}
...
...
runOhosApp-Mac-auto.sh
View file @
b939ff27
...
...
@@ -22,6 +22,39 @@ set -e
START_TIME
=
$(
date
+%s
)
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
# 与 composeApp/build.gradle.kts 中 publish*BinariesToHarmonyApp 的 into 路径一致(Gradle: rootProject.name + "." + project.name.lowercase() + ".generated.resources")
harmony_publish_compose_resources_package
()
{
local
_root_name
_root_name
=
$(
grep
-E
'^\s*rootProject\.name\s*='
"
$SCRIPT_DIR
/settings.gradle.kts"
2>/dev/null |
head
-1
|
sed
-n
's/.*=\s*"\([^"]*\)".*/\1/p'
)
[
-z
"
$_root_name
"
]
&&
_root_name
=
"TestToolChainDemo"
echo
"
${
_root_name
}
.composeapp.generated.resources"
}
# 删除一次 Gradle publish 会拷入的 kn 头/so 与 composeResources 目录(由本脚本在 gradlew publish 前调用)
delete_harmony_publish_kn_outputs
()
{
local
_base
=
"
$1
"
_base
=
"
${
_base
%/
}
"
[
-d
"
$_base
/entry"
]
||
return
0
local
_pkg
_pkg
=
$(
harmony_publish_compose_resources_package
)
rm
-f
"
$_base
/entry/src/main/cpp/include/libkn_api.h"
2>/dev/null
||
true
rm
-f
"
$_base
/entry/libs/arm64-v8a/libkn.so"
2>/dev/null
||
true
rm
-f
"
$_base
/entry/libs/x86_64/libkn.so"
2>/dev/null
||
true
rm
-rf
"
$_base
/entry/src/main/resources/rawfile/composeResources/
$_pkg
"
2>/dev/null
||
true
}
delete_all_harmony_publish_targets_before_gradle
()
{
delete_harmony_publish_kn_outputs
"
$SCRIPT_DIR
/harmonyApp"
if
[
-n
"
${
LOCAL_OHOS_PATH
:-}
"
]
;
then
if
[[
"
$LOCAL_OHOS_PATH
"
=
/
*
]]
;
then
delete_harmony_publish_kn_outputs
"
$LOCAL_OHOS_PATH
"
else
delete_harmony_publish_kn_outputs
"
$SCRIPT_DIR
/
$LOCAL_OHOS_PATH
"
fi
fi
echo
-e
"
\0
33[35m已按 publish 目标清理 harmonyApp(libkn / libkn_api.h / composeResources 包目录)
\0
33[0m"
}
# ====================== [1. Default Configuration and Parameter Parsing] ======================
DEFAULT_PLATFORM
=
"ohosArm64"
DEFAULT_TARGET_ID
=
"127.0.0.1:5555"
...
...
@@ -262,6 +295,7 @@ done
GRADLE_OUT
=
"/tmp/runOhos_gradle_
$$
.out"
GRADLE_RET
=
0
if
[
"
$PLATFORM
"
=
"ohosArm64"
]
;
then
delete_all_harmony_publish_targets_before_gradle
if
[
"
$BUILD_MODE
"
=
"release"
]
;
then
echo
">>> :composeApp:publishReleaseBinariesToHarmonyApp"
if
[
-n
"
$LOCAL_OHOS_PATH
"
]
;
then
...
...
@@ -280,6 +314,7 @@ if [ "$PLATFORM" = "ohosArm64" ]; then
GRADLE_RET
=
${
PIPESTATUS
[0]
}
fi
elif
[
"
$PLATFORM
"
=
"ohosX86_64"
]
;
then
delete_all_harmony_publish_targets_before_gradle
if
[
"
$BUILD_MODE
"
=
"release"
]
;
then
echo
">>> :composeApp:publishReleaseBinariesToHarmonyApp"
if
[
-n
"
$LOCAL_OHOS_PATH
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment