ios获取原生系统应用的包名

1、安装facebook-wda (windows电脑mac电脑均可使用)

pip install facebook-wda
或
pip3 install -U facebook-wda

facebook-wda的github链接如下:

https://github.com/openatx/facebook-wda

2、编写如下代码

import wda
def getPackageName():
     c = wda.USBClient() # 连接一台设备
     return c.app_current()

if __name__ == '__main__':
    getPackageName()

3、启动对应的系统应用

进入到对应系统应用界面,运行第二步代码,获得相关信息。

拿App store 为列,打开该应用后,运行代码,返回如下信息:

{'processArguments': {'env': {}, 'args': []}, 'name': '', 'pid': 52741, 'bundleId': 'com.apple.AppStore'}

bundleId 对应的则为App Store的应用包名

4、常见的苹果自带应用Bundle ID如下

苹果自带应用

Name

Bundle ID

iMovie

com.apple.iMovie

Apple Store

com.apple.AppStore

Weather

com.apple.weather

相机Camera

com.apple.camera

iBooks

com.apple.iBooks

Health

com.apple.Health

Settings

com.apple.Preferences

Watch

com.apple.Bridge

Maps

com.apple.Maps

Game Center

com.apple.gamecenter

Wallet

com.apple.Passbook

电话

com.apple.mobilephone

备忘录

com.apple.mobilenotes

指南针

com.apple.compass

浏览器

com.apple.mobilesafari

日历

com.apple.mobilecal

信息

com.apple.MobileSMS

时钟

com.apple.mobiletimer

照片

com.apple.mobileslideshow

提醒事项

com.apple.reminders

Desktop

com.apple.springboard (Start this will cause your iPhone reboot)

第三方应用 Thirdparty

Name

Bundle ID

腾讯QQ

com.tencent.mqq

微信

com.tencent.xin

钉钉

com.laiwang.DingTalk

Chrome

com.google.chrome.ios

5、其他方法

使用ideviceinstaller,需要mac电脑

# 下载
brew install ideviceinstaller

# 查看 包名
ideviceinstaller -l -o list_all
或
ideviceinstaller -u {iOSDeviceId} -l -o list_all

ideviceinstaller常用命令

1、打印app列表
ideviceinstaller -l
2、查看当前已连接的设备的UUID
idevice_id -l
3、获取设备信息
ideviceinfo
4、获取设备时间
idevicedate
5、重启设备
idevicediagnostics restart