










增加应用的支持类型(phone,tablet,2in1)
module.json5这个文件决定了你的应用允许安装在哪些设备上。
entry/src/main/module.json5deviceTypes 字段{ "module": { "name": "entry", "type": "entry", "srcEntry": "./ets/qabilitystage/QAbilityStage.ets", "description": "$string:module_desc", "mainElement": "QAbility", "deviceTypes": [ // When 'phone' is added to the list, the main window does not restore itself to // the desired state after being minimized (QTFOROH-1076). Before it is added // back, be sure that the issue has been resolved. "phone", "tablet", "2in1" ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "extensionAbilities": [

build-profile.json5这个文件决定了在编译打包时,支持哪些目标设备类型。
build-profile.json5(两个文件里如果有相关配置都需要改,重点是 entry/build-profile.json5)targets 下的 runtimeOS 或你自定义的 target 配置deviceType 修改为支持全平台:"targets": [ { "name": "default", "runtimeOS": "HarmonyOS", "config": { "deviceType": [ "phone", // 手机 "tablet", // 平板 "2in1" // PC ] } }, { "name": "ohosTest" } ]
注意:修改配置后一定要同步。
二、libs配置
应用程序用到的so文件拷贝到entry-->libs文件夹
ohos_hap_project/ └── entry/ └── libs/ ├── arm64-v8a/ <-- 64位 ARM架构 (对应 aarch64) │ └── libyour_lib.so ├── armeabi-v7a/ <-- 32位 ARM架构 (对应 armv7) │ └── libyour_lib.so └── x86_64/ <-- 64位 x86架构 (对应 PC/模拟器) └── libyour_lib.so
1)拷贝lazarus编译后的so
2)拷贝libLazarusOHOS_Wrapper.so
3)拷贝QT5支持文件
如果应用针对x86_64的,就拷贝到x86_64这个目录,aarch64则拷贝到arm64-v8a

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。