From 7b880168c0aa645efafc34425883b2aae7b3aef5 Mon Sep 17 00:00:00 2001 From: yanshuifeng Date: Wed, 20 Nov 2024 03:11:37 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yanshuifeng --- README.md | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/README.md b/README.md index 083362b27..4e08f2d42 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,110 @@ $ export HOS_SDK_HOME=`pwd`/arkoala/ohos-sdk/ohos-sdk $ KOALA_BZ=1 npm run arkoala:plugin $ file ${HOS_SDK_HOME}/HarmonyOS-NEXT-DB1/openharmony/ets/build-tools/ets-loader/lib/fast_build/ets_ui/arkoala-plugin.js ``` + +## Setup env + +``` +Export these env variables: +- `OPENLAB_USERNAME` +- `OPENLAB_PASSWORD` +``` + +OPENLAB_USERNAME=koala-pub +OPENLAB_PASSWORD=y3t!n0therP // use y3\\t!n0therP if executed from command line + +Add registry to the `.npmrc` file in the `$HOME` directory (`~/.npmrc`): + +```text +@koalaui:registry=https://nexus.bz-openlab.ru:10443/repository/koala-npm/ +@panda:registry=https://nexus.bz-openlab.ru:10443/repository/koala-npm/ +``` + +Try login to the registry + +``` +npm login --registry=https://nexus.bz-openlab.ru:10443/repository/koala-npm/ +``` + +``` +username: koala-pub +passwd: y3t!n0therP +``` + +## Run on device + +1. Building arkoala-arkts.har + +``` +$ npm install +$ cd arkoala-arkts +$ npm run panda:sdk:install +$ KOALA_BZ=1 HTTP_CACHE_DIR=$HOME/download npm run trivial:all:har-arm32 +$ file ./arkoala-arkts/har/app/arkoala/build/default/outputs/default/arkoala.har +``` + +> If you failed to download SDK when you run `npm run trivial:all:har-arm32` by command, you can install SDK manully +> Download from url: https://nexus.bz-openlab.ru:10443/repository/koala-raw/ohos-sdk-ets/5.0.024/ohos-sdk-ets-5.0.0.24.zip +> Put the downloaded file in your \$HOME/download directory and unzip it to the \$HOME/download/unzip directory + +![image](https://wiki.huawei.com/vision-file-storage/api/file/download/upload-v2/WIKI202411075046609/14191477/71e5187038bf41e7aefdbabbd9bc5898.png) + +2. Сreate an application in DevEco and set the arkoala-arkts.har depending on the oh-package.json5 + +``` +"dependencies": { + "@koalaui/arkoala-arkui": "file:" +} +``` + +3. Add metadata to entry/src/main/module.json5 + +``` +{ + "module": { + ... + "metadata": [ + { + "name": "ArkoalaPlugin", + "value": "true" + } + ] + } +} +``` + +4. Run your application + +## Config SDK + +Build `arkoala plugin` and patch `OHOS SDK` + +``` +$ npm install +$ KOALA_BZ=1 npm run ohos-sdk +$ export HOS_SDK_HOME=`pwd`/arkoala/ohos-sdk/ohos-sdk +$ KOALA_BZ=1 HTTP_CACHE_DIR=$HOME/download npm run arkoala:plugin +$ file ${HOS_SDK_HOME}/HarmonyOS-NEXT-DB1/openharmony/ets/build-tools/ets-loader/lib/fast_build/ets_ui/arkoala-plugin.js +``` + +Replace your SDK's `ets` folder with ${HOS_SDK_HOME}/HarmonyOS-NEXT-DB1/openharmony/ets + +And copy your original SDK's ets/build-tools/ets-loader/bin/ark/build-win folder to your new SDK's ets/build-tools/ets-loader/bin/ark/ directory. + +> this is because the patched SDK is buildlt for linux : ) + +## Some problems + +1. If you can’t load libraries, you can put them in the system/lib + +``` +hdc file send /system/lib +``` + +2. Currently a working version of panda in the blue zone is 1.5.0-dev.5226 + +``` +cd incremental/tools/panda +npm i @panda/sdk@1.5.0-dev.5226 +``` + -- Gitee