Skip to main content

Get pid by bundle id (app.pid_for_bid)

Declaration

pid = app.pid_for_bid(bid)

Parameters

  • bid
    String. App bundle identifier. You can find it in XXT App -> More -> App List.

Returns

  • pid
    Integer. The pid if the app is running, otherwise 0.

Example

local qqpid = app.pid_for_bid("com.tencent.mqq")
if qqpid ~= 0 then
sys.alert("QQ is running, pid is: "..qqpid)
else
sys.alert("QQ is not running")
end

Note: uses non-chapter API sys.alert.