Nativescript - trying to run app on device connected to Mac (iOS) - nativescript

I'm trying to run my app on a phone connected directly to the Mac.
tns run iOS
It's in debug mode - not. signed with production certs etc.
I'm getting the following error:
Unable to apply changes on device: 4d86dddfd4ec1ae761441ed5947acb7c143120e3. Error is: Command xcodebuild failed with exit code 65.
I can run on the emulator fine.
Any help?

Just had that error myself after attaching a new iphone to my computer.
I did tns platform remove ios and then tns platform add ios and it worked.

I had the same issue the last week. Exist some zombie processes and some weird ram issues related with that. I can't log everything :(
I did the following:
Check your current processes in Activity monitor and close everything for the first build.
Run: tns build ios --for-device --team-id TEAM_ID
After that, run: tns run ios --team-id TEAM_ID
Yes, foolish steps but works.
I'll put some logs here when I can.

Related

React Native `RuntimeError: abort(Error: xcrun exited with non-zero code: 2` on iOS simulator

I was working on a React Native project with a group and was asked to use the iPhone 13 simulator as a model while working. I only had access to the iPhone 12 simulator, and I saw that my XCode was a version behind, so I updated it. Now with the new XCode, I am getting an error when I start the React Native server and try and open the iOS simulator. the error is shown below:
Running this command with the suggested build with -s Assertions=1 reveals the following:
My package.json is as following:
Any idea what is going on or how to proceed? Expo seems to be able to run, but trying to open the simulator crashes the server. The project I am on is near tight deadlines and I am totally held up by this. Either a way to troubleshoot this error or a way to roll back my XCode install and just live with a dated simulator would be greatly appreciated.
Figured it our thanks to ShepSims from https://github.com/expo/expo-cli/issues/2413 . Before being able to open the iOS simulator from the terminal, I needed to open XCode and open the simulator there. This mounts the simulator bundle, allowing later access by pressing i after running expo start.
I was receiving the same error as above with XCode command line tools installed only, no XCode installed.
I tried re-installing XCode command line tools which didn't do anything.
For me this was solved with advice mentioned at https://github.com/expo/expo-cli/issues/3871:
open Simulator.app, as it automatically sets the default device.
It is not anything. It was solved by opening simulator from XCOde on my mac
The fastest way from my point of view is "spotlight" (Cmd+Space) search for "Simulator", hit enter before running "expo start" in your terminal.
You can solve the problem by using this command
sudo expo start
Or
manually open simulator
start app: react-native run-ios
manually do: Hardware -> Device -> select iOS -> select Device (different than before !)
that will open a second simulator
start the app again: react-native run-ios (expo start then press i)
this opens the app in the selected simulator
Note:- please stay open the silumater then press the i in the expo and same for the react-native run-ios command

Xamarin error ios Simulator HE0046: Failed to install the app ... Failed to install the requested application

I changed name of my VS 2019 project running on Mac (from PrismApp1 to something else) and now I can't run on iOS simulator. Tried to run on different simulator phone too. I searched for PrismApp1 in folder and on machine can't find anything... delete bin and obj folders and did a Build All. any ideas?
error HE0046: Failed to install the app 'com.companyname.PrismApp1' on the device 'iOS 13.2 (17B102) - iPhone 11 Pro': Failed to install the requested application
Note: it works if i deploy to my physical iPhone...
I had a similar issue with iPhone 13 emulator and iOS 15, where I couldn't deploy my app on the simulator, but it worked on a real device.
The error I was getting was:
error HE0046: Failed to install the app 'ma.myapp.app' on the device 'iOS 15.0 (19A339) - iPhone 13 mini': “Myapp” Needs To Be Updated
This is how I solved the issue.
I had this weird error after app was successfully compiled and it was simply due to a null variable involved in a plist command executed post build.
Just try to close and reopen VS, it worked for me.

Cordova Build causing xcodeBuild to quit unexpectedly

I've got a basic react app running in Cordova, when I run a
cordova build ios
Things seem to work OK but then after a short delay I get the following:
If I run a
cordova run ios
I get the following
No target specified for emulator. Deploying to iPhone-X, 12.1
simulator
/Users/Liam/code/ProjectName/app-src/platforms/ios/build/emulator/ProjectName/Info.plist
file not found.
I've done the usual, clean, remove platform, re-add platform but same issues. Any ideas what causes this or how to debug further?
I can run the Cordova App from XCode

Nativescript: Socket connection timed out

I am on Mac and I want to run my app on a USB-C connected Android device.
My first step is always to remove node_modules, hooks and platforms folders, aswell as package.lock.json file.
After that I run tns build android.
Once the build is completed I either run tns run android or start the application via nativescript sidekick.
But it always ends like this now:
Project successfully built.
Installing on device 5B24000362...
Successfully installed on device with identifier '5B24000362'.
Unable to apply changes on device: 5B24000362. Error is: Socket connection timed out..
Since I had this error already 2 days ago and could not continue working on the App, I updated all nativescript and angular dependencies following this upgrade instructions.
After that update, the app worked again.
But now after a few hours I get the same error again (same app).
I even pushed the app to a git repository after it worked, and recloned it now, does not work.
If you have nativescript-plugin-firebase installed. Just update it with:
$ tns plugin update nativescript-plugin-firebase
I ran into this same issue. Interestingly, in my case, it was because the emulated device did not have enough storage to install the app. As soon as I deleted some other builds off of it, it worked.
Make sure you are using the latest NativeScript tooling, not only the dependencies. You can install the latest CLI by executing npm i -g nativescript.
If the application is not started at all, you can check this answer to a similar issue in NativeScript CLI GitHub repository.
I finally got this working by removing admob from node_modules\nativescript-plugin-firebase\platforms\android\include.gradle
Line to take out:

Nativescript - error on tns run android

I'm trying to run android emulator with the command tns run android. This starts the emulator but it keeps stuck on Android logo and I get the following error:
(...)
BUILD SUCCESSFUL
Total time: 17.013 secs
Project successfully built.
Using C:\(...)\sample-Groceries\platforms\android\build\outputs\apk\sampleGroceries-debug.apk
Starting Android emulator with image Nexus6
Waiting for emulator device initialization..............
Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb
server with 'adb kill-server' command. Alternatively, run the Android
Virtual Device manager and increase the allocated RAM for the virtual
device.
(...)
Here is my Android Virtual Device configured:
AVD Manager
Note: I can run the application on my phone anyway, but not on my PC.
Finally I found the problem.
In Android Virtual Device Manager, there was an error I didn't see:
AVD Manager error
Here is a solution which I found to be useful.
enter image description here
You just have to manually activate the emulator, which you can do using android studio or command line. Using the command line, you have to run this command
emulator -avd avd_name [ {-option [value]} … ]
for ex:
/Android/sdk/emulator/emulator -avd test
Once the emulator starts you can run this command
tns run android
I started having similar issue after updating to the latest Android Studio and latest emulators. I switched the VM Heap to 64, and it worked for me. May be worth giving that a try.
Open your Android Virtual Device Manager and download the latest
emulator. That will fix the error.
I had the same problem. I fixed that by:
Open emulator manually from Android Studio (double-click on position in AVD Manager list)
Run tns run android
Works for macOS Sierra.

Resources