Corona SDK and lldb - ios

Whether it possible to debug corona SDK application on iOS simulator?
I build a Corona SDK application for Xcode simulator and wrote next commands:
cd /Users/username/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/app-name.app/
lldb
(lldb) attach --name "app-name" --waitfor
Then I run app in simulator and I get the next message from lldb:
error: attach failed: process did not stop (no such process or permission problem?)

Are you logged in to the Mac remotely (ssh or whatever)? You need to authorize debugging the first time you use the debugger. It's easy to verify if your machine is set up to allow debugging:
% /usr/sbin/DevToolsSecurity -status
Developer mode is currently enabled.
If it's not enabled, I think sudo /usr/sbin/DevToolsSecurity -enable may do the trick. If you're debugging locally, you should see a pop-up window asking you if you want to allow the debugging to happen. But when logged in remotely, you won't see that pop-up of course.

Related

Xcode 11.3 could not attach to the pid: <Number> without internet

Error Prompt
Xcode 11.3 not able to run the simulator when the lab being "offline" I need to connect to the internet to make the Xcode run the simulator. I found this is hard, please note I try to the following possible solutions but no one solve the problem.
Remove driven data
Erase all content and setting from the simulator
Enable AuthDevTools
There are several answers about this issue.
1st way
You should run this command in your terminal ->
sudo DevToolsSecurity -enable
2nd way
Uncheck this box ->
Edit Scheme > Run > Debug executable
Resource for this answer
Developer Apple Thread
Bonus
What is the DevToolsSecurity -enable command?
This is the command we can use for enable Developer Mode
When you run Xcode for the first time on a fresh system, it asks if you’d like to enable Developer Mode. Developer Mode allows Xcode to execute common debugging tasks without constantly asking for your password.
Brian Gilham's Medium Article

Flutter - Dartlang: Run Application command fails

When using Atom with the dartlang package, I attempt to use the Dartlang: Run Application command and get the following result:
[/Users/craig/Code/flutter-test/atom1] pub run flutter start
Unable to run on Android.
Unable to run on Android.
Unable to run application - no connected devices.
I get the same thing in the console when running flutter start in the app directory.
My phone is a Nexus 6p that is connected to my computer via USB and has 'USB debugging' enabled in Developer options. How can I get these commands to successfully deploy the app to my device?
Though my device was connected, it was not "authorized". I used the adb devices command to check if it was connected, and the output was something like this:
02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972 unauthorized
Note the unauthorized on the last line. After some googling, I learned to go into my phone, and toggle Developer Options > USB debugging from enabled, to disabled, to enabled again. I did this without disconnecting the phone. Re-running adb devices then showed:
02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972 device
Note device on the last line instead of unauthorized. I re-ran the Dartlang: Run Application from within Atom and the deploy worked. Somewhere in there, I had to accept the push to device from my phone.
open the device in avd manager and try to run the command again
or you can use your own mobile device just plug your device to your laptop or computer in android you have to enable USB debugging in developer mode setting
or you can build a apk and install it on your device
flutter build

Calabash-ios: Run test physical device installed ipa without xcodeproj

