V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kidneyband
V2EX  ›  Android

如何在 Ubuntu 上编译出 macOS 上可以执行的 aapt2

  •  
  •   kidneyband · 2022-08-31 18:05:59 +08:00 · 4811 次点击
    这是一个创建于 626 天前的主题,其中的信息可能已经有所发展或是发生改变。

    根据谷歌官方文档 https://source.android.com/docs/setup/build/building

    我在我 Ubuntu(18.04)上下载了整个 android 源代码,文件夹叫 android-source 然后

    cd android-source

    source build/envsetup.sh

    make -j aapt2

    编译完成之后 在 android-source/out/host/... 中只有两个 aapt2 执行文件 一个是 windows 的 一个是 Linux 的

    请问我怎样才能编出一个在 macOS 上能执行的 aapt2 。

    2 条回复    2022-08-31 20:21:54 +08:00
    novolunt
        1
    novolunt  
       2022-08-31 18:49:51 +08:00
    先安装虚拟机
    https://mac.getutm.app/support/
    然后部署 mac M1 芯片的虚拟机,在上面编译。
    SupperMary
        2
    SupperMary  
       2022-08-31 20:21:54 +08:00
    改 aapt2 的 Android.bp ,启用 mac os 的 target (需要它依赖的库也同时支持才可以)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1699 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:36 · PVG 00:36 · LAX 09:36 · JFK 12:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.