장치마다 스냅 샷 테스트가 있습니다. 테스트를 위해 스냅 샷이있는 특정 시뮬레이터에서 실행되고 있는지 확인하고 싶습니다.iPhone6s Plus 시뮬레이터에서 실행 중인지 확인하는 방법
예를 들어 나는 현재 시뮬레이터가 iPhone6sPlus9.2 이라는 테스트를하고 싶습니다. 스냅 샷이 내가 가지고있는 다른 많은 시뮬레이터 유형에 대해 기록되지 않았기 때문입니다. 여기 https://github.com/erica/uidevice-extension/
및
// UIDevice + YYAdd.h // YYKit https://github.com/ibireme/YYKit의 코드에서도
(lldb) po [[UIDevice currentDevice] platform]
x86_64
(lldb) po [[UIDevice currentDevice] hwmodel]
MacBookPro11,2
(lldb) po [[UIDevice currentDevice] platformType]
0x0000000000000002
(lldb) po [[UIDevice currentDevice] platformString]
iPhone Simulator
(lldb) po [[UIDevice currentDevice] model]
iPhone
(lldb) po [[UIDevice currentDevice] localizedModel]
iPhone
(lldb) po [[UIDevice currentDevice] systemName]
iPhone OS
(lldb) po [[UIDevice currentDevice] systemVersion]
9.2
(lldb) po [UIDevice currentDevice]
<UIDevice: 0x7fccf060a480>
(lldb) po [[UIDevice currentDevice] name]
iPhone Simulator // I WANT TO KNOW THAT IT IS IPHONE6SPLUS 9.2
및 코드 :
나는 같은 많은 변화를 시도했다
하지만 둘 다 장치 유형에 대해 "x86"과 같이 관련성이없는 값을 반환합니다.
http://stackoverflow.com/questions/26028918/ios-how-to-determine-iphone-model-in- 신속한 – ColdSteel
좋지 않습니다. 그게 물리적 인 장치 야. 시뮬레이터 유형이 필요합니다 –
내 답변이 도움이 되었습니까? –