반응형
반응형
윈도우 호스트(hosts) 파일 변경하기

 

보안프로그램이 자꾸 호스트파일을 엎어서 수동 적용할 때가 자주 발생한다.

아래경로의 파일에 호스트 경로 추가하면 된다.

만약 저장권한이 없다고 나오면, 메모장을 열기 전에 메모장 아이콘에서 마우스 우측 클릭.

관리자 권한으로 실행 후 아래 경로 파일을 열고 호스트를 추가하면 된다.

 

 

C:\Windows\System32\drivers\etc\hosts

 

# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost

 

 

 

반응형
반응형

안드로이드 테스트 툴 - Appium

 

https://github.com/appium/appium


 

Appium을 사용한 안드로이드 기능 테스팅 :

1 : https://www.imaso.co.kr/news/article_view.php?article_idx=20150731141607

2 : https://www.imaso.co.kr/news/article_view.php?article_idx=20150904170524


앱피움은 모바일 앱의 테스트 자동화를 가능하게 해주는 오픈소스 라이브러리다. 네이티브(Native), 하이브리드(Hybrid), 모바일 웹(Mobile web) 등 다양한 타입의 앱에 대한 테스트를 자동화하는 것이 앱피움의 특징이다. 앱피움을 통해 자동화된 테스트는 실제 기기나 에뮬레이터 혹은 시뮬레이터에서 실행된다.


앱피움은 플랫폼 벤더가 제공한 테스트 프레임워크에 Selenium WebDriver API로 랩핑한 클라이언트 라이브러리(Client library)들을 다양한 개발 언어로 제공한다.


Appium architecture
1. 스크립트의 API들은 WebDriver JSON Wire Protocol을 사용해 앱피움 서버와 통신한다.
2. 앱피움 서버는 스크립트가 제공하는 안드로이드 SDK 버전에 맞춰 테스트 프레임워크(UIAutomator 혹은 Selendroid)를 처리할 수 있는 모듈과 TCP 서버를 가지는 bootstrap.jar을 디바이스/에뮬레이터에 설치한다.
3. 앱피움 서버는 스크립트상에 command를 디바이스의 TCP 서버로 전달한다.
4. 기기 상의 UIAutomator 서버는 전달받은 명령어를 안드로이드 버전에 맞는 UIAutomator 혹은 Selendroid 명령어로 바꿔 실행하고, 실행 결과를 앱피움 서버로 보낸다.
5. 앱피움 서버는 콘솔에 처리 결과를 표시한다.

앱피움 실행 환경 구성하기


먼저 Node.js, NPM( nodejs.org/download) 구성이다. 홈브루(homebrew)를 사용하거나 소스를 받아 Node.js를 설치한다. Node.js를 설치하면 NPM이 함께 설치된다.


다음은 앱피움( appium.io) 설치다. NPM을 사용하거나 설치 파일을 다운로드해 앱피움과 앱피움에 종속(dependency)이 있는 모듈들을 한번에 설치하자. 앱피움 설치가 완료되면 앱피움을 실행할 수 있는지 종속성(dependency)을 체크한다.


안드로이드 애플리케이션 자동화 테스트 개발 환경 구성하기


우선 자바 JDK 환경을 구성하자. 오라클 자바 공식 사이트( www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)에서 JDK를 다운로드해 설치한다.


환경 설정 파일에 JAVA_HOME 환경변수를 만들고 JDK 패스를 설정한다. 설정된 값이 적용될 수 있도록 source 명령어를 실행한다. 환경변수 값이 제대로 설정됐는지 확인한다.


자바 IDE(통합개발환경)로 사용할 이클립스(Eclipse)를 설치하자. 이클립스 사이트( eclipse.org/downloads/)에서 소스를 다운로드해 압축을 풀면 eclipse 디렉토리가 보인다. 디렉토리 아래 eclipse App 파일을 더블클릭해 실행한다.


이제 메이븐(Maven)을 구성해 보자. 메이븐 빌드 도구를 아파치 메이븐 프로젝트 공식 사이트( maven.apache.org/source-repository.html)에서 다운로드해 설치한다. 홈브류를 사용하거나 소스를 다운로드해 메이븐을 설치하고 환경 변수를 설정한다. 설정된 값이 적용될 수 있도록 source 명령어를 실행하고 환경변수 값이 제대로 설정됐는지 확인한다.


다음으로 이클립스를 위한 메이븐 플러그인(Maven Plug in) ‘Maven Plugin for Eclipse( download.eclipse.org/technology/m2e/releases)’를 설치한다. 이클립스에서 Eclipse Help → Install New Software… 메뉴를 통해 설치하면 된다.


