React Native 0.47: Reload on iOS device - ios

react-native-cli: 2.0.1
react-native: 0.47.1
react: 16.0.0-alpha.12
I finally managed to hook up an iOS device (iPhone 4S) to xcode and build my react native code to the device.
Shaking the phone gives me the following options:
as you can see there is no Live Reload option and the Reload doesn't work. I am forced to build it from xcode every single time I make a change.
Can anybody help me getting the Reload to work and enable Live Reload?
I have struggled with this for many days now - because it seems to change all the time and the only answers I have been able to find are obsolete.
Could the issue be that my iPhone runs iOS 9.3.5? _____

Had the same issue here, and fixed it like that:
Make sure wifi is disabled on the iDevice
Open System Preferences by selecting System Preferences from the Apple menu, or by clicking the System Preferences icon in the Dock.
When the System Preferences window opens, click the Sharing preference pane.
The left side of the Sharing preference pane lists the services that you can share. Place a check mark in the Internet Sharing box.
Then Check "USB YourDevice/iPhone/iPod/iPad"
You are Done! (working here on v0.47.1)
Check that you can access internet/network on your device, then run your app form XCode in Debug mode. Now, you should have the green bar on top loading from the packager and you can debug remotely.

Related

Installing apps on my own device through Xcode

I’m quite new to Xcode and I’m only interested in making apps as a hobby. I would like to install my own apps that I make on my own devices without using the App Store (without paying the £99/year developer fee). So I would like to know the following:
How can I install an app through Xcode so that the app remains on my iPhone after disconnecting it from my Mac?
How long will the app remain on my iPhone i.e. how long until I have to manually reinstall it? (I’ve seen some websites that say 7 days and some that say 1 year)
This is something else really but am I right in thinking to use the TestFlight app I’d need to pay the £99/year developer fee?
If it helps all my devices are running the latest software versions.
Yes, you can use your own device for testing purposes and it will remain on your phone after you disconnect it.
To set this up, connect your device to your Mac. Then, click the simulator selection dropdown in the top left of Xcode. It might say Generic iOS Device if you haven't selected a simulator since opening Xcode. At the bottom of that dropdown menu, you should see a button that says Add additional simulators...
At the top of the window that comes up after you click Add additional simulators.. there should be a Devices tab. Select that tab and add your device via the + icon in the bottom left of the window. Once connected and paired, you can travel back to the simulator dropdown menu and scroll up. Your device should be listed there if it's plugged in and paired. Select the device and run your app - Xcode will take care of installation.
Without purchasing the Apple Developer Program, your app will function on your phone for one week after the most recent run.
Yes, you are correct. TestFlight is something that comes with the Apple Developer Program.

Disable Debugging in Expo For React Native App

So I've opened up my react-native app in Expo today (using the iOS simulator) and I am creating by what looks like a debugging overlay.
Screenshot here:
I don't need this and it's blocking some of the UI for testing.
How does one turn it off?
You have the Element Inspector open. To toggle it off do either:
⌘+D if you are in the simulator
Shake your phone if you are on an actual device
This should open up the debugging menu. You can then click on Toggle Element Inspector to close it.

How to force a call to getPlaceholderTemplate on Apple Watch simulator to update complications preview

I made the mistake of installing the app on the simulator without having set up all my complication templates. As the docs state, getPlaceholderTemplate gets called one time and then cached.
So now that I have all my Watch complication templates set up, I want to text them out by customizing the Modular face. But only the one template I had originally created will show up, the rest have the white box. This is just the static template I'm concerned about.
I've tried deleting the app from the simulator, removing it via the Watch app, re-installing, but still doesn't seem to call the function again to update the templates. Any thoughts? Thanks.
What I do to resolve this is click Simulator > Reset Content and Settings... in the Menu Bar for both iPhone and Apple Watch simulators.
Uninstall the app and then re-install using the Watch app on iPhone Simulator

ios 8 how to debug Custom Keyboard?

