app.app.png_data_for_bid
Declaration
lua
app.png_data_for_bid(bid)
Description
Get app icon as raw PNG binary data. Tries
SBSCopyIconImagePNGDataForDisplayIdentifier first, falls back to reading icon file from app bundle Info.plist.Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
bid | string | Required | — | Bundle identifier |
Return Values
| Type | Description |
|---|---|
| string | Raw PNG binary data |
| nil | If icon not found |
Example
lua
local png = app.png_data_for_bid("com.apple.mobilesafari")
if png then file.write("icon.png", png) end