Search code examples
iosiphonexcodemobilefirst-cli

How to deploy MobileFirst CLI application to an IOS device?


I am using MobileFirst CLI 7.1. I want to deploy my MobileFirst CLI application to an IOS device. How can I do that?

I navigated to the iphone environment and tried to double click the .xcodeproj. In the XCODE I see that the project is still being shown as library.

enter image description here

I am getting this following error when I try to deploy the application, enter image description here. I have gone through stackoverflow questions. None of them were helpful.

I want to know how can I target remote server. (In Studio we had an option to deploy to remote environment.)


Solution

  • You already asked the second question: How to deploy MobileFirst CLI application to an android device?. The answer is still the same:

    Also I want to know how can I target remote server. (In Studio we had an option to deploy to remote environment.)

    In the Studio you did not have the option to "deploy to a remote server". You had the option to configure the application to point to a remote server (the properties you can edit in the worklight.plist(for iOS) / wlclient.properties file (for Android).

    This feature does not exist in the CLI. After building the project, in case you want it to point to a different server, edit the properties in said file(s) to point to the remote server.

    The first question is unclear.
    I have done the following and was able to launch the project in Xcode and run the app in the iOS Simulator:

    1. mfp create myproject

    2. cd myproject

    3. mfp add hybrid

      added an app called "test"

    4. mfp add environment iphone

    5. mfp push

      opened the project folder and navigated to apps\test\iphone\native, followed by double-clicking on the .xcodeproj file. The project opened in Xcode successfully and I then clicked on the Run button, and the app launched in the iOS Simulator.