I have successfully created a Custom Keyboard with Swift on iOS 8 simulator.
Although it worked well, but I could not debug it. It is a contained target and was installed through Settings->General. Placing a bookmark in XCode not work.
I am able to debug a custom keyboard using the simulator via Xcode 6.
Select the keyboard (and not it's container) as the scheme.
"Run" and then select on of the apps on your simulator to debug the extension with.
It seems as of now apple didn't get support for debugging extension into simulator. I was having same issue but I observe that We can debug code if we execute application into device as below.
1) Choose your Keyboard extension target.
2) Go to Edit Scheme.
3) In info tab select your Executable from drop down and check the option "Debug extensions and XPC services".
Still several problems are there like we can't see output of NSLog but you can check the value of variables same as before or I suggest you to check this link It may work for displaying NSLog output KeyboardViewController NSLog IOS 8.
Apple has reported this problem as a know issue in Xcode 6.1 release notes:
Localization and Keyboard settings, including 3rd party keyboards, are not correctly honored by Safari, Maps, and developer apps in the iOS 8.1 Simulator. [NSLocale currentLocale] returns en_US and only the English and Emoji keyboards are available. (18418630, 18512161)
I'm using Xcode 6.1.1 and seems that it still hasn't been solved but I've discovered a workaround. You should follow this steps:
Open Xcode and in its menu bar click into Xcode > Open Developer Tool > iOS Simulator
Now into iOS Simulator menu bar go to Hardware > keyboard and check if "Connect Hardware Keyboard" is enable. If it is, click it to disable and quit iOS Simulator
Then go back to Xcode and make sure that keyboard is selected as scheme
Click into run button or press Product > Run to build and run you application and in the "Choose an app to run" menu choose Today
When iOS Simulator starts, go to Settings > General > Keyboard > Keyboards > Add New Keyboard and select your own and then press in your keyboard command + shift + H to back to the homescreen
Finally open Calendar app and press the magnifying glass icon, the keyboard will appear and you only need to hold the globe button to show the list of enabled keyboards and select yours
Note that it's important to try your keyboard in the Calendar app because in most applications it doesn't work or it has an unexpected behavior
If the keyboard still doesn't appear:
remove the file com.apple.iphonesimulator.plist from ~/Libray/Preferences/
In iOS Simulator menu bar click into iOS Simulator > Reset Content and Settings...
More info about keyboard debugging and development here
After searching and investigating this, I've found the best solution to be to install and use Reveal. It helps you visualise the custom keyboard like the debug hierarchy view and shows various other measures.

Why Can't I delete or Remove iPhone / iPad Duplicate Enterprise App Icon Copy?

I created an enterprise app in Xcode 4.6.3 and posted it on a website. The app succesfully downloads to iPhone5 and iPad3 (both running iOS 7). The app runs just fine. However, it created a duplicate "ghosted" app icon on both devices that cannot be removed See Screen Capture.
I tried removing it by long-pressing the app icon and touching the "X" on the device. I also tried removing it in iTunes. No luck. I updated to Xcode 5.0.1, developed for iOS 7, recompiled and repeated the process. No luck. The duplicate icon remains!
This is not an issue on devices not running iOS 7.
A similar thing happened to me while trying to delete an app that was being built at the same time with XCode.
Try restarting the phone by pressing and holding the button on the top and the circle button on the bottom.
When the OS repopulates the dashboard on the next launch, it should detect the discrepancy and either not display the bad icon or make it available for removal.
If your Apps don't includ iOS, you are surely able to delete Apps from iPhone, do all of your 3rd party apps no longer show the delete "x" when wiggling? If so, try the following steps as needed:
Restart phone
Reset phone (no data loss): press both home and power buttons for at least 10 seconds, releasing when the Apple logo appears
Settings > General > Reset > Reset All Settings
Restore iOS using iTunes, also restoring a backup
Restore iOS as new, without using a backup

Resources