iOS獲得裝置相關資訊,獲取app相關資訊

2021-07-22 07:37:42 字數 2394 閱讀 2368

(@"裝置所有者名稱  %@  "

,device.

name

);//裝置所有者名稱

nslog

(@"裝置類別  %@"

,device.

model

);//裝置leibie

nslog

(@"本地化版本  %@"

,device.

localizedmodel

);//本地化版本

nslog

(@"當前系統版本  %@"

,device.

systemversion

);//當期版本

nslog

(@"當前系統  %@"

,device.

systemname

);//當前系統

nslog

(@"系統唯一標示符  %@"

,[[[

uidevice

currentdevice

] identifierforvendor

] uuidstring

]);//唯一標示

nslog

(@"電量   %f"

,[[uidevice

currentdevice

] batterylevel

]);//輸出-1為模擬器  輸出0-1為真機

nsarray

*languagearray = [

nslocale

preferredlanguages

];nsstring

*language = [languagearray

objectatindex:0

];nslog

(@"語言:%@"

, language);

//語言

nslocale

*locale = [

nslocale

currentlocale

];nsstring

*country = [locale

localeidentifier

];nslog

(@"國家:%@"

, country);

//國別

//獲得運營商資訊

cttelephonynetworkinfo

*info = [[

cttelephonynetworkinfo

alloc

] init

];//  獲取執行商的名稱

ctcarrier

*carrier = [info

subscribercellularprovider

];nsstring

*mcarrier = [

nsstring

stringwithformat

:@"%@"

,[carrier

carriername

]];nslog

(@"%@"

, mcarrier);

nsdictionary

*dicinfo = [[

nsbundle

mainbundle

] infodictionary

];nslog

(@"應用所有資訊 %@"

,dicinfo);

nsstring

objectforkey

:@"cfbundledisplayname"

];nslog

(nsstring

objectforkey

:@"cfbundleshortversionstring"

];nslog

(nsstring

objectforkey

:@"cfbundleversion"

];nslog

(nsstring

objectforkey

:@"cfbundleidentifier"

];nslog

(

ios 獲取裝置相關的資訊

1 獲取裝置的資訊 uidevice device uidevice alloc int nsstring name device.name 獲取裝置所有者的名稱 nsstring model device.name 獲取裝置的類別 nsstring type device.localizedmod...

iOS 怎樣獲得裝置及應用相關資訊

uidevice device uidevice alloc init nslog 裝置所有者名稱 device.name 裝置所有者名稱 nslog 裝置類別 device.model 裝置類別 nslog 本地化版本 device.localizedmodel 本地化版本 nslog 當前系統版...

獲取iOS裝置資訊

鑌哥就直接寫 了 獲取手機資訊 應用程式的名稱和版本號等資訊都儲存在mainbundle的乙個字典中,用下面 可以取出來 nsdictionary infodict nsbundle mainbundle infodictionary nsstring versionnum infodict obj...