Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:48:51+00:00 2026-06-05T05:48:51+00:00

How can I determine what iPhone, iPod, iPad Model is using my application? I

  • 0

How can I determine what iPhone, iPod, iPad Model is using my application? I would like to get output like: iPhone, iPhone 3G, iPhone 3GS etc

Like this answer for plain objective C: Answer to my question in Objective C

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:48:53+00:00Added an answer on June 5, 2026 at 5:48 am

    Took this example and updated it to the current list of iOS Devices and Simulators as of March 24th 3PM PST. Enjoy.

    using System;
    using System.Runtime.InteropServices;
    using MonoTouch.Foundation;
    using MonoTouch.UIKit;
    
    namespace YourNamespace
    {
    public class IOSDeviceHardware
    {
        public const string HardwareProperty = "hw.machine";
    
        public enum IOSHardware {
            iPhone,
            iPhone3G,
            iPhone3GS,
            iPhone4,
            iPhone4RevA,
            iPhone4CDMA,
            iPhone4S,
            iPhone5GSM,
            iPhone5CDMAGSM,
            iPodTouch1G,
            iPodTouch2G,
            iPodTouch3G,
            iPodTouch4G,
            iPodTouch5G,
            iPad,
            iPad3G,
            iPad2,
            iPad2GSM,
            iPad2CDMA,
            iPad2RevA,
            iPadMini,
            iPadMiniGSM,
            iPadMiniCDMAGSM,
            iPad3,
            iPad3CDMA,
            iPad3GSM,
            iPad4,
            iPad4GSM,
            iPad4CDMAGSM,
            iPhoneSimulator,
            iPhoneRetinaSimulator,
            iPadSimulator,
            iPadRetinaSimulator,
            Unknown
        }
    
        [DllImport(MonoTouch.Constants.SystemLibrary)]
        static internal extern int sysctlbyname([MarshalAs(UnmanagedType.LPStr)] string property, IntPtr output, IntPtr oldLen, IntPtr newp, uint newlen);
    
        public static IOSHardware Version {
            get {
                var pLen = Marshal.AllocHGlobal(sizeof(int));
                sysctlbyname(IOSDeviceHardware.HardwareProperty, IntPtr.Zero, pLen, IntPtr.Zero, 0);
    
                var length = Marshal.ReadInt32(pLen);
    
                if (length == 0) {
                    Marshal.FreeHGlobal(pLen);
    
                    return IOSHardware.Unknown;
                }
    
                var pStr = Marshal.AllocHGlobal(length);
                sysctlbyname(IOSDeviceHardware.HardwareProperty, pStr, pLen, IntPtr.Zero, 0);
    
                var hardwareStr = Marshal.PtrToStringAnsi(pStr);
    
                Marshal.FreeHGlobal(pLen);
                Marshal.FreeHGlobal(pStr);
    
                if (hardwareStr == "iPhone1,1") return IOSHardware.iPhone;
                if (hardwareStr == "iPhone1,2") return IOSHardware.iPhone3G;
                if (hardwareStr == "iPhone2,1") return IOSHardware.iPhone3GS;
                if (hardwareStr == "iPhone3,1") return IOSHardware.iPhone4;
                if (hardwareStr == "iPhone3,2") return IOSHardware.iPhone4RevA;
                if (hardwareStr == "iPhone3,3") return IOSHardware.iPhone4CDMA;
                if (hardwareStr == "iPhone4,1") return IOSHardware.iPhone4S;
                if (hardwareStr == "iPhone5,1") return IOSHardware.iPhone5GSM;
                if (hardwareStr == "iPhone5,2") return IOSHardware.iPhone5CDMAGSM;
    
                if (hardwareStr == "iPad1,1") return IOSHardware.iPad;
                if (hardwareStr == "iPad1,2") return IOSHardware.iPad3G;
                if (hardwareStr == "iPad2,1") return IOSHardware.iPad2;
                if (hardwareStr == "iPad2,2") return IOSHardware.iPad2GSM;
                if (hardwareStr == "iPad2,3") return IOSHardware.iPad2CDMA;
                if (hardwareStr == "iPad2,4") return IOSHardware.iPad2RevA;
                if (hardwareStr == "iPad2,5") return IOSHardware.iPadMini;
                if (hardwareStr == "iPad2,6") return IOSHardware.iPadMiniGSM;
                if (hardwareStr == "iPad2,7") return IOSHardware.iPadMiniCDMAGSM;
                if (hardwareStr == "iPad3,1") return IOSHardware.iPad3;
                if (hardwareStr == "iPad3,2") return IOSHardware.iPad3CDMA;
                if (hardwareStr == "iPad3,3") return IOSHardware.iPad3GSM;
                if (hardwareStr == "iPad3,4") return IOSHardware.iPad4;
                if (hardwareStr == "iPad3,5") return IOSHardware.iPad4GSM;
                if (hardwareStr == "iPad3,6") return IOSHardware.iPad4CDMAGSM;
    
                if (hardwareStr == "iPod1,1") return IOSHardware.iPodTouch1G;
                if (hardwareStr == "iPod2,1") return IOSHardware.iPodTouch2G;
                if (hardwareStr == "iPod3,1") return IOSHardware.iPodTouch3G;
                if (hardwareStr == "iPod4,1") return IOSHardware.iPodTouch4G;
                if (hardwareStr == "iPod5,1") return IOSHardware.iPodTouch5G;
    
                if (hardwareStr == "i386" || hardwareStr=="x86_64")
                {
                    if (UIDevice.CurrentDevice.Model.Contains("iPhone"))
                    {
                        if(UIScreen.MainScreen.Scale > 1.5f)
                            return IOSHardware.iPhoneRetinaSimulator;
                        else
                            return IOSHardware.iPhoneSimulator;
                    }
                    else
                    {
                        if(UIScreen.MainScreen.Scale > 1.5f)
                            return IOSHardware.iPadRetinaSimulator;
                    else
                        return IOSHardware.iPadSimulator;
                    }
                }
    
                return IOSHardware.Unknown;
            }
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an iPhone application and would really like to determine if
from what i read i understand that iPhone can determine your location using Wi-Fi.
Can someone tell me how I can determine (using JavaScript etc.) what browser is
Possible Duplicate: Determine device (iPhone, iPod Touch) with iOS I have tried to get
I'm writing a game for iPhone/iPod. My engine is using OpenGL-ES, and this means
I want to create an application that can determine if some text was copied
How can I determine if an input string only contains spaces, using javascript?
Possible Duplicate: Determine device (iPhone, iPod Touch) with iOS I am making a game
Can GPS on a phone, such as iPhone or Android determine your Z coordinates
How can I parse a string that represents a date and/or time using iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.