NativeScript CLI fail when running "tns run ios" - ios

I'm practicing with this new programming framework called NativeScript, which allows creating native apps using JS. However, when I started working on the Hello World tutorial, I got this error:
https://gist.github.com/longpham91/d603c8fe7f6c6b06e86f
The error occurred when I tried running command "tns run ios" on Terminal, which basically allowed NativeScript to run HelloWorld app on my phone.
I also looked at the error log, and it seemed that the error might have something to do with my Xcode device settings, as explained here:
Check dependencies Code Sign error: No code signing identities found:
No valid signing identities (i.e. certificate and private key pair)
matching the team ID “(null)” were found. CodeSign error: code signing
is required for product type 'Application' in SDK 'iOS 8.4'
I'm not sure what this means, though.

I was able to figure this out after posting a thread on {N} Google group. Here's how:
Generate the Certificate and Provisioning Profile, following this tutorial: http://seventhsoulmountain.blogspot.no/2013/09/ios-code-sign-in-complete-walkthrough.html
Go into the iOS section of your {N} project (under platforms/ios), and run the .xcodeproject file. You can also make a copy of this folder, to be sure that you don't accidentally change something in the source code.
When the Xcode project is opened, go to Xcode > Preferences > Accounts, and click on View Details.
Add the Provisioning Profile by clicking the + button.
That's all. Took me a while to figure this out since I'm not all that familiar with Xcode, but your project should run on your iOS device now.

Not sure, but I think the PATH variable "android / tools and android / platform-tools /" do not exist. You can use the android command in your shell?

Related

I think I have done necessary code signing work but build still failing in Ionic

Building an Ionic app to try and test on my iPhone. I downloaded XCode last night and went in and created a profile with my Apple ID, as well as changing the bundle identified in the "General" and "Signing & Capabilities" tab. However when I run "ionic cordova build ios --prod" I get the error:
error: No profiles for 'io.ionic.starter' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'io.ionic.starter'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'MyApp' from project 'MyApp')
** ARCHIVE FAILED **
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
cordova build ios exited with exit code 65.
Re-running this command with the --verbose flag may provide more information.
It seems to me as though I have done the necessary code signing procedures that I read from Ionic's website, so I am unsure why it still isn't working.
To run the app in your iPhone there are several steps, check these:
You have created your app ID in the website.
You have created your provisioning profile in the website, and downloaded to your computer and added to your Mac (web -> download profile -> double-click)
You have created a development certificate (search how to create a certificate using a Certificate Signing Request generated in your Mac ) and then downloaded that certificate and added to your Mac.
There are two certificates. Distribution certificate is used to publish the app, but development certificate is used simply to run the project in your iPhone, you need that.
But honestly, it's all much easier if you use XCode instead of the console. In the console run the command without --prod, to apply ionic changes to the iOS project. Then if you want to run the app, it's easier if you open XCode and just click play.
With XCode there's the option "Automatically manage signing" that will handle most of this for you automatically. You just have to login to your account using XCode (it will prompt you) and let it do it for you.

"No valid iOS code signing keys found in keychain"

I want to test an iOS application using Xamarin Test Recorder using iOS simulator. To do that I want to publish the project. When trying to publish it for archive, I got this error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com. (MobileApp1.iOS)
Do we need a certificate to publish the project?
When I drag and drop the .app to simulator it doesn't get installed. When I tried to install debug version it gives below error. Failed to chmod /Users/../Library/Developer/CoreSimulator/Devices/8A0508B3-0‌​2E8-4601-A239-B6712F‌​67FF4D/data/Library/‌​Caches/com.apple.con‌​tainermanagerd/Bundl‌​e/Application/1B8A7B‌​17-D9D0-44A6-8584-65‌​7FF1AB5815/MobileApp‌​1.app/MobileApp1 : No such file or directory" Release app also not get installed(No error or warning). Note that this is a xamarin project.What shall I do now?
First of all you do not need to sign/publish your app to use it with Test Recorder.
You can start recording tests from .app located on bin/iPhoneSimulator/Debug/ folder.
The “No valid iOS code signing keys found in keychain” happens when there are no provisioning profiles on your machine. The easiest fix is to create a new app from XCode and deploy it on the device, XCode will automatically downloads the required profiles and certificates

"No code signing identities found" error building cordova app for iOS device

