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
ea53a6fe
Commit
ea53a6fe
authored
Mar 19, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加记录打包大小功能
parent
69b794b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
runOhosApp-Mac-auto.sh
runOhosApp-Mac-auto.sh
+30
-0
No files found.
runOhosApp-Mac-auto.sh
View file @
ea53a6fe
...
...
@@ -179,6 +179,7 @@ TOTAL_COUNT=0
SUCCESS_COUNT
=
0
ERR_MSGS
=()
PUSH_TIMES
=()
PACK_SIZES
=()
set
+e
for
TARGET_ID
in
"
${
DEVICE_IDS
[@]
}
"
;
do
for
BUILD_MODE
in
"
${
BUILD_MODES
[@]
}
"
;
do
...
...
@@ -430,6 +431,24 @@ 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)"
# 本组 HAP 包大小检测(当前目录为 harmonyApp)
HAP_PATH_SIZE
=
"
$(
pwd
)
/entry/build/default/outputs/default/
$SIGNED_HAP
"
if
[
-f
"
$HAP_PATH_SIZE
"
]
;
then
_bytes
=
$(
stat
-f
%z
"
$HAP_PATH_SIZE
"
2>/dev/null
||
stat
-c
%s
"
$HAP_PATH_SIZE
"
2>/dev/null
)
if
[
-n
"
$_bytes
"
]
&&
[
"
$_bytes
"
-gt
0
]
2>/dev/null
;
then
if
[
"
$_bytes
"
-ge
1048576
]
;
then
_size_str
=
"
$((
_bytes
/
1048576
))
MB (
${
_bytes
}
B)"
elif
[
"
$_bytes
"
-ge
1024
]
;
then
_size_str
=
"
$((
_bytes
/
1024
))
KB (
${
_bytes
}
B)"
else
_size_str
=
"
${
_bytes
}
B"
fi
echo
" - HAP 包大小:
$_size_str
"
PACK_SIZES+
=(
"
$TARGET_ID
|
$BUILD_MODE
|
$_size_str
"
)
fi
fi
PUSH_TIMES+
=(
"
$TARGET_ID
|
$BUILD_MODE
| SO:
${
ELAPSED_SO
}
s HAP+push:
${
ELAPSED_HAP_PUSH
}
s 总:
${
ELAPSED_TOTAL
}
s"
)
echo
"
$TARGET_ID
设备
$BUILD_MODE
模式 打包成功"
...
...
@@ -479,4 +498,15 @@ if [ ${#PUSH_TIMES[@]} -gt 0 ]; then
done
echo
"----------------------------------------------"
fi
if
[
${#
PACK_SIZES
[@]
}
-gt
0
]
;
then
echo
""
echo
"----------------------------------------------"
echo
-e
"
\0
33[32m▶ 包大小汇总
\0
33[0m"
echo
"----------------------------------------------"
for
_line
in
"
${
PACK_SIZES
[@]
}
"
;
do
echo
"
$_line
"
done
echo
"----------------------------------------------"
fi
echo
""
\ No newline at end of file
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