Coder Social home page Coder Social logo

Comments (65)

MSLaguana avatar MSLaguana commented on May 24, 2024 2

To debug iOS devices, we make use of https://github.com/google/ios-webkit-debug-proxy

Running ios-webkit-debug-proxy on a mac makes a connection to iOS devices and simulators, and listens on a socket on the local machine (the mac running it) for incoming connections to connect through to the device. For example, it might transport traffic on port 9223 through to an iPhone connected to the mac. Any webkit webviews on the device (such as those used by Cordova), when the "web inspector" is enabled in settings, will be listening for a debugger to attach. Safari uses webkit and the debugging protocol is mostly the same as Chrome's, but there are some subtle differences that we've discovered by trial and error. Visual studio understands how to use the webkit/chrome debugging protocol, and some of these iOS specific changes, so it connects through to the device by talking to the appropriate port and speaks the protocol.

Chrome could in theory attach to the port and do exactly the same thing, except it refuses to connect to non-localhost ports (or did the last time I tried it). If you are familiar with port forwarding, you can forward a localhost port to the remote port, so you can tell chrome to attach to the localhost port and have it actually connect through to the remote device. I've not done port forwarding on a windows environment myself, but http://stackoverflow.com/questions/11525703/port-forwarding-in-windows may have a guide if you wish to experiment yourself.

If you want to see more, on the mac you can run ios_webkit_debug_proxy -c 9221:null,9222:9322 (I think) to start ios-webkit-debug-proxy (yes, it switches between dashes and underscores at different times) listening on port 9221 and using ports 9222 to 9322 for any devices which attach. You can then browse to localhost:9221 or localhost:9221/json to see what data is there, and follow links around.

from remotebuild.

AnBucyk avatar AnBucyk commented on May 24, 2024 2

Looks like your build.json is invalid. Could you look for a typo at that position? Or share the portion of it containing that line?

from remotebuild.

iamisti avatar iamisti commented on May 24, 2024 2

everybody is talking about build.json file, but there is no fcking build.json file in ionic ios app :D :D
Can somebody help me with that?

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024 1

Looks like homebrew is case sensitive: please try brew upgrade libimobiledevice --HEAD, that should grab the latest bits and hopefully resolve the issue.

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

If you follow the workaround at http://www.dpogue.ca/articles/cordova-xcode8.html then this should work: Adding the developmentTeam in build.json without making any other changes (such as the hook in the link) won't have any effect until cordova-ios updates with compatibility with xcode 8.

Does remotebuild still fail if you add the hook?

from remotebuild.

jdschuitemaker avatar jdschuitemaker commented on May 24, 2024

That is what I started with. The work around does not work for me. I still get get the same error. This is what I tried:

  • Clear Cordova cache (Visual Studio)
  • Clean project (Visual Studio)
  • Removed iOS platform folder throug a command prompt
  • Added Team settings to build.json (Visual Studio)

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

So just to be clear: You have modified your build.json as above, you have added the hooks/xcode8.js file and you have modified your config.xml to reference the hook, and you still get the error from xcode?

What version of Cordova are you targeting?

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

#jdschuitemaker I have the same problem! I did also followed the workaround at http://www.dpogue.ca/articles/cordova-xcode8.html and I came past the developmentTeam error.

Now it saying that my provisioning profile do not match. It always did. But I recreated my provisioning profile and still the same error.

I have
Cordova 6.3.1
iOS 4.2.1

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

What is the exact error it is giving you? And are you sure that you have installed a provisioning profile which matches the development team you are specifying?

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

In visual studio it says:
No profiles for 'xxx.xxx.xxx' were found: Xcode couldn't find a provisioning profile matching 'xxx.xxx.xxx'.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'

I'm completely sure it matches with the bundleid installed xcode.

I even did couple of test apps with new ids and created new provisioning profiles. It didn't help.

Also, I ran a couple of days a ago before updating the xcode8, so im sure it matched in the first place.

Any advice?

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

