Get Started with Uniapp: Set Up the Environment in 10 Minutes and Run Your First Project
This step‑by‑step guide shows beginners how to install HBuilderX and WeChat Developer Tools, create a Uniapp project, run it on both H5 and WeChat mini‑programs, modify the page title, and avoid common pitfalls.
Key Operations
Install two core tools
Tool 1: HBuilderX (Uniapp official IDE)
Download: https://www.dcloud.io/hbuilderx.html
Version: select “App Development Edition” (out‑of‑the‑box, no extra plugins)
After installation, enable “Open project directory by default” for convenience
Tool 2: WeChat Developer Tools (mini‑program debugging)
Download: https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
Key setting: after installation, log in, open Settings → Security Settings and check “Server Port Open” (required for HBuilderX connection)
Create the first Uniapp project (≈1 minute)
Open HBuilderX → File → New → Project
Select project type “Uniapp”, template “Hello UniApp” (includes multi‑platform demo code)
Enter a project name (e.g., uniapp-demo), choose a save path, click Create
Run the project on H5 and WeChat mini‑program
Run on H5 (no configuration)
Select the project → Run → Run to Browser → choose any browser
Result: the browser opens automatically and displays the Uniapp default demo page
Run on WeChat mini‑program (simple configuration)
Open WeChat Developer Tools, create a blank mini‑program (AppID can be the “test account”, no enterprise registration needed)
Back in HBuilderX, select the project → Run → Run to Mini‑Program Simulator → WeChat Developer Tools
On first run, choose the mini‑program project path: locate the HBuilderX project directory under unpackage/dist/dev/mp-weixin and select it
Result: WeChat DevTools loads the project and shows the multi‑platform adaptation
Core Code (copy‑paste ready)
Modify the default page title
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "My First Uniapp Project" // change title, save to apply
}
}
]
}Pitfalls to Avoid
WeChat mini‑program fails to run: verify that the “Server Port Open” option is enabled; restart both tools if necessary
H5 runs blank: ensure the project is selected and the browser is not blocking local requests; allow them if needed
No manual environment‑variable configuration is required; the tools work out‑of‑the‑box after installation
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
liandk
Seasoned Java and mobile developer with years of experience, specializing in mini‑programs, public accounts, and full‑stack front‑end development. In the AI era, I continuously learn to broaden my knowledge and evolve. I revived a public account I started a decade ago during a dessert‑startup venture, using code as a vessel and knowledge as a companion. I share personal projects, technical articles, programming tips, and growth insights—let’s improve together and set sail.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
