Appium 学习测试 aapt 取不到 activity 怎么办?

skyshine · February 08, 2019 · Last by skyshine replied at February 11, 2019 · 769 hits

今天试着用挺火 的douyin练习。
但:aapt dump dabging dy.apk
只能查看包名,没有activity,怎么办?

package: name='com.ss.android.ugc.aweme' versionCode='433' versionName='4.3.3'
sdkVersion:'16'
targetSdkVersion:'23'
uses-permission: name='android.permission.READ_PHONE_STATE'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='android.permission.FLASHLIGHT'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.GET_TASKS'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.ACCESS_COARSE_LOCATION'
uses-permission: name='com.meizu.c2dm.permission.RECEIVE'
uses-permission: name='com.ss.android.ugc.aweme.permission.C2D_MESSAGE'
uses-permission: name='android.permission.VIBRATE'
uses-permission: name='com.ss.android.ugc.aweme.permission.MIPUSH_RECEIVE'
uses-permission: name='com.ss.android.ugc.aweme.push.permission.MESSAGE'
uses-permission: name='com.ss.android.ugc.aweme.permission.READ_ACCOUNT'
uses-permission: name='com.ss.android.ugc.aweme.permission.WRITE_ACCOUNT'
uses-permission: name='android.permission.CHANGE_NETWORK_STATE'
uses-permission: name='permission.bind.HiMediaEngines'
uses-permission: name='com.meizu.flyme.push.permission.RECEIVE'
uses-permission: name='android.permission.GET_ACCOUNTS'
uses-permission: name='android.permission.WRITE_SYNC_SETTINGS'
uses-permission: name='android.permission.AUTHENTICATE_ACCOUNTS'
uses-permission: name='com.sec.android.provider.badge.permission.READ'
uses-permission: name='com.sec.android.provider.badge.permission.WRITE'
uses-permission: name='com.htc.launcher.permission.READ_SETTINGS'
uses-permission: name='com.htc.launcher.permission.UPDATE_SHORTCUT'
uses-permission: name='com.sonyericsson.home.permission.BROADCAST_BADGE'
uses-permission: name='com.sonymobile.home.permission.PROVIDER_INSERT_BADGE'
uses-permission: name='com.majeur.launcher.permission.UPDATE_BADGE'
uses-permission: name='com.huawei.android.launcher.permission.CHANGE_BADGE'
uses-permission: name='com.huawei.android.launcher.permission.READ_SETTINGS'
uses-permission: name='com.huawei.android.launcher.permission.WRITE_SETTINGS'
uses-permission: name='com.oppo.launcher.permission.READ_SETTINGS'
uses-permission: name='com.oppo.launcher.permission.WRITE_SETTINGS'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.USE_CREDENTIALS'
uses-permission: name='android.permission.MANAGE_ACCOUNTS'
uses-permission: name='com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE'
uses-permission: name='com.android.launcher.permission.INSTALL_SHORTCUT'
uses-permission: name='com.android.launcher.permission.UNINSTALL_SHORTCUT'
uses-permission: name='com.anddoes.launcher.permission.UPDATE_COUNT'
uses-permission: name='com.anddoes.notifier.permission.READ_NOTIFICATIONS'
uses-permission: name='android.permission.READ_APP_BADGE'
uses-permission: name='me.everything.badger.permission.BADGE_COUNT_READ'
uses-permission: name='me.everything.badger.permission.BADGE_COUNT_WRITE'
uses-permission: name='android.permission.UPDATE_APP_BADGE'
application-label:'抖音短视频'
application-icon-120:'r/k/a.png'
application-icon-160:'r/k/a.png'
application-icon-240:'r/k/a.png'
application-icon-320:'r/z/a.png'
application-icon-480:'r/a_/a.png'
application-icon-640:'r/v/a.png'
application-icon-65534:'r/k/a.png'
application-icon-65535:'r/v/a.png'
application: label='抖音短视频' icon='r/k/a.png'
feature-group: label=''
uses-gl-es: '0x20000'
uses-feature: name='android.hardware.camera'
uses-feature: name='android.hardware.camera.autofocus'
uses-feature-not-required: name='android.hardware.wifi'
uses-feature: name='android.hardware.bluetooth'
uses-implied-feature: name='android.hardware.bluetooth' reason='requested android.permission.BLUETOOTH permission, and targetSdkVersion > 4'
uses-feature: name='android.hardware.faketouch'
uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
uses-feature: name='android.hardware.location'
uses-implied-feature: name='android.hardware.location' reason='requested android.permission.ACCESS_COARSE_LOCATION permission, and requested android.permission.ACCESS_FINE_LOCATION permission'
uses-feature: name='android.hardware.microphone'
uses-implied-feature: name='android.hardware.microphone' reason='requested android.permission.RECORD_AUDIO permission'
uses-feature: name='android.hardware.screen.portrait'
uses-implied-feature: name='android.hardware.screen.portrait' reason='one or more activities have specified a portrait orientation'
provides-component:'wallpaper'
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--'
densities: '120' '160' '240' '320' '480' '640' '65534' '65535'
native-code: 'armeabi-v7a'

共收到 4 条回复 时间 点赞

uses-implied-feature: name='android.hardware.screen.portrait' reason='one or more activities have specified a portrait orientation'

恒温 回复

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.ss.android.ugc.aweme' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Cannot start the 'com.ss.android.ugc.aweme' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.android.hardware.screen.portrait' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

不是这个。。。

dabging 这个命令拼错了吧?

aapt dump --help
ERROR: Unknown option '--help'
Android Asset Packaging Tool

Usage:
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
List contents of Zip-compatible archive.

aapt d[ump] [--values] [--include-meta-data] WHAT file.{apk} [asset [asset ...]]
strings Print the contents of the resource table string pool in the APK.
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.

官方命令里没有说通过 badging 一定可以获取 activity 信息的。建议改为用其它获取主 activity 的方法,例如获取 apk 的 AndroidManifest.xml 内容。

陈恒捷 回复

这上打错了。试了,找到了

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up