This is my first time using react native IOS. I was trying to run my application in ios simulator. But the problem is I need to set debug server host & port for device in dev settings. cmd + d tried but no response debug menu is not opening struck here if anyone has a fix please post here. Its a blocker could not move forward. I am not using useFrameworks. Thanks in advance.
When you are on simulator tab go to I/O menu -> keyboard and check "use hardware keyboard".
This should do the job.
simulator I/O tab
Felix's answer solved my problem, but there are a couple of other things to try.
You can press "d" in the Metro terminal console and it will send a signal to open the menu remotely. (However this doesn't always work either). You'll see:
info Opening developer menu...
I have found CMD-r (reload) starts recording the screenshot in the simulator as that key is already bound, so I experimented and found just pressing "r" works for reload. Then I found just pressing "d" in the focused simulator opens the debug menu.
Related
since a couple of months I'm facing a very strange situation, when developing on the latest versions of react native (0.50+ to 0.60+) the iOS simulator stops responding to keyboard commands, that is:
Simulator starts, I can hit Cmd+R or Cmd+D just fine for a few cycles
After some hot reload cycles, the commands completely stop working
If go to Hardware->Keyboard->Send Keyboard Shortcuts and enabled it, the commands start working again
However then the Cmd+Shift+H doesn't work anymore so I cannot easily close the app if I have to
This is really driving me crazy, has anybody faced the same situation or knows any workaround? Many thanks!
P.S. I already tried a few months ago to reset everything (including simulator settings and xcode installation)
I'm having the same issue. Seems to be an iOS 13.3+ simulator issue as you can see in this thread:
iOS Simulator CMD+R CMD+D Shake doesn't work at all after some time
As an alternative, command + ctrl + z still works to access the development menu.
For me pressing "D" then "⌘+D" solves the issue.
The same goes for "R" then "⌘+R".
Not sure if you could actually just press any single key before pressing your desired shortcut.
Kudos to this GitHub answer for helping me out as this was an extremely frustrating issue.
UPDATE:
Since Xcode 12.5 the shortcut for recording the simulator screen is now also CMD+R. This swallows the first CMD+R because instead it starts recording the simulator screen. The next CMD+R will reload the screen. Fortunately, this can be fixed.
I have noticed that pressing R R reloads the app on the latest react-native versions, same as on the android emulator, so maybe this is an intentional change.
For those coming in nowadays
In any case, so far the workarounds seem to be:
cmd + shift + z to trigger the dev menu and then click on reload
r r sometimes also does the trick
d if the simulator is focused
Did you check that you are in Debug Mode and not in Release?
Product > Scheme > Edit Scheme... >
Build Configuration: Debug + check the box Debug executable.
After changing Scheme, better to deinstall your app.
Also I noticed the Cmd D doesn't work during Splashscreen.
Here is the simple example , Application have a button ,on clicking it should print Check. It is printing when I am running from Xcode (*very simple).But after clicking on stop button on Xcode and then launching the app again from icon this time , the button is not printing anything.
Code:
- (IBAction)save:(id)sender
{
NSLog(#"check");
}
What is the reason behind this?
When you stop Xcode running an application it stops receiving messages from the app. And when you running it again from Simulator Xcode knows nothing about new process.
Adding to #njuri, you can connect to the process from Xcode that was started outside of Xcode.
Click the Debug menu and choose Attach to Process then "By Process Identifier (PID) or Name" and enter your app's name. You can hit breakpoints and inspect the process. It does not recapture the stdout though. To see your logs, go to the Devices tool (Shift-Command-2)
When you run from xcode, the output is redirected to the debug console. This does not happen by default when you run from the icon.
However, you can ask to see the output by selecting Debug -> Open System Log... from the top bar menu.
So open the system log and then run your app from the icon and you will see the output.
When I'm trying to run iOS application in Xcode 6 in iPhone 6 simulator, I'm getting error Unable to run app in Simulator.
And error code is:
An error was encountered while running (Domain =
FBSOpenApplicationErrorDomain, Code = 4)
Can any one suggest how to resolve it?
This worked for me:
iOS Simulator -> Reset Contents and Settings... -> Reset
referenced from Qiita: Unable to run app in Simulator エラーの対応方法.
Just closing the iOS Simulator worked for me.
There is not always the need to reset the iOS Simulator. I did not even had to close Xcode.
This happened to me once when I added some assets as symbolic links (through ln -sf). Even installing to devices was failing.
After I removed the links and made a hard copy, it worked and error was gone.
No need to quit the simulator or reset all content every time .
Just close the app on which you are working if running on background .
it works for me .
As mentioned in the Xcode release notes, this error (along with a couple others) results from a timing bug. The workaround is to just retry.
See https://developer.apple.com/library/prerelease/mac/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html#//apple_ref/doc/uid/TP40001051-CH4-SW1
Testing on iOS simulator may produce an error indicating that the application could not be installed or launched.
Re-run testing or start another integration.
Also see:
https://devforums.apple.com/thread/248879?tstart=0
I just quit the simulator , cleaned up the project and ran again it worked.
Just quit the xcode6.0 beta or else and run project again, it worked for me.
Reseting the Xcode will delete some bad junk which simulator has cached, so reseting is good option to resolve this issue.
iOS Simulator -> Reset Contents and Settings.
Be careful if you skip installs.
I accidentally changed Skip Install on the main target, when i meant to change it on a dependency .
When changing it back I had to do a clean.
This problem probably started after we enabled background mode in our app.My solution :
1) Go to simulator
2) Hold cmd + shift
3) Tap 'H' key two times
4) Slide the application off to stop it running in the background.
5) Run again.
(Very tiring to have to repeat the above step each time I build and run)
Open your app scheme setting and edit it as shown in attached screenshot,
Actually you have to disable the "Launch Due to background fetch". Worked for me.
Steps,
1. Select your target and select "edit scheme"
2. Select "Options" tab on right side of detail window
3. Uncheck "Launch Due to background fetch" checkbox.
Disconnect hardware keyboard.
In ios simulator main menu
Hardware -> Keyboard -> Disconnect Hardware keyboard.
I'm having trouble with the iOS simulator. I'm currently on 10.7 and was using the simulator to test my website. During the testing, I switched the iOS version via the tool bar, and the application froze and quit. Upon restarting, I get the following error message, with a finder window, inviting me to choose an application:
"ios Simulator Could Not Find The Application To Simulate"
Here's what I've tried to fix the issue:
1: Attempt to identify the application it needs, but the only thing i could see to open was a printer app and the ios simulator app, which just results in a "only one iOS simulator can run at a time" error message.
2: Restart the Mac.
3: Download the new Xcode tools from the app store.
4: Restart again.
None of this has helped, and I'm really stuck without it at the moment. If anyone knows how to resolve the problem, I would be grateful to hear any suggestions. Thanks.
Give this a shot.
Open up a new shell, and shoot of this command: sudo <Xcode>/Library/uninstall-devtools --mode=all (assuming thats the location of the instal).
Then run the Xcode installer you got from the app store.
This removes all the plist files that were also installed with xcode, which aren't removed when you simply reinstall. This is as close as you can come to a complete xcode refresh without reinstalling your OS.
Here's an alternative solution that worked for me... the answer selected here did not. I created a blank, "hello world" project and simply ran it. When you run the app, it sends the app to the simulator and voila! iOS Simulator has an app to simulate. From that point forward, you should be able to open the iOS Simulator without a problem.
After a while longer trying various things, it seems like I may have fixed it.
When asking for an application to open, I opened Xcode, and (weirdly) that opened up and left the testing shell visible, with the tool bar intact. I then selected the current version from the device options and hit the home button, and suddenly everything appeared.
Weird thing to have suddenly happened, but there you go.
I still can't test in iOS 3, so that's a bit of a problem, but not a disaster either!
The Blackberry 9800 simulator is crashing when launching the browser, throwing
JVM Error 104: Uncaught
IllegalStateException.
This is a clean install of the simulator with no 3rd party applications installed to it. I strictly wanted to use it for testing web applications. All other applications on the device seem to work without error.
I managed to get it working.
Exit the Simulator (if running)
Go to c:\program files\Research In
Motion
Right click BlackBerry Smartphone
Simulators 6.0.0
Click Properties
Select the Security Tab
Click The Edit button
Click the Add... button
Add your user account to with "Full
control" checked
Click the OK button
Launch the simulator and all should be well.
This solution didn't work for me, but reinstalling as described here did.
http://supportforums.blackberry.com/t5/Web-Development/9800-Simulator-Browser-crashes-JVM-Error-104/m-p/594666
right click, and launch like administrator (W7)