If you have access to the mac running remotebuild, you could try going to ~/.taco_home/remote-builds/taco-remote/builds/<build id>/cordovaApp/platforms/ios and open up your app's xcodeproj in xcode. Try to do a build for a device, and see if it finds an error and suggests a way to repair it.

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

And yes the configuration i checked the team id serveral times, it matches when i go to https://developer.apple.com/account/#/membership

{
"android": {
"release": {
"keystore": "",
"storePassword": "",
"alias": "",
"password": "",
"keystoreType": ""
}
},
"ios": {
"debug": {
"developmentTeam": "XXXXXXXXXX"
},
"release": {
"developmentTeam": "XXXXXXXXXX",
"codeSignIdentity": "iPhone Developer"
}
}
}

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

I have. Give me 20 mins ill post back the result.

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

It found the team name. No problems there.

It gave me the following warnings:

screen shot 2016-09-27 at 23 12 00
screen shot 2016-09-27 at 23 12 47

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

iOS Deployment Target is set to 7,0 that cant be right? I have set it to 10.0 in the config.xml.

But the problem in building from visual studio is about not being able to find my provisioning profile.. How can I test this from here? Im not really familiar with xcode

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

You can try to replicate the build process that VS does (using remotebuild) by going to the cordovaApp folder and running cordova build ios --device

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

Okay ill try that.
In the mean time I got my app build from xcode to my device.

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

I just tried to build the same solution from visual studio again to get a fresh cordovaApp folder.
But strangely it downloaded and tried to deploy. - Must have been something with xcode. But still have the investigate with a new app and a new provisioning profile. Ill get back about that.

In the mean time, the remotebuild server did not copy over the app to the device. This is what the log in visual studio looks like now:

Timed out connecting debugger to remote Apache Cordova app. See Output window for JavaScript console output.
------ Cordova tools 6.3.1 already installed.
Requesting launch on remote iOS device for buildNumber 394 on server https://192.168.8.108:3000/cordova...
Failed to launch iOS remote for build C:\Users\XXX\Documents\Visual Studio 2015\Projects\TestIos10Test\TestIos10Test\bld\ios\Debug\buildInfo.json to https://192.168.8.108:3000/cordova :
Http 404: Error mounting developer disk image
------ Cordova tools 6.3.1 already installed.
Requesting debug on remote iOS device for buildNumber 394 on server https://192.168.8.108:3000/cordova...
Failed to Debug iOS remote for build C:\Users\XXX\Documents\Visual Studio 2015\Projects\TestIos10Test\TestIos10Test\bld\ios\Debug\buildInfo.json to https://192.168.8.108:3000/cordova :
Http 500: No devices found to debug. Please ensure that a device is connected and awake and retry.

Any ideas? Or ill have to get back to you after some reading online..

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

I think I have an idea. I suggest that you shut down remotebuild, rm -r ~/.taco_home/node_modules/taco-remote-lib/2.2.1 and then start remotebuild up again. That will cause it to re-download the library that we use to build and deploy to iOS devices, and we had updated part of that (idevice-app-launcher) to properly find the developer disk image for iOS 10.

I believe that the reason your app worked when building from VS is that xcode may have downloaded a different provisioning profile.

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

Okay your command didnt work. But I went in to taco-remote-lib and wrote "rm -r /2.2.1" which removed that folder, which was intented right? or was it the whole path? - Anyway, it re-downloaded like you said, but same error in visual studio,

Here is the terminal:
screen shot 2016-09-28 at 00 25 38

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

I notice the warnings, is that my problem?

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

Also btw just so there is no doubt. It said on the log it deployed with 200, but I didnt put it on the iphone conneted to the mac. Even after I deleted my app, which i got on my phone when I builded from xcode, its not showing up as an app on the iphone - Its a bit confusing log.. :)

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

No, those warnings are fine. And you deleted the correct thing causing it to download an update.

The issue that you're hitting is to do with how we launch iOS apps on a device. To launch an app, we need to mount a disk image on the device which contains debugging tools, and something is going wrong on that process (which causes the /run command to return 404)

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

