网站地图

了解如何使用站点地图通过 Expo Router 调试你的应用。


在本地,你可以使用 uri-scheme CLI 来测试在设备上打开本地链接。

🌐 On native, you can use the uri-scheme CLI to test opening native links on a device.

例如,如果你想在 iOS 上启动 Expo Go 应用并进入 /form-sheet 路由,请运行:

🌐 For example, if you want to launch the Expo Go app on iOS to the /form-sheet route, run:

Terminal
npx uri-scheme open exp://192.168.87.39:19000/--/form-sheet --ios

在运行 npx expo start 时,将 192.168.87.39:19000 替换为显示的 IP 地址。

你也可以直接在 Safari 或 Chrome 等浏览器中搜索链接,以在真实设备上测试深度链接。了解有关测试深度链接的更多信息。

🌐 You can also search for links directly in a browser like Safari or Chrome to test deep linking on physical devices. Learn more about testing deep links.

网站地图

🌐 Sitemap

Expo Router 当前会自动注入一个 /_sitemap,它提供了应用中所有路由的列表。这对于调试非常有用。

🌐 Expo Router currently injects a /_sitemap automatically that provides a list of all routes in the app. This is useful for debugging.

可以通过在应用配置中的 expo-router 配置插件中添加 sitemap: false 来移除网站地图:

🌐 The sitemap can be removed by adding sitemap: false to the expo-router config plugin in the app config:

app.json
{ "plugins": [ [ "expo-router", { "sitemap": false } ] ] }