Test instrumentation process crashed - where is the .txt file? - android-gradle-plugin

Sometimes, while Espresso testing, I see the following exception.
Test instrumentation process crashed. Check package_name.TestName#methodName.txt for details
Where is this .txt file stored? I can't seem to find it anywhere.
Use Case
In Jenkins (CI), I want the logs to see exactly what stacktrace caused the crash.

If you are working with an emulator, in A.S open Device File Explorer and go to:
/data/user_de/0/android.support.test.orchestrator/files/, then you can look for a particular file there
EDIT: June 25 - 2019 >> If you have updated to AndroidX dependencies, then the .txt file is located in
/data/user_de/0/androidx.test.orchestrator/files/

In my case, it was simpler to just check Logcat, rather than listen to that recommendation

For others encountering this issue, as #antek pointed out the files might not be accessible on a non-rooted device. You might try using an emulator running a non-Google Play API where you can obtain a root shell.
adb root
adb shell
ls /data/data/androidx.test.orchestrator/files
Alternatively, you could try running the tests using the debugger.

I could not find the text file, but I was able to get logcat and view the fatal that caused the orchestrator to crash
first I clear the logcat
adb logcat -c
then I run the test, then I grab the logcat
adb logcat > ~/Desktop/logcat
then I open logcat file and search for string FATAL

I just did wipe data in Android studio for my emulator using Device manager.
Restarted the emulator and run the test works for me

Related

PhpStorm doesn't see any android devices

Now command npx react-native run-android work in Windows command line, but when I try call it in PhpStorm Terminal:
"adb" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ©
Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.
info Launching emulator...
info Installing the app...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
Before I reinstalled Windows, it worked fine. I don't understand what I forgot to configure. Where could be the problem?
I just reinstall IDE and problem went away.
Probably it's too late but it may still help others.
"adb" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ©
Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.
Is actually a Russian equivalent of
'adb' is not recognized as an internal or external command, operable program or batch file
affected by some encoding issues.
It means that you need to add the path to your adb file to the System PATH variable and then restart the IDE.
adb should be located in the platform-tools folder of your android SDK.

IBM MobileFirst Test Workbench - Running a test from the command line