Ah, I think I may know what the issue is: the libimobiledevice library needs to be upgraded to work with iOS 10. Try brew update && brew upgrade libimobiledevice --HEAD && brew upgrade ideviceinstaller ios-webkit-debug-proxy

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

I wanted it so much to work, but I still get the disk error message and not app is deployed.

I have the terminal log here:
screen shot 2016-09-28 at 00 53 56

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

WOW it works!

  • Visual studio stopped displaying disk error messages.
  • App got deployed on the phone

But the terminal still says run 404 and debug 500. But I thing its because i have to enable something called web inspector. I'll inspect into that :)

Thank you so much for your help, where do I send the red wine?
webinsp

from remotebuild.

mivewi avatar mivewi commented on May 24, 2024

btw the HTTP 404 error that implies that the phone might be locked, is false, I did have it open, just so everyone else with the same problem will know whats happing :)

from remotebuild.

jdschuitemaker avatar jdschuitemaker commented on May 24, 2024

I have to apologize. I solved my issue by moving the hooks folder to the root of my project, not the root of the www-folder. It seems that I can build now, tonight I will check if it also deploys to my iPad.

If so, then I will close.

from remotebuild.

mbraude avatar mbraude commented on May 24, 2024

Hey guys, we are planning on making some changes to remote build to address this shortly. Please keep an eye out for a new release (probably coming in ~2 weeks or so).

from remotebuild.

jdschuitemaker avatar jdschuitemaker commented on May 24, 2024

Sounds good @mbraude !

Btw, I also needed to execute the brew upgrade libimobiledevice --HEAD command to get the built app on the device.

from remotebuild.

djwagner-cbc avatar djwagner-cbc commented on May 24, 2024

This info saved me. Thank you!

from remotebuild.

radrad avatar radrad commented on May 24, 2024

This helped me too. Automatic signing is OK with me, however it creates a local profile named:
iOS Team Provisioning Profile: * which is only available locally on Mac

I also creates an App ID: XC Wildcard "" on Apple dev portal.
I actually want this Automatic signing to use com.mycomp.
App ID via my manual profile I created (that uses this App ID). I can switch to a local or manual (I created on the dev site) profile and I can build successfully on Mac and deploy successfully.

