4

I created an account with Telerik, signed a certificate with Apple Dev Centre and got a mobile provisioning. I used Appbuilder to import the certificate and the provision to my laptop. But I still cannot deploy my app on iOS using

tns deploy ios

The warning says:

IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your OS X system.

But when I do "appbuilder provision" and "appbuilder certificate", the commands show me they have been successfully imported. I also tried:

appbuilder deploy ios --provision '<name>' --certificate '<title>'

It says no project found at or above path and neither was a --path specified. But I am in the project folder. :/

Sorakthun Ly
  • 732
  • 2
  • 8
  • 15
  • Perhaps you have to add your `TEAM_ID` in `app/App_Resources/iOS/build.xcconfig` file in your project and then to run `tns run ios` for deploying your app. For further instruction you could also review this issue. - https://github.com/NativeScript/NativeScript/issues/3125#issuecomment-261890308 – Nikolay Tsonev Nov 29 '16 at 10:59

1 Answers1

7

For me, I used:

$ tns deploy ios --device <device-udid>

Now, beforehand I...

  1. Registered my device with Apple

    • Link: developer.apple.com/account/ios/device
  2. Created an explicit Bundle ID with Apple that matches the one that Native Script places in the package.json. This is what mine looked like.

    "nativescript": {
        "id": "org.nativescript.<app-name>",
        "tns-ios": {
            "version": "3.0.1"
        },
        "tns-android": {
            "version": "3.0.1"
        }
      }
    
    • Link: developer.apple.com/account/ios/identifier/bundle
  3. I then made provisioning profile with Apple https://developer.apple.com/account/ios/profile/ that then included the device and Bundle ID that I just made.

  4. Then in the file /app/App_Resources/iOS/build.xcconfig

    • Link: developer.apple.com/account/ios/identifier/bundle

ie.

    DEVELOPMENT_TEAM = <Apple-dev-team-name>
    PROVISIONING_PROFILE = <provision-profile-id>
  • The provison profile is found in User/Library/MobileDevice/Provisioning\ Profiles/

  • If there is more than one, sort be creation date and grab the first one

  • Then ctrl-click and choose "Rename" copy the ID and paste it into the build.xcconfig file from earlier.

    1. To get the device UDID, you could use iTunes, but {N} makes it easy by running this in the terminal:

$ tns device ios --available-devices

  • It shows up at the bottom under all the different emulators

i.e.

    │#│Device Name│Platform│Device Identifier│ Type │  Status │
    │1│  iPhone   │ iOS    │  <device-udid>  │Device│Connected│
  1. After all that, run:

$ tns deploy ios --device <device-name>

P.S. : Let me know if this works.

  • I also had an issue with it still saying Code signing need in iOS 10.3. I solved it strangely by opening xcode, clicking my project, and reselecting my Signing (Debug) and Signing (Release). This then let my use `$ tns deploy ios --device `. I do still get "Apple Mach-O Linker (Id) Error," with a sub error "Linker failed with exit code 1 (use -v to see invocation). – Harrison Welch Jun 22 '17 at 13:50
  • The .xcodeproj file is in /platforms/ios/ – Harrison Welch Jun 22 '17 at 16:00
  • There has been a fix in the (as of writing) experimental 3.1.0; Link = https://github.com/NativeScript/nativescript-cli/issues/2874 `npm un -g nativescript && npm cache clean && npm i -g nativescript@next` – Harrison Welch Jun 23 '17 at 13:47