lmirosevic / gbdeviceinfo Goto Github PK
View Code? Open in Web Editor NEWDetects the hardware, software and display of the current iOS or Mac OS X device at runtime.
License: Apache License 2.0
Detects the hardware, software and display of the current iOS or Mac OS X device at runtime.
License: Apache License 2.0
Is it possible to detect device type for iOS simulator? e.g. iPhone 6 simulator?
I am using this library but for iPhone xs & XsMax its showing me unknown devices.
Hi when I try to load your pod this way
pod 'GBDeviceInfo', '~> 5.5'
pod 'GBDeviceInfo / Jailbreak'
I receive the error below.
How can I solve?
Thank you
[!] The 'Pods-MYPODS' target has transitive dependencies that include static binaries: (MY_DIR/Pods/GBJailbreakDetection/GBJailbreakDetection.framework)
I tried to include GBDeviceInfo in my Cartfile (including the line github "lmirosevic/GBDeviceInfo" ~> 6.0
in the Cartfile, I also tried to add different lines in the Cartfile but it's always the same) but when I run carthage update --platform ios
I get the following error:
Dependency "GBDeviceInfo" has no shared framework schemes for any of the platforms: iOS
What am I doing wrong to include this framework in my application through Carthage?
Hi. I'm getting "Unknown device" on the last gen iPod Touch. I've been debugging and the device version is (major = 7, minor = 1), but this library only supports until 5,1.
It would be nice that if you don't support a certain model, at least let us know what device it is. For example, iPad12,8 (non-existing yet) might return just iPad..
It seems when you run the iPhone on simulator it won't let you know if it is a 4s, 5, 5s or 6. It just reports simulator any work around on that on simulators?
I'm using the library with Carthage and would like to be able to point my Cartfile to a version to get the latest. Will you please cut a release that includes the latest commit?
We incorporate the source code of the library into a large project, which we build using cmake. Since cmake doesn't officially support precompiled headers yet, we don't use them. This causes compilation errors on iOS because of a missing include for UIKit, which is only included from the PCH file. It's trivial to fix and we patched the code, but I wanted to let you know about this use case. Maybe you'll want to do something about it so the library can be used flawlessly in cmake/non-PCH setups.
@x2on Please add me as an owner for CocoaPods Trunk
Why isn't this wrapped in dispatch_once?
https://github.com/lmirosevic/GBDeviceInfo/blob/master/GBDeviceInfo/GBDeviceInfo_iOS.m#L87
iPhone 6 and iPhone 6 Plus please!
ld: bitcode bundle could not be generated because '.../Pods/GBJailbreakDetection/GBJailbreakDetection.framework/GBJailbreakDetection(GBJailbreakDetection.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7
xcode 7.0.1
What method do you use to check if a device is Jailbroken?
I have used GBDeviceInfo in alot of projects over the years. However, in a recent project that had alot of common code between iOS and TVOS, i had to remove the pod. Do you have any plans for adding TVOS support?
First, thanks! GBDeviceInfo has served us well for a while now
I am curious if the Apple Watch is something that can be identified?
I know there's a bit of a strange case because the watch extensions run on the phone, so technically it's still being executed on an iPhone. Any insight/thoughts on this?
Thanks again!
Hi, in my podfile I type the line
pod 'GBDeviceInfo', '~> 3.5'
just as you said in github. But can't install successfully. here are the error information:
[!] Unable to satisfy the following requirements:
- `GBDeviceInfo (~> 3.5)` required by `Podfile`
I need this project in my App to adapt the newest iPhone 6S and Plus. Thanks!
-[NSTaggedPointerString unsignedIntegerValue]: unrecognized selector sent to instance
Please fix OS X retina resolution
NSScreen *mainScreen = [NSScreen mainScreen];
NSRect rect = [mainScreen convertRectToBacking:mainScreen.frame];
iPhoneXS等设备更新了,麻烦作者抽空更新下,感谢!
Cocoapods is now able to build pods as dynamic frameworks, which is necessary for compiling Swift dependencies. I just tried updating GBDeviceInfo, but get this error:
[!] The 'Pods-Foo' target has transitive dependencies that include static binaries: (/[PATH_TO_FOO]/Pods/GBJailbreakDetection/GBJailbreakDetection.framework)
Device Information for iPhone 8, 8+, and X
im trying to add this as a git submodule but i cannot. i added it as a submodule. then i added the .a
file in the requred linked frameworks. then i import the header file but i get file not found.
Latest iOS devices since the iPhone X have cores that don't have the same frequency, where there are two "fast" cores and four "slow" or low power cores. Do you have any plans to retrieve that info? Thanks!
It's look like this lib is not working on iOS iPad simulator:
I executed this code on iPad Pro (10.5-inch) simulator 10.3.1:
if GBDeviceInfo.deviceInfo().family == .familyiPad {
print("IPAD")
}
and it's prints nothing.
I don't know if this is working on really device because currently I don't have one.
Hi
would it be possible to move the jailbreak detection (and therefore the dependency to GBJailbreakDetection) to a cocoapod subspec?
The reason is that our app needs to get reviewed and audited on a regular basis and having a closed source/compiled component in there adds some hassle for us. And we anyway need to do jailbreak detection but are forced to use another implementation.
What do you think about that change? I could try to create a PR for that.
Hi there,
I've build the GBDevice info library as a static library (iOS) via the attached Xcode project.
The resulting files look as follows:
Since the header file GBDeviceInfo_iOS.h is the only header copied to the resulting folder, I receive a build error once I integrated the resulting folder into an Xcode project.
Am I using the resulting library in the wrong manner?
Is it fine to simply copy the necessary header into my project.
These would be:
GBDeviceInfo_Common.h
GBDeviceInfoTypes_Common.h
GBDeviceInfoInterface.h
GBDeviceInfoTypes_iOS.h
How can used it in swift?
Hi!
Any update for new iPhone SE and iPad Pro 9.7?
It would be nice to be able to test different device configurations on the simulator rather than them being included as a separate device aka GBDeviceModelSimulatoriPhone or GBDeviceModelSimulatoriPad
Please add version tags to your repo, so you can specify a explicit version (e.g. for CocoaPods)
libGBDeviceInfo.a(GBDeviceInfo_Common.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
How do I know the number of CPU instruction sets of the device
If a iPhone is a 32 - bit architecture or a 64 - bit architecture, I have more memory to allocate when I do some memory alignment.
Hi,
Thank you for your amazing framework.
I used GBJailbreakDetection (1.3.0) and GBDeviceInfo (3.8.0) in my project.
in the latest release in my project I add isJailbroken and its working fine in development, but after I submit my release to the app store, I found many issues in Crashlytics like the image attached and some users told me their devices not jailbroken but they can't use the app because the app told them you use Jailbroken device.
The crash in Crashlytics it is normal?
Note: When isJailbroken true i show msg alert for the user and when he click on the button I use exit() func to close the app.
Hi, I noticed that your OS X operating system version info comes by way of a uname call. It looks like the Darwin kernel information is not a reliable way to do this, at least as of Yosemite .1.
On various 10.10.1 Macs we all see:
mymac:~ me$ uname -a
Darwin mymac 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Which is consistent with the 0 minor os version returned by GBDeviceInfo.
May I suggest basing your version string on the system version plist instead? Something like:
NSString *systemVersion = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"][@"ProductUserVisibleVersion"];
iPhone11 Pro?
When I try reproing the code from the example I get the following error:
property "nodeName" not found on object of type 'GBDeviceInfo'
property "cpu" not found on object of type 'GBDeviceInfo'
I've imported the library into my file. I'm not sure why it doesn't seem to see it.
Are these properties only available for mac? I'm trying to run on iOS simulator.
GBDeviceDisplay display = [GBDeviceInfo deviceInfo].displayInfo.display;
when I print display info, it is always "GBDeviceDisplayUnknown" in the simulator.
Is this normal in the simulator?
Will it work in the real devices?
Simply logging the device info without the Jailbreak sub spec raises an exception.
Example:
NSLog(@"%@", [GBDeviceInfo deviceInfo]);
Hello @lmirosevic,
We seem to be having some compile-time warnings due to some changes that were made for Bit support with GBJailbreakDetection. I've tried DerivedData clean, Xcode clean, completely fresh pod install, etc. and am still not having any luck. My issues:
warning: object file (/Users/kyleturner/Projects/NeXgen-iOS/Pods/GBJailbreakDetection/GBJailbreakDetection.framework/GBJailbreakDetection(GBJailbreakDetection.o)) was built for newer iOS version (8.2) than being linked (8.0)
And about 10 instances of warnings like:
warning: /Users/lm/Library/Developer/Xcode/DerivedData/ModuleCache/2MGDRTGQWFKA4/Darwin-38I6DLZ5IH61J.pcm: No such file or directory
warning: /Users/lm/Library/Developer/Xcode/DerivedData/ModuleCache/2MGDRTGQWFKA4/ObjectiveC-1RQA2RIXJIE19.pcm: No such file or directory
or
warning: Could not resolve external type c:objc(cs)NSArray
warning: Could not resolve external type c:objc(cs)NSString
warning: Could not resolve external type c:objc(cs)NSMethodSignature
Were local files accidentally included in your most recent Pod update?
We're pulling in GBJailbreakDetection v1.1.0
with either version of GBDeviceInfo
(3.3.0 or 3.2.0), but I'm not certain that was your intention? Maybe we're missing something on our end?
If you could please help us resolve this issue, that would be greatly appreciated. Please let us know if we can provide any more debugging information/repro steps.
Thank you!
Hello @lmirosevic, In GBDeviceInfoTypes_iOS.h file, GBDeviceDisplay enum does not contain iPad Pro's device display type.😀
Hi! Thanks for creating such a useful library.
I just updated to the latest and noticed a somewhat problematic change. In the absence of PPI data on iOS, where the OS doesn't provide an easy lookup of the screen's PPI, we're falling back to the following code in GBDeviceInfo_iOS.m:
[UIFont systemFontOfSize:72].lineHeight
I was initially excited, thinking we'd found a future proof way of getting PPI on iOS...but on closer inspection, I think this doesn't do what the author intended. For example, on an iPhone X, that code returns 85.921875. The true PPI in the lookup table is 458... In general, it seems this code just creates a font with 72 point height and then gets its standard line spacing in points, with no relation to the physical height of the screen or pixels.
It feels like we should just revert out the else defining the default, if it doesn't have any particular relation to the true value. I'd suggest preserving the previous behavior of returning 0, over returning some wrong value, though we could do 153*[[UIScreen mainScreen] scale], to provide a better default. That'd be right for the iphone X family anyway, and about right for some older ones.
Would reverting be an okay change? Happy to submit the PR, if so.
Commits that introduced the issue:
47a2217
32a68f0
Thanks!
I'm on the simulator, and I'm familiar with #41, and I looked briefly at the code which sets GBDeviceDisplayUnknown for the simulator, but I have an NSAssert firing on a return from [GBDeviceInfo deviceInfo].displayInfo.display when GBDeviceDisplayUnknown is returned that was not firing before. It looks like you used to return a valid display for this value, even if it was generic? Or am I wrong about this? This is a breaking change if so.
Hi, when we could get an update with a latest iPad?
Please add a podspec. This lib is very helpful, would be nice to have it as a cocoapod.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.