안드로이드 에뮬레이터 ‘지니모션(Genymotion)’을 설치해 보자. 우선 지니모션 사이트의 다운로드 페이지( www.genymotion.com/#!/download)에 진입하자. 계정을 생성한 후 에뮬레이터(Emulator) 설치 파일을 다운로드하고 지니모션 설치 파일을 더블클릭한다. 지니모션과 지니모션 셀(Shell)을 애플리케이션으로 드러그 엔 드롭해 설치하면 된다.


이제 이클립스를 위한 지니모션 플러그인(Genymotion Plug in)을 설치할 차례다. ‘Genymotion Plugin for Eclipse’는 지니모션 플러그인 페이지( plugins.genymotion.com/eclipse)에서 다운로드할 수 있다. 이클립스에서 Eclipse Help → Install New Software… 서브 메뉴를 통해 설치하면 된다.


설치가 완료되면 가상 디바이스 매니저를 클릭한다. 처음엔 디바이스가 하나도 없을 것이다. New를 클릭해 디바이스를 생성 창을 띄운다. 여기서 Add를 클릭해 디바이스를 추가한다.







반응형
반응형

iframe > embed 변경하기

 

 

<iframe width="640" height="360" src="http://www.youtube.com/embed/Szky9k_v7Zo?feature=player_embedded" frameborder="0" allowfullscreen></iframe>


엠바다 게시판에 iframe 태그를 안먹더라구요~~

이렇게 된 태그를 이렇게 바꿔주세요.

ifame > embed

embed > v


<embed width="640" height="360" src="http://www.youtube.com/v/Szky9k_v7Zo?feature=player_embedded" frameborder="0" allowfullscreen="">

 

 

 

 

.

 

 

반응형
반응형

카카오 스토리 캐시 삭제하기

 :   https://developers.kakao.com/docs/restapi/tool


   REST API Test > 카카오스토리 > 카카오스토리 정보얻기 > 링크 정보 얻기 "캐시 삭제"

 

 

 

반응형
반응형

Remote Debugging on Android with Chrome

https://developer.chrome.com/devtools/docs/remote-debugging



1. 안드로이드 폰 : 환경설정 > 개발자모드 선택 후  "USB Debugging" 모드 선택해야함.


2. PC 크롬 브라우저에  chrome://inspect.  입력.


3. PC 와 안드로이드폰을 USB로 연결.


4. PC 크롬 브라우저에 연결된 핸드폰 정보가 나온다. 브라우저에서 "inspect" 를 선택하면

   안드로이드폰에서 접속한 크롬 브라우저의 내용이 나온다.

   - 안드로이드폰의 크롬브라우저를 PC에서 보는 기능 구현.


=================================================================================

The way your web content behaves on mobile can be dramatically different from the desktop experience. Remote debugging with Chrome DevTools lets you debug live content on your Android device from your development machine.

Debugging Chrome for Android using the Chrome Developer Tools

Remote debugging on Android supports:

To begin remote debugging, you need:

  • Chrome 32 or later installed on your development machine.
  • A USB cable to connect your Android device.
  • For browser debugging: Android 4.0+ and Chrome for Android.
  • For app debugging: Android 4.4+ and a WebView configured for debugging.

Note: Remote debugging requires your version of desktop Chrome to be newer than the version of Chrome for Android on your device. For best results, use Chrome Canary(Mac/Windows) or the Chrome Dev channel release (Linux) on desktop.

If at any time you encounter problems with remote debugging, refer to the Troubleshooting section.

Follow these instructions to set up your Android device for remote debugging.

On your Android device, select Settings > Developer options.

developer options
Developer options on the Settings page.
Note: On Android 4.2 and later, the developer options are hidden by default. To enable the developer options, select Settings > About phone and tap Build number seven times.
About phone screen
Enabling the developer options on Android 4.2+.

In Developer options, select the USB debugging checkbox:

USB debugging settings in Developer options
Enabling USB debugging on Android.

An alert prompts you to allow USB debugging. Tap OK.

allow USB debugging message

Connect the Android device to your development machine using a USB cable.

Note: If you are developing on Windows, install the appropriate USB driver for your device. See OEM USB Drivers on the Android Developers' site.

After setting up remote debugging on Android, discover your device in Chrome.

On your desktop Chrome browser, navigate to chrome://inspect. Confirm that Discover USB devices is checked:

Discover USB Devices in chrome://inspect
Tip: You can also get to chrome://inspect by selecting Chrome menu > More tools > Inspect Devices.

On your device, an alert prompts you to allow USB debugging from your computer. Tap OK.

USB debugging permission alert
Tip: To skip this alert in the future, check Always allow from this computer.

The message USB debugging connected displays in the device's notification drawer.

Note: During remote debugging, Chrome prevents your device’s screen from going to sleep. This feature is useful for debugging, but is also less secure. So be sure to keep an eye on your device!

On your computer, the chrome://inspect page displays every connected device, along with its open tabs and debug-enabled WebViews.

The chrome://inspect page.
Viewing connected devices from the chrome://inspect page.

If you have problems finding your device on the chrome://inspect page, see the Troubleshooting section.

From the chrome://inspect page, you can launch DevTools and debug your remote browser tabs.

To start debugging, click inspect below the browser tab you want to debug.

Click inspect to start remote debugging

A new instance of Chrome DevTools launches on your computer. From this instance, you can interact with the selected browser tab on your device in real time.

Debugging Chrome for Android using the Chrome Developer Tools
Debug a web page on your Android phone from your laptop using Chrome DevTools.

For example, you can use DevTools to inspect web page elements on your device:

  • When you mouse over an element in the Elements panel, DevTools highlights the element on your device.
  • You can also click the Inspect Element inspect element icon icon in DevTools and tap your device screen. DevTools highlights the tapped element in the Elements panel.

Note: The version of Chrome on your device determines the version of DevTools used during remote debugging. For this reason, the remote debugging DevTools might differ from the version that you normally use.

Here are a few tips to help get you started with remote debugging:

  • Use F5 (or Cmd+r on Mac) to reload a remote page from the DevTools window.
  • Keep the device on a cellular network. Use the Network panel to view the network waterfall under actual mobile conditions.
  • Use the Timeline panel to analyze rendering and CPU usage. Hardware on mobile devices often runs much slower than on your development machine.
  • If you’re running a local web server, use port forwarding or virtual host mapping to access the site on your device.

On Android 4.4 (KitKat) or later, you can use DevTools to debug WebView content in native Android applications.

WebView debugging must be enabled from within your application. To enable WebView debugging, call the static method setWebContentsDebuggingEnabled on the WebView class.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      WebView.setWebContentsDebuggingEnabled(true);
  }

