Difference between UNITY_IPHONE and UNITY_IOS

I was testing some code on my iphone4s(running IOS 8.1) for the first time using #if UNITY_IPHONE, however it didn’t seem to execute. I changed this to UNITY_IOS and it worked…

Has anyone else experienced something like this and would anyone know the difference between the two?

Also, I have an android project I am planning to move over for iphones and ipads. It has several plugins which use #if UNITY_IPHONE. Would I need to change each one of these to UNITY_IOS for them to work across all devices?

For a while I used UNITY_IOS since it made perfect sense to me (iPhone + iPad) however I’ve been making an effort to switch over to UNITY_IPHONE because it (UNITY_IOS) is not listed anywhere in Unity’s Documentation, while UNITY_IPHONE is. I have never noticed a difference between the two.

Interesting, I thought this was the case as well and UNITY_IOS was just a renamed version which came about later on.
Not sure why UNITY_IPHONE didn’t work in ios8 on my 4s though.

I’d stick with UNITY_IOS. UNITY_IPHONE doesn’t sounds as good because it’s applicable to iPad as well.

The docs for platform defines is here but UNITY_IOS is not even listed.

1 Like

The docs are probably a bit outdated, as the engine defines only go up to UNITY_4_5. But, I’ve always used UNITY_IPHONE. It returns true on iPad as well.

Docs have been updated.

UNITY_IPHONE is deprecated now. Use UNITY_IOS instead.

2 Likes

Here’s a couple of related bugs I submitted some time ago:

  • DEVELOPMENT_BUILD is not listed. (#661169)
  • MonoDevelop does not colour code correctly when using the Global Custom Defines. (#658658)

I use both to be safe :slight_smile:

#if UNITY_IPHONE || UNITY_IOS

1 Like

UNITY_IOS or UNITY_IPHONE don’t seem to work with my iPhone 4S

Try a Debug statement.