Q1:
So will you have a settings to use our manually created profile in my case is it named: "XCode iOS Wildcard mycomp" that uses com.mycomp.* whildcard App ID. ?
Q2:
Will you have settings to choose provisioning profile manually created in custom signing (when we don't want automatic signing)?
Q3:
Little unrelated, but is there a way to use Chrome Tools for debugging Ios deployed app (the same way as it is used with chrome://devices/ inspection.
I noticed {webDebugPort=9221}. Can this be used by Chrome debugging tools or other tools (except Visual Studio debugger)?
The main reason is I want to use Augury for debugging Ionic 2 apps in iOS.
(I believe even with Android debugging Augury might not be available - maybe due to the special Debugging inspector being opened)

Augury helps Angular 2.0 developers visualize the application through component trees, and visual debugging tools. Developers get immediate insight into their application structure, change detection and performance characteristics.
Thanks,
Rad

from remotebuild.

Sroose avatar Sroose commented on May 24, 2024

Hello,
is there someone who knows to fix the RUN 404 issue? The workaround is simple: start the app manually just after deployment but don't wait too long (if you wait too long the debug step times out).
It would be nice if it would start on its own :)

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

@Sroose Did you try updating libimobiledevice as described above?

@radrad We are still investigating exactly how best to solve the issues that xcode 8 introduced to the cordova signing workflow (the next version of cordova-ios is also looking at how to solve it, I'm not sure how it will answer your questions at the moment either).

For your third question, other tools which use the Chrome debugging protocol should be able to debug the site, with some caveats: chrome itself does not want to debug non-localhost sites, so you may need to do some port-forwarding to expose the remote mac port via a localhost port. There may also be some iOS specific quirks, for example iOS 10 does not enable breakpoints by default, you must explicitly tell the debugging engine to enable them and the chrome debugging frontend does not do this by default. Apart from that, the port 9221 is the port that ios-webkit-debug-proxy is running on, and by connecting to that you can find a list of devices/simulators which are attached and exposed on other ports (e.g. ports 9222-9322) which behave in a similar way to chrome://inspect

from remotebuild.

radrad avatar radrad commented on May 24, 2024

MSLaguana@ Thanks.
Is there any good read on this:
"chrome itself does not want to debug non-localhost sites, so you may need to do some port-forwarding to expose the remote mac port via a localhost port."
If there is also some good read on your remaining comments? I don't understand all of this connectivity. A picture would be worth a million. Who is doing Chrome based debugging on iOS devices or simulators and how?

from remotebuild.

radrad avatar radrad commented on May 24, 2024

Thanks @MSLaguana. This is now more clear
Are you saying that I execute:
ios_webkit_debug_proxy -c 9221:null,9222:9322 on the mac and
on windows:
netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33 protocol=tcp
If Mac IP address is: 192.168.0.10 and PC''s IP address: 192.168.0.20 what should above windows command look like. and is there an additional command to run on the Mac or windows.
Is the next step to start Chrome tools and it will start working or Chrome has to be started with some parameters? Or Safari on windows can do some debugging too?

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

Can someone give a hand? Can't get a remote build to work, can't get ipa signed, dead in the water...

I updated to Xcode Version 8.2.1 (8C1002)
and updated OS to macOS Sierra Version 10.12.3 (16D32)

With this, lost my ability from Visual Studio 2017 to build Release/iOS/Remote Device

Visual Studion 2017 Professional running on Windows 10 box using build.json:

"ios": {
"debug": {
"developmentTeam": "QFKTXA6TV3"
},
"release": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "QFKTXA6TV3",
"packageType": "ad-hoc"
}
}

Have multiple times deleted certificates and provisioning profiles at developer.apple.com, deleted same from Keychain Access on mac, deleted provisioning profiles at ~/Library/MobileDevice, remove AppleId from xcode and rebuilt all.

I've tried all manner of permutations on the build.json file including adding "provisioniongProfile": xxx

With above build.json I get:

Check dependencies
No profiles for 'com.teamsportsinfo.api' were found:  Xcode couldn't find a provisioning profile matching 'com.teamsportsinfo.api'.
Code signing is required for product type 'Application' in SDK 'iOS 10.2'

My apple certs and provisioning profiles are:

image

and

image

Any assistance is greatly appreciated, spring tournaments and leagues are about to start and I can't upload my mobile app...

Todd

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

As a quick workaround, if you go to ~/.taco_home/remote-builds/taco-remote/builds/<build ID>/cordovaApp on the mac, you will find the copy of your project that we attempted to build. You should be able to build your app if you open platforms/ios/<project>.xcodeproj and build from xcode.

If that works for you, then when you get a chance I'd appreciate if you could try rebuilding using remotebuild (or the Cordova command line in that same project on the mac) to see if xcode fixed some state / acquired some other profile,

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

MSLaguana,

I'm grateful for your assistance...

To preface, I'm not that familiar with the mac yet, so will need some guidance.

Based on my readings, I did go to the location using terminal, and did a "cordova build" which works fine and produces an ipa (which of course is not accepted by the app store because its not signed).

Can you coach me on how to get xcode to run a build?

T

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

You want to go to the platforms/ios/ folder and open up the *.xcodeproj file in xcode. Once you have your project open in xcode, You might want to read through https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html and see whether all the settings are configured correctly (most should be) and see if xcode can help you configure the ones which are not.

Something else which may help: If you open up your config.xml in your project and change your <engine name="ios" spec="..." /> to <engine name="ios" spec="4.3.1" /> then that may be helpful as well. That will upgrade the version of cordova-ios that your project uses, and the newer versions are more compatible with the latest version of xcode.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

Hmm, I thought we added the engine tags. Was this project brought over from VS2015 to VS2017?

At any rate, you should be able to just add the <engine ... /> tag anywhere directly under the top-level <widget> tag.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

It seems that xcode is claiming you don't have an appropriate provisioning profile: UserInfo={NSLocalizedRecoverySuggestion=No valid 'ad-hoc' profiles were found

Note that I believe ad-hoc does not mean "ready to be submit to the app store", I believe it is more for internal use / limited distribution. You may want to specify app-store instead? Alternately if you do indeed mean to do an ad-hoc distribution, then trying to build using xcode may be helpful since it can help you create provisioning profiles or find out what piece is missing.

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

One other thing: The newer cordova-ios may no longer require that you specify iPhone Development in release mode; see https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#using-buildjson for an up-to-date example.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

Looks like your images aren't getting included, so I'm not sure how that looks.

Since you created a "App Store" certificate, not an ad-hoc certificate (which of these you want depends on what you want to do with the app, but if you want to put it on the app store then you need the app store certificate) you probably need to specify app-store in the packageType of the build.json

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

MSLaguana avatar MSLaguana commented on May 24, 2024

I believe that the error is because you are using backslashes and not forward slashes in the path. If you open up your config.xml, you should see an entry in there referring to the icon-40.png: try replacing the backslashes in the path with forward slashes.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

drewgillies avatar drewgillies commented on May 24, 2024

@toddtsic, could you try a debug build rather than release? I believe running a release build on a device is disabled by (Apple's) design. If that isn't the answer, let's dig further.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

drewgillies avatar drewgillies commented on May 24, 2024

@toddtsic, apologies for the delay--we're working through quite a backlog. I'm going to track this conversation internally so we don't lose it, but it may take some more time for us to investigate this thoroughly. Watch this space. Also, if you have any more developments/discoveries, please add a note here.

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

toddtsic avatar toddtsic commented on May 24, 2024

from remotebuild.

ekambarrao avatar ekambarrao commented on May 24, 2024

Hi, I am using Visual Studio 2017 Apache Cordova 6.3.1 and trying to build for iOS. I have been facing this issue.

Failed to build app for buildNumber 5472: /Users/user127867/.taco_home/remote-builds/taco-remote/builds/5472/cordovaApp/build.json: Unexpected token / in JSON at position 157

I could not figure out the reason.

Can some body throw some light here!!

from remotebuild.

ekambarrao avatar ekambarrao commented on May 24, 2024

Hi, I am using Visual Studio 2017 Apache Cordova 6.3.1 and trying to build for iOS. I have been facing this issue.

I am getting this error

** BUILD SUCCEEDED ** xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH Error: Error code 72

How to fix this!!!!

Everywhere written as 8.3 is problem and xcodebuild should be there. But where, when using Visual studio, which is complete automated one remotebuild, where to do this?

thx

from remotebuild.

immortalt avatar immortalt commented on May 24, 2024

everybody is talking about build.json file, but there is no fcking build.json file in ionic ios app :D :D
Can somebody help me with that?

from remotebuild.

iamisti avatar iamisti commented on May 24, 2024

everybody is talking about build.json file, but there is no fcking build.json file in ionic ios app :D :D
Can somebody help me with that?

from remotebuild.

 avatar commented on May 24, 2024

@iamisti - hopefully you've figured out by now that you had a build.json file into the root of your app and then set the contents as explained here: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#using-buildjson

If you go into XCode and create a new project set your Signing > Team, you'll find your team code in parenthesis where the Signing Certificate is displayed below your Team selection.

The easiest way to get past all of these errors is to open the XCode project under your "platforms" folder in your Ionic project and set the signing properties there. Then you can use the TACO cli to run "taco build ios" - if you're using Visual Studio instead of VSCode, then god help you: it's a mess.

from remotebuild.

MemeDeveloper avatar MemeDeveloper commented on May 24, 2024

@unboxedsolutions - you are 100% right, running from VS is a pain / plagued with issues. (N.B. seems this is mainly Apple's fault for forcing us to use a mac in the first place, and MS do their best to fix up the situation so we don't all have to buy overpriced Mac's - apple's obvious goal here). I followed your solution and ran the Xcode project from the platforms folder. BANG all working. Thanks.

from remotebuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.