Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can Unity codes be converted to both iOS and Android codes?

Discussion in 'General Discussion' started by Yunho0320, Jun 13, 2018.

  1. Yunho0320

    Yunho0320

    Joined:
    May 16, 2015
    Posts:
    11
    Hi, guys! Before you start reading, I thank you in advance for reading my question!

    Basically, I'm new to Unity but I have solid knowledge in programming (I've been programming for 3 years).
    The reason I want to use Unity is that I'm planning to make simple mobiles on both Android and iOS.
    From what I read so far, if I code on Unity using C#, I can convert the programme to different platforms including Android and iOS.
    However, if I were to not use Unity, I'd have to use Java for Android and Swift or Objective-C for iOS.

    So my question, can my game built with Unity (programmed with only C#) be transformed into both Android and iOS games without having to code in Java and Swift or Objective-C?
    If so, how is that possible?? Does Unity automatically converts my C# code to Java Swift or Objective-C?


    Thank you so much for reading and I'd really appreciate any comments!
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Yes, this is what Unity is great at. Create your app in the editor, and then build to your targets, i.e. iOS and Android in your case.
     
    Kiwasi and Yunho0320 like this.
  3. Yunho0320

    Yunho0320

    Joined:
    May 16, 2015
    Posts:
    11
    So, when I convert the code, can it be directly uploaded to Appstore and Play Store?
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Well, it's not as simple as that.

    I don't have experience of Android, but I can tell you about iOS.

    When you build from Unity an Xcode project is created, which you can build and then run on a device. In Xcode you can also create the package which will be submitted to Apple (for the AppStore). There are other things you need to do in the Apple Developer site and iTunes Connect in order to actually get the app released on the AppStore.
     
    Yunho0320 likes this.
  5. Yunho0320

    Yunho0320

    Joined:
    May 16, 2015
    Posts:
    11
    That sounds great! Do you think the converted code by Unity is slower than the ones made by Swift/Objective-C or wouldn't there be much difference? I really appreciate answering my questions!!
     
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Yes. Unity is a build once, deploy everywhere system. You can make a single game, then deploy it to the web, PC, MAC, Andoid, iPhone, XBox, PlayStation... and so on. There is even a legendary 'deploy to toaster' button lurking somewhere in the depths of the editor.
     
    Yunho0320 likes this.
  7. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Don't know. I wouldn't worry about it.
     
    Yunho0320 likes this.
  8. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    ^kinda reminds of that java model thingy. Shame things have gone back to using native languages wherever poss. Just means my battery life on my phone lasts longer and doesn't need a bloated framework/virtual machine to run a bit of software. *sigh*
     
    Yunho0320 likes this.
  9. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    If you have assets with native code they need to have build targets for your target platform. I know some are missing UWP for example.
     
    Yunho0320 likes this.
  10. Drunken-Monkey

    Drunken-Monkey

    Joined:
    Dec 15, 2011
    Posts:
    95
    Just a heads up. A Mac will be required for the IOS deployment, even if you use the cloud build, you still need application loader to upload to the app store.
     
    Yunho0320 and Kiwasi like this.