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

pm install: install a single legacy package. 那新的技术是啥?

  •  
  •   JinTianYi456 · 2021-07-01 16:46:08 +08:00 · 4342 次点击
    这是一个创建于 1030 天前的主题,其中的信息可能已经有所发展或是发生改变。
    12 条回复    2021-07-02 18:23:23 +08:00
    AoEiuV020
        1
    AoEiuV020  
       2021-07-01 16:52:55 +08:00
    我咋没看到 legacy,说起新包,难道 pm 支持安装 aab ?
    JinTianYi456
        2
    JinTianYi456  
    OP
       2021-07-01 17:17:45 +08:00
    @AoEiuV020 我是说它 usage 里用到了 legacy 这个词
    AoEiuV020
        3
    AoEiuV020  
       2021-07-01 17:21:01 +08:00
    @JinTianYi456 还是没有找到,你手机是什么版本的?
    mxT52CRuqR6o5
        4
    mxT52CRuqR6o5  
       2021-07-01 18:41:23 +08:00 via Android
    可能是指 app bundle ?
    also24
        5
    also24  
       2021-07-01 18:56:29 +08:00
    @AoEiuV020 #1
    同,我在那个页面也没找到 legacy 这个单词
    Jirajine
        6
    Jirajine  
       2021-07-01 18:58:21 +08:00 via Android
    also24
        7
    also24  
       2021-07-01 18:58:22 +08:00
    @AoEiuV020 #3
    补充,在手机上 pm help 也没找到
    AoEiuV020
        8
    AoEiuV020  
       2021-07-01 18:58:34 +08:00 via Android   ❤️ 1
    @also24 找到了,旧版本安卓命令行调用 pm 时打印的 usage 里有这行,
    因为几年前就有这句话所以应该不是指 aab 和 apk 的新旧,
    also24
        10
    also24  
       2021-07-01 19:13:38 +08:00   ❤️ 1
    顺藤摸瓜,找了一下这段代码的提交记录:

    看一下 commit 就知道了:
    Extend pm to support sessions and split APKs.


    可见,确实是在加入 split APKs 支持时,将 apk 称为了 legacy package

    https://android.googlesource.com/platform/frameworks/base/+/ec55ef0934b8e0d1bb705434947de817f7be57f1%5E%21/cmds/pm/src/com/android/commands/pm/Pm.java
    Xusually
        11
    Xusually  
       2021-07-01 21:25:39 +08:00
    迎接 AAB 吧。

    TL;DR
    Starting in August 2021, Google will require all new Android APKs to land on the Play Store as App Bundles instead.
    This will invariably result in smaller file sizes and other boons for the end-user.
    However, it will also require app developers to push out APK versions of their apps to other non-Play Store channels, as they won’t support App Bundles.

    https://www.androidauthority.com/android-apks-sunset-1636829/
    JinTianYi456
        12
    JinTianYi456  
    OP
       2021-07-02 18:23:23 +08:00
    @also24 #9 新的 pm 已经转到`cmd package`了,看起来是在 https://android.googlesource.com/platform/frameworks/native/+/refs/heads/master/cmds/cmd/
    但我怎么看不到代码里的 cmd package 的 usage 在哪?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2683 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 15:29 · PVG 23:29 · LAX 08:29 · JFK 11:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.