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
58a25ff3
Commit
58a25ff3
authored
Mar 19, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本入口
parent
59348341
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
14 deletions
+60
-14
runOhosApp-Mac-auto.sh
runOhosApp-Mac-auto.sh
+60
-14
No files found.
runOhosApp-Mac-auto.sh
View file @
58a25ff3
...
...
@@ -216,38 +216,43 @@ done
"
$HDC_BIN
"
-t
"
$TARGET_ID
"
shell aa force-stop
"
$BUNDLE_NAME
"
>
/dev/null 2>&1
||
true
# ====================== [3. Gradle Build] ======================
# publish 必须跑完且成功,再进行打包、推包
# publish 必须跑完且成功,再进行打包、推包;命令失败时打印完整错误输出(含具体文件/配置报错)
GRADLE_OUT
=
"/tmp/runOhos_gradle_
$$
.out"
GRADLE_RET
=
0
if
[
"
$PLATFORM
"
=
"ohosArm64"
]
;
then
if
[
"
$BUILD_MODE
"
=
"release"
]
;
then
echo
">>> :composeApp:publishReleaseBinariesToHarmonyApp"
if
[
-n
"
$LOCAL_OHOS_PATH
"
]
;
then
./gradlew :composeApp:publishReleaseBinariesToHarmonyApp
-PharmonyAppPath
=
"
$LOCAL_OHOS_PATH
"
./gradlew :composeApp:publishReleaseBinariesToHarmonyApp
-PharmonyAppPath
=
"
$LOCAL_OHOS_PATH
"
2>&1 |
tee
"
$GRADLE_OUT
"
else
./gradlew :composeApp:publishReleaseBinariesToHarmonyApp
./gradlew :composeApp:publishReleaseBinariesToHarmonyApp
2>&1 |
tee
"
$GRADLE_OUT
"
fi
GRADLE_RET
=
$
?
GRADLE_RET
=
$
{
PIPESTATUS
[0]
}
else
echo
">>> :composeApp:publishDebugBinariesToHarmonyApp"
if
[
-n
"
$LOCAL_OHOS_PATH
"
]
;
then
./gradlew :composeApp:publishDebugBinariesToHarmonyApp
-PharmonyAppPath
=
"
$LOCAL_OHOS_PATH
"
./gradlew :composeApp:publishDebugBinariesToHarmonyApp
-PharmonyAppPath
=
"
$LOCAL_OHOS_PATH
"
2>&1 |
tee
"
$GRADLE_OUT
"
else
./gradlew :composeApp:publishDebugBinariesToHarmonyApp
./gradlew :composeApp:publishDebugBinariesToHarmonyApp
2>&1 |
tee
"
$GRADLE_OUT
"
fi
GRADLE_RET
=
$
?
GRADLE_RET
=
$
{
PIPESTATUS
[0]
}
fi
elif
[
"
$PLATFORM
"
=
"iosSimulatorArm64"
]
;
then
echo
">>> :composeApp:linkDebugFrameworkIosSimulatorArm64"
./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64
GRADLE_RET
=
$
?
./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64
2>&1 |
tee
"
$GRADLE_OUT
"
GRADLE_RET
=
$
{
PIPESTATUS
[0]
}
else
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:不支持的平台
$PLATFORM
)"
continue
fi
if
[
$GRADLE_RET
-ne
0
]
;
then
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:Gradle publish 未成功结束,exit code
$GRADLE_RET
,须 publish 完成后再打包推包)"
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:Gradle publish 未成功,exit code
$GRADLE_RET
)"
echo
" >>> 命令错误输出(含具体文件/配置报错):"
[
-f
"
$GRADLE_OUT
"
]
&&
cat
"
$GRADLE_OUT
"
|
tail
-80
rm
-f
"
$GRADLE_OUT
"
continue
fi
rm
-f
"
$GRADLE_OUT
"
# SO packaging end time
HAP_START_TIME
=
$(
date
+%s
)
# --- Subsequent install logic (hdc install etc.) ---
...
...
@@ -265,13 +270,46 @@ if [ ! -d "$HARMONY_APP_DIR" ]; then
continue
fi
cd
"
$HARMONY_APP_DIR
"
ohpm
install
--all
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--sync
-p
product
=
default
-p
buildMode
=
"
$BUILD_MODE
"
--analyze
=
normal
--parallel
--incremental
--daemon
HVIGOR_OUT
=
"/tmp/runOhos_hvigor_
$$
.out"
ohpm
install
--all
2>&1 |
tee
"
$HVIGOR_OUT
"
OHPM_RET
=
${
PIPESTATUS
[0]
}
if
[
$OHPM_RET
-ne
0
]
;
then
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:ohpm install 失败)"
echo
" >>> 命令错误输出:"
[
-f
"
$HVIGOR_OUT
"
]
&&
cat
"
$HVIGOR_OUT
"
|
tail
-80
rm
-f
"
$HVIGOR_OUT
"
cd
"
$SCRIPT_DIR
"
continue
fi
rm
-f
"
$HVIGOR_OUT
"
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--sync
-p
product
=
default
-p
buildMode
=
"
$BUILD_MODE
"
--analyze
=
normal
--parallel
--incremental
--daemon
2>&1 |
tee
"
$HVIGOR_OUT
"
HVIGOR_SYNC_RET
=
${
PIPESTATUS
[0]
}
if
[
$HVIGOR_SYNC_RET
-ne
0
]
;
then
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:hvigor --sync 失败,请查看下方输出中的文件/配置名)"
echo
" >>> 命令错误输出:"
[
-f
"
$HVIGOR_OUT
"
]
&&
cat
"
$HVIGOR_OUT
"
|
tail
-80
rm
-f
"
$HVIGOR_OUT
"
cd
"
$SCRIPT_DIR
"
continue
fi
rm
-f
"
$HVIGOR_OUT
"
if
[
"
$BUILD_MODE
"
=
"release"
]
;
then
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--mode
module
-p
module
=
entry
-p
product
=
default
-p
buildMode
=
release
-p
requiredDeviceType
=
phone assembleHap compileNative
--analyze
=
normal
--parallel
--incremental
--daemon
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--mode
module
-p
module
=
entry
-p
product
=
default
-p
buildMode
=
release
-p
requiredDeviceType
=
phone assembleHap compileNative
--analyze
=
normal
--parallel
--incremental
--daemon
2>&1 |
tee
"
$HVIGOR_OUT
"
else
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--mode
module
-p
module
=
entry@default
-p
product
=
default
-p
buildMode
=
debug
-p
requiredDeviceType
=
phone assembleHap
--analyze
=
normal
--parallel
--incremental
--daemon
node
"
$DEVECO_HOME
/tools/hvigor/bin/hvigorw.js"
--mode
module
-p
module
=
entry@default
-p
product
=
default
-p
buildMode
=
debug
-p
requiredDeviceType
=
phone assembleHap
--analyze
=
normal
--parallel
--incremental
--daemon
2>&1 |
tee
"
$HVIGOR_OUT
"
fi
HVIGOR_ASM_RET
=
${
PIPESTATUS
[0]
}
if
[
$HVIGOR_ASM_RET
-ne
0
]
;
then
echo
"错误的
$TARGET_ID
设备
$BUILD_MODE
模式(原因:hvigor assembleHap 失败,请查看下方输出中的文件/配置名)"
echo
" >>> 命令错误输出:"
[
-f
"
$HVIGOR_OUT
"
]
&&
cat
"
$HVIGOR_OUT
"
|
tail
-80
rm
-f
"
$HVIGOR_OUT
"
cd
"
$SCRIPT_DIR
"
continue
fi
rm
-f
"
$HVIGOR_OUT
"
# ====================== [5. Install and Push Debug Components] ======================
AVAILABLE_TARGETS
=
$(
"
$HDC_BIN
"
list targets
)
...
...
@@ -359,6 +397,14 @@ if [ -z "$APP_PID" ]; then
continue
fi
# 本组耗时统计(SO 构建 / HAP 打包+推包 / 总耗时)
ELAPSED_SO
=
$((
HAP_START_TIME
-
START_TIME
))
ELAPSED_HAP_PUSH
=
$((
END_TIME
-
HAP_START_TIME
))
ELAPSED_TOTAL
=
$((
END_TIME
-
START_TIME
))
echo
" - SO build time:
$((
ELAPSED_SO/60
))
m
$((
ELAPSED_SO%60
))
s (
${
ELAPSED_SO
}
s)"
echo
" - HAP package and push time:
$((
ELAPSED_HAP_PUSH/60
))
m
$((
ELAPSED_HAP_PUSH%60
))
s (
${
ELAPSED_HAP_PUSH
}
s)"
echo
" - Total time:
$((
ELAPSED_TOTAL/60
))
m
$((
ELAPSED_TOTAL%60
))
s (
${
ELAPSED_TOTAL
}
s)"
echo
"
$TARGET_ID
设备
$BUILD_MODE
模式 打包成功"
((
SUCCESS_COUNT++
))
...
...
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