I am trying to run a test from the command line using the cmdline.bat file, as suggested in https://www-01.ibm.com/support/knowledgecenter/SS2HS7_8.6.0/com.ibm.rational.test.lt.common.doc/topics/truncmdln.html
It is not like I am not getting some activity, but I haven't been able to understand how it properly works.
This is my current command:
D:\Eclipse\eclipse\plugins\com.ibm.rational.test.lt.cmdlineexecute_
7.2.960.v20140710_1337>cmdline.bat -workspace C:\MobileFirstWorksp ace -project Test -eclipsehome D:\Eclipse\eclipse -plugins D:\Eclipse\eclipse\plugins -suite prueba2.testsuite -results
newResults
It runs for 45 to 72 seconds. My CommandLineLog.txt file shows the following:
Adaptador convertido en instancia con D:\Programacion\Eclipse\eclipse
log4j:WARN No appenders could be found for logger
(org.apache.http.impl.conn.PoolingClientConnectionManager). log4j:WARN
Please initialize the log4j system properly. 2015-04-08
17:18:20.810:INFO:oejs.Server:jetty-8.1.14.v20131031 2015-04-08
17:18:20.847:INFO:oejs.AbstractConnector:Started
SelectChannelConnector#0.0.0.0:7878 2015-04-08
17:18:20.849:INFO:oejs.AbstractConnector:Started
SelectChannelConnector#0.0.0.0:7080
But I can't find any results file, there are no results files in the directory I ran the command or either in the Test project folders. Does anyone know where should I find those files?
It seems you have not a device connected to your workbench.
In order to get a result :
You should first launch RTW in the classical way with the ui.
Then you have to launch a simulator or a device and connect it to your workbench through the iOS Native or Web client (Of course, the instrumented app should be installed on the simu/device).
Siwtch to the passive mode (on the client).
You could now close the workbench.
Finally just launch your command line as you did before.
The workbench will start and wait for a client to be connected, ... after 30 seconds maximum the iOS Client (native or web) will connect to the workbench and the playback should start.
Hope it will help you.
Best regards, Alexandre.
By default, the reports are generated in your workspace and have the extension .moebreport (it's an zipped XML file)
You can ask to export it at the CLI with a preference. Open the prefs and go in Test > Performance Test Reports > Export Reports and select Command Line and Mobile and Web UI
Thanks.
Dominique

App get Rejected: crashes on launch , but worked fine for me on all devices as well

My app is for the iPhone only .And it is working fine on all devices but when submitted the app it get rejected by apple by saying .......
On 1st time submission
We found your app crashed on launch so we were unable to review it.
Please revise your app and test it on a device to ensure it will launch without crashing, and that it runs as expected, before resubmitting.
this the crash report link please
this is the crash report
crash report
on second submission it get rejected they says
Thank you for your resubmission. However, we were still unable to review your app, as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.
Specifically, upon review we found the application will shortly crash after launch.
they send crash report
on second time submission
on second time submission
I didn't get where i am doing wrong ,please check this ,Thanks in advance
I also try Bhavin step to find the crash location but terminal show's me like that
I found the solution. We can just directly drag and drop the crash-report on the device log.
Then it will convert the crash report into readable format.
STEPS:
Attach your device to mac.
Open Xcode
Goto window from menu bar
Click on devices like this
Now, drag and drop your crash report you received from apple. It will symbolicate it and show you in readable format. If the file extension is .txt, change it to ".crash".
Follow these steps :
Get the .ipa file that you submitted to the app store.
Rename the extention .ipa with .zip , extract it. You'll get a Payload Folder which contains .app file.
Create a folder with this .app file and crash log file.
Now, open terminal application and go to the folder created in above step (using cd command).
Run this magic line :
atos -arch armv7 -o YourAppName.app/YourAppName MEMORY_LOCATION_OF_CRASH
Where, MEMORY_LOCATION_OF_CRASH = location where your app crashed as
per the report.
It'll give you the exact line, method name which resulted in crash.
If you test your app and it works fine but Apple keeps rejecting it then you need to test it on release mode not debug mode as follows:
Edit scheme > Run > Build configuration > release
Hope this helps someone because I came across this issue and it took me too long to sort it out!

calabash-android block in start_test_server_in_background

I've been trying to troubleshoot the issue I am having after I changed my computer with getting .apk file to run properly. I have read all the various solutions, but none worked so far.
I continue to get this error can can't figure out why:
Starting calabash-android console...
Loading /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/irbrc
Running irb...
irb(main):001:0> start_test_server_in_background
RuntimeError: App did not start
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:609:in block in start_test_server_in_background'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:inperform'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in retriable'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:608:instart_test_server_in_background'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:125:in start_test_server_in_background'
from (irb):1
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/bin/irb:11:in'
What am I doing wrong? What am I not seeing? Is there a solution?
On Mac OS X 10.9.4. The app get's reinstalled when I run reinstall_apps, and when I run start_test_server_in_background I see the app open in the emulator. But, then I get the above error. The app is still usable and running in the emulator.
I'm new at calabash install so please be gentle and detailed if you have come across anything like this.
Try running this command:
calabash-android resign path/to/file.apk
Delete all Test_Server, delete android app from folder and copy new one after that
Try to:
calabash-android console app-debug.apk
irb> reinstall_apps
irb> start_test_server_in_background
it should start
and after that if it wont recognise server try calabash-android resign app-debug.apk
and calbash-android run app-debug.apk
Delete the test_server folder and resign your apk file
calabash-android resign path/to/file.apk
Then open the console
calabash-android console path/to/file.apk
and
reinstall app by typing
reinstall_apps
then start your app
start_test_server_in_background

How do I symbolicate a crash report of a Mac OS X app that a user emailed to me?

I am working on an app that I have sent to a few beta testers. Within just a few minutes of launching the app a user got a crash. When the window poped up saying the app had crashed he copied all of the text in the details section and emailed it to me. I have saved the text into a plain text file and given it the .crash extension which causes it to be opened by console like a regular crash report so I think I have the extension right (but maybe not).
The version I sent out was built by Xcode with the Archive option so Xcode knows where the app and .dSYM are.
I know that with iPhone apps you can drag a crash report to the organizer and Xcode will symbolicate it for you. I can not find anywhere that will take a Mac crash report.
I have looked at atos but it talks about memory locations including the location the app was running at and I don't see that information listed in the report I have. Looking at the raw crash report it looks like a view controller was released early but I can't really tell if that was the cause or a symptom.
My real question is; is there a way to have Xcode symbolicate the report or a tool that I can just hand over the .dSYM file, app, and report and get back a symbolicated report?
I've looked all over Google but everything I find (other than the previously mentioned man pages for atos) is about symbolicating iPhone reports, not Mac OS X ones.
Or as in answer https://stackoverflow.com/a/18354072/317461
Put your release build and your .dSYM file in the same directory and open terminal
$cd directory
$lldb MyApp.app
(lldb) image lookup -v --address 0x00085f3c
We had the same problem with our app and I was symbolicating the crash reports manually line by line with atos.
I now tweaked Apple's symbolicate script such that it works with Mac apps and crash reports from PLCrashReporter.
https://github.com/lksnmnn/Symbolicate-CrashReports
How to use it:
Make sure you have all of the following files on your computer:
The crash report: report.crash
The dSYM file of your app: MyApp.dSYM
The executable / app folder of your app: MyApp.app
The improved symbolicate script: symbolicatecrash
Now go in the command line (Terminal) and do the following:
# set the developer directory
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
# Now run the script
/Path/To/symbolicatecrash /Path/To/report.crash > /Path/To/readable_report.crash
# Use -v for verbose logging.
The script will find your dSYM and your executable and symbolicates as much as it cans. You will now find your symbolicated report in the stated output file readable_report.crash
Build settings:
For proper reports and symbols, set your build settings to this:
Strip Debug Symbols During Copy: Yes
Strip Style: All Symbols
Strip Linked Product: Yes
Edit: Improved the answer such that it aligns with the Stack Overflow answer policy.
You can use GDB for Symbolication, Put your release build and your .dSYM file in the same directory
open terminal
$ cd directory
$ gdb MyApp.app
(gdb) info line *0x00085f3c