Skip to content

Instantly share code, notes, and snippets.

# creates a post
MODE="CREATE"
POST_FILE=""
# choose editor (sublime/default: vi)
if [[ $1 == [Ss]* ]]; then
txt_editor='sublime'
else
txt_editor='vi'
fi
[Espresso] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/rakib.amin/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps'
[debug] [ADB] Running '/Users/rakib.amin/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_p_apps'
[debug] [ADB] Running '/Users/rakib.amin/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy'
[debug] [ADB] Removing forwarded port socket connection: 8300
[debug] [ADB] Running '/Users/rakib.amin/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8300'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1574234302290 (15:18:22 GMT+0800 (+08))
[debug] [W3C] Encountered internal error running command: A new session could not be created. Details: Error executing adbExec. **Original error: 'Command '/Users/rakib.amin/Libra
@rakib-amin
rakib-amin / purgeAndroid.txt
Created May 10, 2019 08:05
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@rakib-amin
rakib-amin / gist:5b7239bab9a15b925b0f400f6be1e318
Created March 21, 2019 07:36 — forked from tsohr/gist:5711945
Android activity manager "am" command help
adb shell am
usage: am [subcommand] [options]
usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]
[--R COUNT] [-S] [--opengl-trace] <INTENT>
am startservice <INTENT>
am force-stop <PACKAGE>
am kill <PACKAGE>
am kill-all
am broadcast <INTENT>
am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]
@rakib-amin
rakib-amin / DocComments.java
Created January 14, 2019 04:16
Reference: How to Write Doc Comments for the Javadoc Tool https://www.oracle.com/technetwork/articles/java/index-137868.html
/**
* Graphics is the abstract base class for all graphics contexts
* which allow an application to draw onto components realized on
* various devices or onto off-screen images.
* A Graphics object encapsulates the state information needed
* for the various rendering operations that Java supports. This
* state information includes:
* <ul>
* <li>The Component to draw on
* <li>A translation origin for rendering and clipping coordinates
@rakib-amin
rakib-amin / Communicator.h
Created December 10, 2018 06:42 — forked from rjungemann/Communicator.h
How to open a TCP socket in Objective-C
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;
@rakib-amin
rakib-amin / run.md
Last active September 8, 2018 06:51
Run emulator From command line (macOS)

$ cd /Users/johndoe/Library/Android/sdk/emulator

$ ./emulator -list-avds

$ ./emulator -avd Pixel_2_XL_API_27

@rakib-amin
rakib-amin / solution.md
Last active January 29, 2018 10:31
Creating a Java cmd-app that uses selenium Web Driver using libs from Gradle project
  • First goto your gradle project > Build Project
  • Then in build\distributions\project-1.0-SNAPSHOT.zip\libs\ dir, you'll find the .jar file you need, extract all you need to a dir (e.g 'mylibs')
  • goto cmd-app project
  • Ctrl + Alt + Shift + S to open Project Structure
  • goto Project Settings > Libraries > + button > New Project Library > Java > Open mylibs/ and select all > Apply
  • Voila
@rakib-amin
rakib-amin / gradle_path.txt
Created January 13, 2018 18:57
Set Gradle Path in macOS High Sierra
Gradle Home: /usr/local/Cellar/gradle/4.4.1/libexec
@rakib-amin
rakib-amin / Solution.md
Created December 8, 2016 07:41
Resolving Project SDK Change error in Intellij IDEA on Windows

Goto File > Settings > Build, Execution, Deployment > Compiler > Java Compiler

  • Use Compiler > Javac
  • Project bytecode version: 1.X
  • Per module bytecode version > Target bytecode version > 1.X

Goto File > Project Structure > Project

  • Project SDK > 1. X
  • Project Language Level > X - ....