Has anyone found the iPhone 4's browser's user-agent string yet?
-
On this [SO answer](http://stackoverflow.com/a/12580745/363573), you can find a generic regular expression to check if a given user agent string is a **iOS 4** one. – Stephan Sep 25 '12 at 11:32
-
@Stephan: no, you can't. There is no difference between iPhone 3 or 4 or whatever. – Andy Jun 02 '15 at 09:06
7 Answers
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7

- 479,566
- 201
- 878
- 984

- 10,990
- 3
- 33
- 29
-
1
-
5Here, I found the source, straight from Apple: http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html – YOMorales Jun 30 '11 at 18:13
-
-
@Shri - Put your last in a new question, not a comment of an answer to a related question. – user66001 May 06 '14 at 04:33
-
1This is no valid answer anymore! iPhone OS 4_0 is a long time ago, so already with a upgrade of iOS this answer would be invalid. – Andy Jun 02 '15 at 09:01
-
I got `iPhone OS 4_0` today from my iPhone 7 and I have no idea how or why! – Simon_Weaver Nov 16 '17 at 09:36
You can use:
To find your user agent (Google: "What is my user agent" gives this answer)

- 5,670
- 6
- 28
- 39
-
1
-
1
-
1Maybe my answer is not completely right if you wanted to know iPhone4 User-Agent without owning one (because you were analyzing web server logs or something), but I wanted to show and *document* how to get the user-agent from any device connected to Internet. Hope it helps to someone. – licorna Jun 23 '10 at 21:42
-
1its totally right; and there isn't a difference between a 3gs, 3g and iphone4 all running ios4. It's still "iPhone"... if you google the reported user-agents of iphone4's or go to whatsmyuseragent.com with a 3g(s) updated to ios4 it's the same user agent. – Dan Heberden Jun 23 '10 at 23:39
-
1
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Mobile/7D11
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A306 Safari/6531.22.7
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d Safari/6531.22.7
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2 like Mac OS X; en_us) AppleWebKit/525.18.1 (KHTML, like Gecko)
- Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5
...for now

- 1,200
- 13
- 17
This site seems to keep a complete list that's still maintained
iPhone, iPod Touch, and iPad from iOS 2.0 - 5.1.1 (to date).
You do need to assemble the full user-agent string out of the information listed in the page's columns.

- 31,017
- 13
- 83
- 207
You cannot identify the (hardware) version of an iPhone by user agent.
It's only possible to recognize that it's an iPhone and which software versions it's running.
Using the Safari User Agent String
Not even WURLF can.

- 4,783
- 2
- 26
- 51
Note: The user agent strings from Facebook's internal browser do indicate the actual physical device. Even the cellphone carrier (eg. AT&T)
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 [FBAN/FBIOS;FBAV/149.0.0.39.64;FBBV/79173879;FBDV/iPhone7,2;FBMD/iPhone;FBSN/iOS;FBSV/10.3.3;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5;FBRV/0
Mozilla/5.0 (iPhone; CPU iPhone OS 11_1 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B93 [FBAN/FBIOS;FBAV/148.0.0.45.64;FBBV/78032376;FBDV/iPhone10,4;FBMD/iPhone;FBSN/iOS;FBSV/11.1;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5;FBRV/0]
These won't be the case in Safari or Chrome from iOS - only within the browser inside the Facebook app.
(I'm getting iPhone9
too though - not quite sure what that is!)

- 140,023
- 84
- 646
- 689