You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Android应用/APK中获取所有显示文本以进行人工翻译?

How to Extract All Display Text from an Android App for Translation

Great question—pulling all UI text from an Android app is a common task for localization, and there are reliable methods depending on whether you have access to the source code or just the APK.

1. If You Have the Source Code

This is the simplest path by far:

  • Navigate to your project’s res/values/ directory.
  • Open strings.xml—this file holds nearly all static UI text (buttons, labels, error messages, onboarding copy, etc.).
  • For apps that already support multiple languages, check subdirectories like values-es/ or values-fr/ for existing translations, but your core focus will be the base strings.xml file.

2. If You Only Have the APK (No Source Code)

You’ll need to decompile the APK to access its resource files:

  • Use Apktool, a widely used open-source tool for reverse-engineering Android apps.
  • Install Apktool, then run this command in your terminal:
    apktool d your_app.apk
    
  • This creates a folder with the app’s decompiled resources. Head to res/values/strings.xml to grab all static text.
  • Note: Some apps obfuscate code, but strings.xml usually stays readable since it’s critical for the app’s UI functionality.

3. Capturing Dynamic/Server-Sent Text

If the app pulls text from an API or generates it on the fly (not stored in strings.xml), you’ll need to capture it as you navigate every screen:

  • Android Studio Layout Inspector: Connect your device or emulator, open the app, and use the Layout Inspector to inspect each screen’s elements. It shows the text of every UI component in real time.
  • ADB UI Dump: Run this command to dump the current screen’s UI hierarchy to an XML file:
    adb shell uiautomator dump /sdcard/ui_dump.xml
    
    Pull the file to your computer with adb pull /sdcard/ui_dump.xml, then parse it to extract all text attributes. Repeat this for every screen in the app.

Pro Tip

For a more automated approach to capture dynamic text, write a simple UI test using Espresso that navigates through all app flows and logs every text element it encounters. This saves a ton of time if the app has dozens of screens.

内容的提问来源于stack exchange,提问作者Lorem Ipsum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:25:42