This setting applies to all of the application's WebViews.

Tip: WebView debugging is not affected by the state of the debuggable flag in the application's manifest. If you want to enable WebView debugging only when debuggable is true, test the flag at runtime.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE))
    { WebView.setWebContentsDebuggingEnabled(true); }
  }

The chrome://inspect page displays a list of debug-enabled WebViews on your device.

To start debugging, click inspect below the WebView you want to debug. Use DevTools as you would for aremote browser tab.

Inspecting elements in a WebView
Debugging a remote Android WebView with the Chrome DevTools.

The gray graphics listed with the WebView represent its size and position relative to the device's screen. If your WebViews have titles set, the titles are listed as well.

Shifting your attention between screens isn’t always convenient. Screencast displays your device's screen right alongside DevTools on your development machine. You can interact with the content on your device from the screencast too.

As of KitKat 4.4.3, screencast is available for both browser tabs and Android WebViews.

To start screencasting, click the Screencast screencast icon icon in the upper right corner of your remote debugging DevTools window.

screencast location in DevTools
The Screencast icon.

The Screencast panel opens on the left and displays a live view of your device's screen.

Open a new remote tab.
Live interactive screencast from your Android to your laptop.

Screencast only displays page content. Transparent portions of the screencast are covered by the omnibox, device keyboard, and other device interfaces.

Note: Because screencast continuously captures frames, it has some performance overhead. If your tests are sensitive to frame rate, disable screencast.

When you interact with the screencast, clicks are translated into taps, firing proper touch events on the device. Keystrokes from your computer are sent to the device, so you can avoid typing with your thumbs.

Other DevTools work with the screencast too. For example, to inspect an element, click the Inspect Element inspect element icon icon and then click inside the screencast.

Tips: To simulate a pinch gesture, hold Shift while dragging. To scroll, use your trackpad or mouse wheel or fling with your pointer.

Your phone can't always reach the content on your development server. They might be on different networks. Moreover, you might be developing on a restricted corporate network.

Port forwarding on Chrome for Android makes it easy to test your development site on mobile. It works by creating a listening TCP port on your mobile device that maps to a particular TCP port on your development machine. Traffic between these ports travels through USB, so the connection doesn't depend on your network configuration.

To enable port forwarding:

  1. Open chrome://inspect on your development machine.
  2. Click Port Forwarding. The port forwarding settings display.
    port forwarding button location
  3. In the Device port field, enter the port number you want your Android device to listen on. 
    (The default port is 8080.)
  4. In the Host field, enter the IP address (or hostname) and port number where your web application is running. 
    This address can be any local location accessible from your development machine. Currently, port numbers must be between 1024 and 32767 (inclusive).
  5. Check Enable port forwarding.
  6. Click Done.
    port forwarding dialog
    The port forwarding settings.

The port status indicators on chrome://inspect are green when port forwarding is successful.

viewing local content on mobile
Viewing the content of your local web server on Android using port forwarding.

Now you can open a new Chrome for Android tab and view the content of your local server on your device.

