hdc(HarmonyOS Device
Connector)是HarmonyOS為開(kāi)發(fā)人員提供的用于調(diào)試的命令行工具,通過(guò)該工具可以在window/linux/mac系統(tǒng)上與真實(shí)設(shè)備或者模擬器進(jìn)行交互。
(1)
hdc list targets
(2)
hdc file send local remote
(3)
hdc install package File
這里列舉的幾個(gè)命令是不是很熟悉?一看名字就知道和安卓中的adb是對(duì)應(yīng)關(guān)系。不需要去記憶,在需要使用到的時(shí)候去官網(wǎng)查一下就行: hdc使用指導(dǎo)
2、Mac系統(tǒng)配置hdc 環(huán)境變量
3、項(xiàng)目中的配置文件
安卓中最主要的配置文件是AndroidManifest.xml。 其中定義了版本號(hào),申明了頁(yè)面路徑,注冊(cè)了廣播和服務(wù)。并且申明了App使用的權(quán)限。
而鴻蒙中也對(duì)應(yīng)有配置文件,但與安卓稍有不同的是鴻蒙分為多個(gè)文件。
(1) build-profile.json5
Sdk Version配置在這里, 代碼的模塊區(qū)分也在這里:
{ "app": { "signingConfigs": [], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ { "name": "default", "signingConfig": "default", } ], "buildModeSet": [ { "name": "debug", }, { "name": "release" } ] }, "modules": [ { "name": "entry", "srcPath": "./entry", "targets": [ { "name": "default", "applyToProducts": [ "default" ] } ] } ] }
(2)app.json5
包名,VersionCode,VersionName等信息
{ "app": { "bundleName": "com.example.firstDemo", "vendor": "example", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:app_icon", "label": "$string:app_name" } }
(3)module.json5
模塊的詳細(xì)配置,頁(yè)面名稱和模塊使用到的權(quán)限在這里申明
{ "module": { "name": "entry", "type": "entry", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ "phone", "tablet" ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ts", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ] } ], "requestPermissions":[ { "name" : "ohos.permission.APPROXIMATELY_LOCATION", "reason": "$string:reason", "usedScene": { "abilities": [ "FormAbility" ], "when":"inuse" } } ] } }
4、對(duì)應(yīng)安卓的權(quán)限管理
鴻蒙有ATM,ATM(AccessTokenManager)是HarmonyOS上基于AccesssToken構(gòu)建的統(tǒng)一的應(yīng)用權(quán)限管理能力
5、對(duì)應(yīng)安卓的SharedPreferences能力,鴻蒙有首選項(xiàng)能力
審核編輯 黃宇
-
hdc
+關(guān)注
關(guān)注
1文章
44瀏覽量
3804 -
鴻蒙
+關(guān)注
關(guān)注
59文章
2508瀏覽量
43769 -
HarmonyOS
+關(guān)注
關(guān)注
79文章
2052瀏覽量
32129
發(fā)布評(píng)論請(qǐng)先 登錄
C51單片機(jī)及C語(yǔ)言知識(shí)點(diǎn)必備秘籍
電機(jī)選型計(jì)算公式與知識(shí)點(diǎn)匯總
嵌入式硬件雜談:推挽、開(kāi)漏、高阻態(tài)、上拉電阻

電氣工程師必知必會(huì)的100個(gè)電?知識(shí)點(diǎn)分享
HarmonyOS 應(yīng)用開(kāi)發(fā)賦能套件:鴻蒙原生應(yīng)用開(kāi)發(fā)的 “神助攻”
華邦電子安全閃存關(guān)鍵知識(shí)點(diǎn)
Docker-鏡像的分層-busybox鏡像制作

AIGC入門(mén)及鴻蒙入門(mén)
Aigtek功率放大器應(yīng)用:電感線圈的知識(shí)點(diǎn)分享

后悔沒(méi)有早點(diǎn)看到:天線設(shè)計(jì)中的知識(shí)點(diǎn)!

Kaggle知識(shí)點(diǎn):使用大模型進(jìn)行特征篩選

硬件工程師面試基礎(chǔ)知識(shí)點(diǎn)

推拉力測(cè)試知識(shí)點(diǎn)介紹

接口測(cè)試?yán)碚摗⒁蓡?wèn)收錄與擴(kuò)展相關(guān)知識(shí)點(diǎn)

MySQL知識(shí)點(diǎn)匯總

評(píng)論