I am new with calabash-ios and have a dummy question is:
How possibly could I run a calabash test with real device which have installed ipa file (included calabash framework) and without xcodeproj?
Problem is I am doing QA and Dev only gives me ipa file to test without source code.
UPDATE:
I am able to run the ipa file in console and cucumber by adding BUNDLE_ID. And make sure the CFNetwork.framework is including in app framework to establish the connection.
But I got another problem to run the scenario:
1. When I run the command below:
DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID cucumber
Then I got this error:
A JSON text must at least contain two octets! (JSON::ParserError)
features/my_first.feature:8:in `Then I touch "LOG-IN/ CREATE ACCOUNT"'
all other steps was skipped
Then I run the console code
DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID calabash-ios console
Then I run server_version
I got reply back that said connection SUCCEED
But when I run start_test_server_in_background
It took me too long to wait and I see the app my physical device kept crashed and launch again and again until it stop as:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError: Calabash::Cucumber::Launcher::StartError:
"Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
2015-10-01 10:49:41.634 instruments[15640:10558880] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-10-01 10:49:42.574 instruments[15640:10558978] Attempting to change event horizon while disengage
2015-10-01 10:49:42.577 instruments[15640:10558877] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Permission to debug app
Anyone can help please! I tried to search some solution but they almost issue on simulator and they contain xcodeproj. As a QA, I dont have the source code, only .ipa file. :(
Thanks
You should set 3 variables:
$ DEVICE_TARGET=<UDID> \
DEVICE_ENDPOINT=http://<ip>:37265 \
BUNDLE_ID=com.example.YourApp cucumber
The device and the host computer should be on the same network.
The .ipa must be installed on your device.
You can do this in Xcode by dragging-and-dropping in the Device Manager window or with a third-party tool like ideviceinstaller (available with homebrew).
You should never set NO_LAUNCH.
http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_LAUNCH
You also need to enable you device for develop and turn on UIAutomation in the Settings.app > Developer.
Enabling device for development
RunLoop::Fifo::NoReaderConfiguredError
UPDATE In response to this question, I rewrote the Testing on Physical Devices Calabash iOS wiki page. Wow, that content was ancient!
As long as the file is build with calabash then that is not a problem. You just call cucumber with APP_BUNDLE_PATH to where ever your .ipa file is and should be all set.
But you should be aware that .ipa needs to be build to match the target you run the tests on.

Reading qDebug output of Apps on ios devices from command line

I am currently working on automated testing of Qt-Applications on devices running iOS. So far I am able to install and run these Applications fine, but I am unable to read their output. As far as I understood, reading this issue, Qt uses the gdb server to deliver the output of std::out and std::err to the Qt Creator but I can not get my head around on how to use this information. Besides the bundle identifier, I am given the .ipa-file of the application only. I have access to the applications code but I must not change it.
I use the libmobiledevice libraries to handle all tasks like connection, installation and execution of and on the device.
To summarize: I want to read the debug output of a Qt-written application displayed on my console, like it would be in the "Application output" window of my Creator.
I found a way using the imobiledevice libraries. By calling Idevicedebug -u <uuid> run de.foo.app I was able to execute the application. The qDebug output was prompted to std::out.
As the app crashed when started with a locked screen, I had to check for the display being idle by examining the output of idevicediagnostics ioreg IOPower first.
Now, half a year later, I found a solution that worked both elegant and stable.
I installed the ios-deploy tool using node:
npm install -g ios-deploy
Using this, I was able to install the app and listen to it's output via:
ios-deploy --debug --bundle path/to/my.app
I recieved the full qDebug, std::out and std::err output perfectly fine.
To uninstall the app, I simply added the -9 or --uninstall_only option:
ios-deploy --debug --bundle path/to/my.app --uninstall_only
Using this solution the app could be started reliably, without crashing with a locked screen

iOS (iPhone, iPad, iPodTouch) view real-time console log terminal

Is there a way to view the real-time console log to view NSLog and other debug messages in a real-time manner, such as adb logcat?
The solution documented by Apple in Technical Q&A QA1747 Debugging Deployed iOS Apps for Xcode 6 is:
Choose Window -> Devices from the Xcode menu.
Choose the device in the left column.
Click the up-triangle at the bottom left of the right hand panel to show the device console.
Two options:
libimobiledevice is installable via homebrew and works great. Its idevicesyslog tool works similarly to deviceconsole (below), and it supports wirelessly viewing your device's syslog (!)
I've written more about that on Tumblr tl;dr:
brew install libimobiledevice
idevice_id --list // list available device UDIDs
idevicesyslog -u <device udid>
with the device connected via USB or available on the local wireless network.
(Keeping for the historical record, from 2013:) deviceconsole from rpetrich is a much less wacked-out solution than ideviceconsole above. My fork of it builds and runs in Xcode 5 out of the box, and the Build action will install the binary to /usr/local/bin for ease of use.
As an additional helpful bit of info, I use it in the following style which makes it easy to find the device I want in my shell history and removes unnecessary > lines that deviceconsole prints out.
deviceconsole -d -u <device UDID> | uniq -u && echo "<device name>"
EDIT: Please use #cbowns solution - deviceconsole is compatible with iOS9 and much easier to use.
This is a open-source program that displays the iDevice's system log in Terminal (in a manner similar to tail -F). No jailbreak is required, and the output is fully grep'able so you can filter to see output from your program only. What's particularly good about this solution is you can view the log whether or not the app was launched in debug mode from XCode.
Here's how:
Grab the libimobiledevice binary for Mac OS X from my github account at
https://github.com/benvium/libimobiledevice-macosx/zipball/master
Follow the install instructions here:
https://github.com/benvium/libimobiledevice-macosx/blob/master/README.md
Connect your device, open up Terminal.app and type:
idevicesyslog
Up pops a real-time display of the device's system log.
With it being a console app, you can filter the log using unix commands, such as grep
For instance, see all log messages from a particular app:
idevicesyslog | grep myappname
Taken from my blog at http://pervasivecode.blogspot.co.uk/2012/06/view-log-output-of-any-app-on-iphone-or.html
Just open the Application Console.app on mac osX.
You can find it under Applications > Utilities > Console.
On the left side of the application all your connected devices are listed.
Try the freeware iOS Console. Just download, launch, connect your device -- et voila!
This might be what you're looking for: Xcode Organizer
device > terminal output is on iPhone configuration app
here: http://support.apple.com/kb/DL1465
You have three options:
Xcode Organizer
Jailbroken device with syslogd + openSSH
Use dup2 to redirect all STDERR and STDOUT to a file and then "tail -f" that file (this last one is more a simulator thing, since you are stuck with the same problem of tailing a file on the device).
So, to get the 2º one you just need to install syslogd and OpenSSH from Cydia, restart required after to get syslogd going; now just open a ssh session to your device (via terminal or putty on windows), and type "tail -f /var/log/syslog". And there you go, wireless real time system log.
If you would like to try the 3º just search for "dup2" online, it's a system call.
To view your iOS device's console in Safari on your Mac (Mac only apparently):
On your iOS device, go to Settings > Safari > Advanced and switch on Web Inspector
On your iOS device, load your web page in Safari
Connect your device directly to your Mac
On your Mac, if you've not already got Safari's Developer menu activated, go to Preferences > Advanced, and select "Show Develop menu in menu bar"
On your Mac, go to Develop > [your iOS device name] > [your web page]
Safari's Inspector will appear showing a console for your iOS device.
As an alternative, you can use an on-screen logging tool like ticker-log to view logs without having (convenient) access to the console.

Resources