Port forwarding works great when you're developing on localhost. But there are cases when you might be using a customized local domain.

For example, suppose you're using a third party JavaScript SDK that only works on whitelisted domains. So you added an entry, such as 127.0.0.1 production.com, to your hosts file. Or maybe you configured a customized domain using virtual hosts on your web server (MAMP).

If you want your phone to reach content on your customized domain, you can use port forwarding in combination with a proxy server. The proxy maps requests from your device to the correct location on the host machine.

Virtual host mapping requires you to run a proxy server on the host machine. All requests from your Android device will be forwarded to the proxy.

To set up port forwarding to a proxy:

  1. On the host machine, install proxy software such as Charles Proxy (free trial available) or Squid.
  2. Run the proxy server and note the port that it's using.

    Note: The proxy server and your development server must be running on different ports.

  3. In a Chrome browser, navigate to chrome://inspect.
  4. Click Port forwarding. The port forwarding settings display.
    port forwarding button location
  5. In the Device port field, enter the port number that you want your Android device to listen on. 
    Use a port that Android allows, such as 9000.
  6. In the Host field, enter localhost:xxxx, where xxxx is the port your proxy is running on.
  7. Check Enable port forwarding.
  8. Click Done.
    port forwarding dialog
    Port forwarding to a proxy.

The proxy on the host machine is set up to make requests on behalf of your Android device.

Your Android device needs to communicate with the proxy on the host machine.

To configure the proxy settings on your device:

  1. Select Settings > Wi-Fi.
  2. Long-press the network that you are currently connected to.

    Note: Proxy settings apply per network.

  3. Tap Modify network.
  4. Select Advanced options. 
    The proxy settings display.
    phone proxy settings
    Proxy settings on the device.
  5. Tap the Proxy menu and select Manual.
  6. In the Proxy hostname field, enter localhost.
  7. In the Proxy port field, enter 9000.
  8. Tap Save.

With these settings, your device forwards all of its requests to the proxy on the host machine. The proxy makes requests on behalf of your device, so requests to your customized local domain are properly resolved.

Now you can load local domains on Chrome for Android just as you would on the host machine.

virtual host mapping
Using virtual host mapping to access a customized local domain from an Android device.

Tip: To resume normal browsing, remember to revert the proxy settings on your device after you disconnect from the host.

  • If you are developing on Windows, verify that the appropriate USB driver for your device is installed. SeeOEM USB Drivers on the Android Developers' site.
  • Verify that the device is connected directly to your machine, bypassing any hubs.
  • Verify that USB debugging is enabled on your device. Remember to accept the USB debugging permission alerts on your device.
  • On your desktop browser, navigate to chrome://inspect and verify that Discover USB devices is checked.
  • Remote debugging requires your version of desktop Chrome to be newer than the version of Chrome for Android on your device. Try using Chrome Canary (Mac/Windows) or the Chrome Dev channel release (Linux) on desktop.

If you still can't see your device, unplug it. On your device, select Settings > Developer options. Tap Revoke USB debugging authorizations. Then, retry the device setup and discovery processes.

  • On your device, open the Chrome browser and navigate to the web page you want to debug. Then, refresh the chrome://inspect page.
  • Verify that WebView debugging is enabled for your app.
  • On your device, open the app with the WebView you want to debug. Then, refresh the chrome://inspectpage.

Lastly, if remote debugging still isn't working, you can revert to the legacy workflow using the adb binary from the Android SDK.

You no longer need to configure ADB or the ADB plugin to debug remote browser tabs and WebViews. Remote debugging for Android is now part of the standard Chrome DevTools. It works on all operating systems: Windows, Mac, Linux, and Chrome OS.

If you do encounter problems with remote debugging, you can try the legacy workflow using the adb binary from the Android SDK.

Note: The direct USB connection between Chrome and the device might interrupt youradb connection. Before establishing your adb connection, uncheck Discover USB deviceson chrome://inspect. Then, disconnect and reconnect the device.

For information about the remote debugging interaction protocol, refer to the Debugger Protocoldocumentation and chrome.debugger.



반응형
반응형

OpenSSL Convert PEM  

 

https://www.sslshopper.com/ssl-converter.html

 

Convert PEM to DER

openssl x509 -outform der -in certificate.pem -out certificate.der

Convert PEM to P7B

openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer

Convert PEM to PFX

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

OpenSSL Convert DER

Convert DER to PEM

openssl x509 -inform der -in certificate.cer -out certificate.pem

OpenSSL Convert P7B

Convert P7B to PEM

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

Convert P7B to PFX

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer

OpenSSL Convert PFX

Convert PFX to PEM

openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes

If you need to convert a Java Keystore file to a different format, it usually easier to create a new private key and certificates but it is possible to convert a Java Keystore to PEM format.

 

반응형

+ Recent posts