How can i enable remote debugging iOS webapp? - ios

I'm trying to use safari inspector for debugging web app on iOS device.
and I have referenced this way: enable remote web-inspector
It works when I try with iphone application developed by me (build & run by xcode to device).
but If I try to debug webapp installed using ipa,
I can't find app in safari > Develop > iPhone menu. (this menu shows just 'No Inspectable Applications')
for example, in Android Webview,
there is an api SetWebContentsDebuggingEnabled
If developer write webview.SetWebContentsDebuggingEnabled(true) everyone installed this app using apk can debug webview in Chrome.
is there any option like SetWebContentsDebuggingEnabled in iOS?
help-!

Resolved!
you should check all below conditions.
Build for testing.
When you export your archive, choose "Save for Development Deployment." (available in XCode 7.0!)
you can 'remote debug' using only devices that you've registered to your apple developer account. So if you want to publish ipa to testers, you should get their test device's udid first.
can check application logs also in this way.

lee!
Xcode 7.0 provides some build options.
Check the Build Settings.
You can select release or debug mode, maybe debug mode is able to connect to safari inspector.
For your web developer!
thanks.

Related

iOS 14 not letting Flutter apps (still in dev) to launch from the home screen compared to Building/Running from the IDE

I've been developing a news app with Flutter and when I build and run it through Android Studio it launches fine, but when I try to launch the app by clicking on it on the home screen, it says "in iOS 14+, debug mode flutter apps can only be launched from Flutter tooling,IDEs ....."(Screenshot attatched). Can someone tell me as to how to get around this?
Apparently, this is a known issue of Flutter on iOS 14 for apps in debug mode, see this article on the Flutter website, and this GitHub issue. So for the time being, I believe your main workarounds are the following:
Always run the app from the host PC (using flutter run, IDE debug, etc.)
Build a release version of your app (instead of debug) and use that on your device, e.g. use flutter run --release
Use a device with iOS 13 or older
Use a simulator
If you want to use the app without being connected via usb
Open the ios folder on Xcode
Make sure your device is connected
Select Product from the menu bar -> Scheme -> Edit Scheme
Or simply use the shortcut: command + >
Step 3
Change the build configure to Release
Run the app from Xcode
Disconnect your device and you're good to go!

Installing PDF reader in iOS simulator

Currently I am using Xcode 8.3.3 and Xcode 9 Beta 4.
How do I install a PDF reader and email apps in the iOS simulator.
I have gone through this link:
Is it possible to install Adobe reader or third party application in iOS simulator for testing?
and
*How to install iPhone application in iPhone Simulator.
But it was of no use.
I even tried the drag and drop method. It shows the process, but then it displays the error "unable to install the app".
How do I add applications in simulators? Currently I don't have any devices, so I want to test the functionality on the simulator.
After trying a few options and going through some folders, I am confirmed that it can be done. Can it be done by placing the payload files of PDF viewers in iPhone simulator's application folder?
If it's an app built for the simulator, then yes it can be done using the methods you linked to.
If this is an app built for the AppStore, then it's not possible. Apps built for AppStore are compiled for ARM CPUs; for simulators, they're compiled for x86.
Firstly, read these steps. However for me, the second step was not working. So I went for alternative method.
You need an iPhone for the above. If you don't have one, search the web for .ipa file of that apps and follow above procedure. Or you can use open source projects like: https://github.com/Alua-Kinzhebayeva/iOS-PDF-Reader.
Run this project for the first time. Go to project navigator:
Right click on the PDFReader.app and click "Show in Finder".
Copy and paste it in this folder Applications > Xcode.app (right click - Show Package Contents) > Contents > Developer > Platforms > iPhoneSimulator.platform > SDKs > iPhoneSimulator7.0.sdk > Applications.
and reboot the simulator. The app will be preinstalled like other apps in simulator. Ready enough to test your app functionality with pdf readers or any app you want.

How to build reactnative v0.45 project to ios realse

I'm using the latest reactnative verion 0.45 and I didn't get a clue on the official doc about how to build the ios release.
About how to the running on ios device section of the doc quoted here:
Connect your iOS device to your Mac using a USB to Lightning cable.
Navigate to the ios folder in your project, then open the .xcodeproj
file within it using Xcode.
But there is no ios folder found after running command npm ios. And most StackOverflow answers like this one require a command like react-native-bundle which was not found either.
I have already got Xcode and an app develop member account and Really want to build my first reactnative app to my iphone before I could do more stuff on it.
I know this might be a very newbie question. If someone could just give some guide or throw some docs about this?
I stuck on this problem since a few days too, unless you will not get an ios or android folder any more with React Native 0.45.
You can build your standalone app by using Expo: https://docs.expo.io/versions/v17.0.0/guides/building-standalone-apps.html
As I understand, they build your app for you online, so it takes some time and require an free expo-account, but after it finised, you can download your .apk or .ipa to submit it to Play Store or AppStore.
When you want to add more custom (non javascript) code to your project and edit it in Andoid Studio or Xcode, so you have to eject your from Reative Native: https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md
After that, you can test your App by building for your own in the simulator, with no need of the Expo-App.
Open the ios folder of your project using xcode
Connect your phone and select your phone from the device selection dropdown
Select the first tab in the explorer and go to signing area, select your development team
Click play and it will install the app in your phone on development mode
For Production build, you can do the same. However, you would need to change your scheme to production:
Open scheme menu under product. From the dropdown, look all the way down, you'll find the menu Edit Scheme, select this.
Select the Release scheme, hit close and re-run your project in your phone.
Note: if you are building for release, make sure your target device is Generic iOS Device
Hope it helps! :)

how to run app from xcode on device?

I had created my first iOS app with Xcode, but when I tried to export the file to run on an iPad I couldn't build the project. When I go to products > file.app > and then right click to show on folder it is hidden.
How can I export the file to run on iOS devices?
Also if I have the project at my Windows PC can I export the app file to work on iOS devices ?
In order to run iOS apps on a device, you need to first have a valid Apple Developer Account, and have your device setup as a valid developer enabled device.
Once that is done, you simply set your ipad as the target in Build Target. You may need to use the Organizer to first ensure you have the dev certs setup properly.
Also if I have the project at my Windows PC can I export the app file to work on iOS devices ?
In order to build iOS apps, you need Mac OS X (and legally that can only run on an Apple computer)

Why Safari shows "No Inspectable Applications" during remote debugging with iOS 6 device?

When I connect my iOS 6 device for remote debugging for testing my mobile web application, The safari develop menu with my device name shows "No Inspectable Applications".
I have enabled web inspector ON in my device safari device settings.
Why this is happening?
An update for iOS 9 (using OSX El Capitan):
On your mobile device under Settings -> Safari -> Fraudulent Website
Warning = OFF [default = ON]
I also needed to re-connect the iPhone after changing this setting
This solved it for me.
If you have private browsing enabled in Settings > Safari, you will not be able to use remote debugging. If you turned off private browsing, it will work like a charm.
I recently had problems debugging a UIWebView in desktop Safari – and it turns out the problem was with my Xcode configuration for the app. The most recent build had been provisioned for production, rather than for Testing. After re-building the app for Testing, it showed up once more in the Safari Debug menu :-)
I had the same issue eventually I understand that the problem is with the Xcode settings.
To solve this issue:
Enable Safari Debug
First of all verify that on the device you have enabled the Safari debugger (on the device go to: Settings >> Safari >> Advanced >> Enable Debug; or iOS 9+ turn on: Settings >> Safari >> Advanced >> Web Inspector). If you've done this you will see your device in Safari >> Develop. if you see your device but you don't see your application under it, instead "no inspectable application", check your Xcode settings.
Xcode
1. Change Build Configuration:
Right click on the project name (under the play/run button) and select 'Edit Schema...', in the 'Edit Schema' window under 'Run' tab change the 'Build Configuration' to 'Debug' (instead of 'Release')
2. Change the Code Signing:
Click on the project name in the files tree, to display the project settings.
Select the 'Build Settings' tab. Change the 'Provision Profile' to 'Automatic'. Change the 'Code Sign Identity' to 'iOS Developer'.
Note that changing the code signing will prevent you from release versions for production, however you will be able to debug your application.
A few things to try:
On your iPhone/iPad, double-tap the Home button to bring up the list of running apps, close Safari (or appropriate Web App), then reopen
Quit/reopen Safari on the Mac
Unplug/plug back in iOS device
As a side note, I can attach to Safari with private browsing enabled on the iOS device.
I went to Settings > Safari > Advanced and toggled the Web Inspector switch from on to off to on again. That did it for me!
If you just installed XCode 9, do not forget to install Safari 11, or you will see "no inspecable applications"
I had the same problem with Safari 11.0.3 on High Sierra. The only think that worked for me is installing Safari Technology Preview from here.
Make sure you aren't connected to a VPN.
In my case, I had Safari 10.0.2, running on El Capitan and when trying to run apps on the Simulator (iphone 7), I did not even have the Simulator option in the Safari's Develop menu. Updating to Sierra, solved the problem.
I resolved the issue with rebuilding the app with new key - certificate (p12) and provisioning profile. My developer account and certificates expired, so it just stopped recognizing my PhoneGap app in Developer menu.
After all the answers here failed to resolve the issue for me, I figured out that installing the Safari Technology Preview version worked well.
Install this beta of Safari, launch it, enable developer tools in advanced preferences, and your phone will appear in the develop bar (provided a page in mobile Safari is open).
I was trying to get this working via the iOS simulator and none of the previously stated answers worked, even though I tried them all.
Instead, running the following worked:
npm install -g ios-sim
After that, once I started the application, the simulator appeared under the Develop menu on Safari.

Resources