I am trying to build a cordova app for iOS here on my Mac, and I am plagued by the "No codesigning identities found" error. Based on other posts, the frequent resolutions include stopping and restarting Xcode and rebooting, and redownloading the provisioning profile. None of that has worked for me.
It is odd because I reference the provisioning profile by GUID in my build.json, but the error mentions the profile by name. This indicates to me that something somewhere is successfully locating the profile. So I am not sure why it isn't able to use it.
I get the error when I build at the command line using:
cordova build ios --device --buildConfig="build.json"
I would think I should be able to reproduce the issue by building in Xcode, but when I load the cordova project in Xcode and build it, it seems to be fine. But perhaps I am not doing the equivalent step in Xcode. I am just choosing to "Build" in Xcode. Perhaps there is another way to do the equivalent in Xcode?
This same codebase does build successfully on our build box, so this is undoubtedly a config issue here on my Mac. What do I need to do besides download and install the provisioning profile? I have done this both by downloading from Apple Developer and by directly installing through the Xcode preferences.
Below is the exact error I am getting:
Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“[the name of our profile]”) were found.
I am a relative novice building an app developed by someone else. I have tried everything near the top of the Google search results for this error, but not much else. I am likely missing something obvious. Pointers and help would be greatly appreciated.
I had not installed the Enterprise distribution certificate with the private key here on my Mac. Once I did that it worked.

Xcode's Bot always returns error

I got an issue with Xcode's Bot. It always returns the "User canceled the operation. Command /usr/bin/codesign failed with exit code 1" error string after running the command below:
/usr/bin/codesign --force --sign <MY_PRIVATE_KEY> --entitlements /Library/Developer/XcodeServer/Integrations/Caches/2cdd321641e8c114e4eba9819b017479/DerivedData/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/MyApp.app.xcent /Library/Developer/XcodeServer/Integrations/Caches/2cdd321641e8c114e4eba9819b017479/DerivedData/Build/Products/Debug-iphoneos/MyApp.app
I can run this command in Terminal with sudo. I'm using Xcode 6.3.1 and OS X Server 4.1.53 in my Mac 10.10.4.
Thank for your help.
This looks like a code signing error. There are a few different reasons for this to happen so you will need to do some troubleshooting. Can other bots build on your server? If so then its probably a build settings issue in this specific project.
In the Xcode Project go to the Project Target that your trying to build, and then Build Settings, and Code Signing. Under the Provisioning Profile you can either choose Automatic or explicitly choose the correct provision, and then under the Code Signing Identity choose iOS Developer. This is probably where your issue is if its related to the project. Do you have a proper provision setup for the project on the Apple Developer Portal?
If you can't get any bots to run on your server then the issue could be with how you set up Xcode Server. Have you added the server to your team? Here is the blog post that I used to get mine up and running, although you don't need to do all of those steps in the post. Focus specifically on the Setup Certificates section and Setup Provisioning Profiles section.
I fixed the issue by copying the missing provisioning file from my local directory "/Users/phuongle/Library/MobileDevice/Provisioning Profiles" to "/Library/Developer/XcodeServer/ProvisioningProfiles". Do not use the downloaded provisioning file from developer.apple.com directly.
I just want to note here for everyone having the same issue with me.

Do I need iPhone Developer license to run cordova/phonegap in ios simulator?

I don't have an iPhone developer license.
It was working fine when I execute "cordova run ios"
Then I created a new project using "cordova create test_app"
When I run "cordova run ios", it throws this error.
Then the project that used to work is also failing with the same error?
Check dependencies
Code Sign error: No matching codesigning identity found: No codesigning identities (i.e. certificate and private key pairs) matching “iPhone Developer” were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error: /Users/Anthony/dev/test_app/platforms/ios/cordova/run: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Be sure to have no device connected to the Mac else phonegap will try to build and deploy your app on it. I had the issue with my iPhone plugged in.
Also in Xcode be sure that you build the debug release with command line tools (in the info tab of project properties)
I would suggest you to go over the solution in this thread - which tells you how to disabling Code Signing. Anyway, no harm in checking this -
Verify that the Code Signing section's Code Signing Identity within the project settings is set to None -
Search for Code Signing in Target of your app, and check if Don't Code Sign is chosen.
Ey
One thing is to play with XCode and Cordova to make a new project and learn how phonegap or another wrapper works and a different thing is to publish an application. Following the apple specifications, you can always create a new application and test it in the simulator. The benefits of becoming an apple developer are you can try your applications in a physical device but it doesnt mean you cant create an application and try it in the simulator.
If you have tried to run the application in a real device, XCode will complain about the required credentials because you are not an apple developer and you dont have your certificate installed in the keychain so the application cant be signed for deployment on a real device.
If you want to test the application in a device "Yes" you need to become an apple developer and pay the fee, if not, dont worry you can run as many applications as you want in the simulator.
Check the settings of your project as well to see if there is something wrong.

Resources