Skip to content

tns ios debug #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PanayotCankov opened this issue Mar 20, 2015 · 6 comments
Closed

tns ios debug #358

PanayotCankov opened this issue Mar 20, 2015 · 6 comments
Assignees
Labels
Milestone

Comments

@PanayotCankov
Copy link
Contributor

Integrate the ios debugging with the CLI.

All the commands must be executed within the tns project folder, or with path to a project. They require the bundle id to setup the communication.

Debug --debug-brk on Device

tns debug ios --debug-brk
Prepare, build, deploy, run the app. Start the inspector in Safari. Attach the inspector before any JavaScript is executed on iOS device. If you have a debugger; as first statement in the bootstrap.js the inspector should brake on it before any JS being executed. The terminal will block forwarding traffic over the USB cable.

Debug --start on Device

tns debug ios --start
Start the inspector in Safari. Attach to an already running app. The terminal will block forwarding traffic over the USB cable.

Debug --debug-brk on Emulator

tns debug ios --debug-brk --emulator
Prepare, build, debploy, run the app on an already running emulator or try to start one. Start the inspector in Safari. Attach the inspector before any JavaScript is executed on iOS device. If you have a debugger; as first statement in the bootstrap.js the inspector should brake on it before any JS being executed.

Debug --start on Emulator

tns debug ios --start --emulator
Start the inspector in Safari. Attach to an already running app in emulator.

@PanayotCankov
Copy link
Contributor Author

For testing purposes you may provide --no-client to suppress the Safari. Then the app will open 8080 for emulator or the CLI will forward the traffic from the device to the localhost on 8080.

Then you can connect to localhost 8080 using WebSocket client and simulate Inspector if you manage to reverse engineer the debugging protocol.

@jsgandalf
Copy link

This is some really great documentation! I don't mean to be a noob, but I'm running into an issue:

I'm trying to emulate the app:

tns ios debug --start --emulator

Unknown command 'ios'. Use 'NativeScript help' for help.

Any ideas? :/

tns version: 0.9.4

@teobugslayer
Copy link
Contributor

Hi @jsgandalf ,
I think you have made a typo. The correct command should be *tns debug ios *
Also, for 0.9.4 we could not make it work in the emulator. The relevant code is already merged in the master branch and will be released in our next public build.

@teobugslayer teobugslayer modified the milestones: 1.0, 0.10 Apr 24, 2015
@jasssonpet
Copy link
Contributor

As of 1.0.1:
debug ios --start --emulator - not working on Xcode 6.2+ (Apple removed simctl notify_post)
debug ios --debug-brk - not working every time on device (The app is started several times, as the deploy command runs the app)

@PanayotCankov
Copy link
Contributor Author

@jsgandalf Fixed the 'ios debug' to 'debug ios' in the docs.

@jsgandalf
Copy link

Awesome!! Thanks!

On Wed, May 13, 2015 at 1:25 AM, Panayot Cankov [email protected]
wrote:

@jsgandalf https://github.com/jsgandalf Fixed the 'ios debug' to 'debug
ios' in the docs.


Reply to this email directly or view it on GitHub
#358 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants